Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioFileWaveform using with changing URLs #89

Open
mahal opened this issue Jun 12, 2024 · 0 comments
Open

AudioFileWaveform using with changing URLs #89

mahal opened this issue Jun 12, 2024 · 0 comments

Comments

@mahal
Copy link
Contributor

mahal commented Jun 12, 2024

Description

Consider following View (pseudo code):

var audioFiles: [AudioFile] // set somewhere on init

var body: some View {
     let audioFile = audioFiles[loadedFileIndex]
     Picker("Sound File", selection: $loadedFileIndex) {
          ForEach(audioFiles.indices, id: \.self) { index in
               Text("\(.audioFiles[index].name)")
          }
      }
     AudioFileWaveform(url: audioFile.url, color: .blue) 
}

This will not update AudioFileWaveform with the new file chosen.

Proposed Solution

See PR 90

Describe Alternatives You've Considered

.didSet on var url: URL of AudioFileWaveform, didn't work
the deprecated onChange() didn't know how to test / implement

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant