Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Button: Inaccurate tap area. How should I fix it?
I was also surprised by the tap area being larger than the frame of the button. By accident I found that if you insert a UIKit view behind the SwiftUI button then the tap area on the button will behave as expected. No idea if this is bug or not. struct ContentView: View { var body: some View { ZStack { UIKitView() .ignoresSafeArea() Button("Hell, world") {} .border(Color.black) } } } #Preview { ContentView() } struct UIKitView: UIViewRepresentable { func makeUIView(context: Context) -> UIView { return UIView() } func updateUIView(_ view: UIView, context: Context) {} }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’25
Reply to iOS 17 beta AVAudioPlayer mp3 problem
Did anyone find a workaround for this!? I'm seeing this with Xcode 15 RC (15A240d), but only when running on the Simulator. When I run on device while connected to Xcode, or make an AppStore or TestFlight build everything works fine. Also I don't get any crashes when I turn on the Address Sanitizer, either on Simulator or Device.
Topic: Media Technologies SubTopic: General Tags:
Sep ’23