Skip to content

Commit

Permalink
Revert "fix onChange of deprecation warnings for visionOS 1.0"
Browse files Browse the repository at this point in the history
This reverts commit 4888126.
  • Loading branch information
dmrschmidt committed Oct 21, 2023
1 parent 4888126 commit 2939ae9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 51 deletions.
46 changes: 0 additions & 46 deletions Sources/DSWaveformImageViews/SwiftUI/VersionMigrations.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Sources/DSWaveformImageViews/SwiftUI/WaveformLiveCanvas.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public struct WaveformLiveCanvas: View {
.onAppear {
waveformDrawer.shouldDrawSilencePadding = shouldDrawSilencePadding
}
.modifier(OnChange(of: shouldDrawSilencePadding, action: { newValue in
.onChange(of: shouldDrawSilencePadding) { newValue in
waveformDrawer.shouldDrawSilencePadding = newValue
}))
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions Sources/DSWaveformImageViews/SwiftUI/WaveformView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public struct WaveformView<Content: View>: View {
guard samples.isEmpty else { return }
update(size: geometry.size, url: audioURL, configuration: configuration)
}
.modifier(OnChange(of: geometry.size, action: { newValue in update(size: newValue, url: audioURL, configuration: configuration) }))
.modifier(OnChange(of: audioURL, action: { newValue in update(size: geometry.size, url: audioURL, configuration: configuration) }))
.modifier(OnChange(of: configuration, action: { newValue in update(size: geometry.size, url: audioURL, configuration: newValue) }))
.onChange(of: geometry.size) { update(size: $0, url: audioURL, configuration: configuration) }
.onChange(of: audioURL) { update(size: geometry.size, url: $0, configuration: configuration) }
.onChange(of: configuration) { update(size: geometry.size, url: audioURL, configuration: $0) }
}
}

Expand Down

0 comments on commit 2939ae9

Please sign in to comment.