Skip to content

Instantly share code, notes, and snippets.

@christianselig
Created February 15, 2024 18:23
Show Gist options
  • Save christianselig/e27953dfd8b448cdd3bea996d0844f4c to your computer and use it in GitHub Desktop.
Save christianselig/e27953dfd8b448cdd3bea996d0844f4c to your computer and use it in GitHub Desktop.
import SwiftUI
import MediaPlayer
struct ContentView: View {
var body: some View {
VStack {
VolumeSlider()
.frame(width: 500.0, height: 50.0)
}
}
}
struct VolumeSlider: UIViewRepresentable {
func makeUIView(context: Context) -> MPVolumeView { .init(frame: CGRect.zero) }
func updateUIView(_ view: MPVolumeView, context: Context) {}
}
#Preview(windowStyle: .automatic) {
ContentView()
}
@christianselig
Copy link
Author

@kemalenver Ah that's brutal, yeah looks like Apple didn't get around to fixing this one then unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment