Hi!
I created a custom modifier which looks like this:
For some reason, while I use this modifier on a view, like this
the SwiftUI Preview breaks. This is the error I'm getting in the diagnosis window: MessageSendingError: Connection interrupted: send message to agent. This used to work fine in Xcode 11.
Please find attached the crash log as well.
I created a custom modifier which looks like this:
Code Block extension View { func onTapGestureWithFeedback(action: @escaping () -> Void) -> some View { let impact = UIImpactFeedbackGenerator(style: .medium) let defaults = UserDefaults.standard let reduceHaptics = defaults.object(forKey:"reduceHaptics") as! Bool return self.onTapGesture { if !reduceHaptics { impact.impactOccurred() } action() } } }
For some reason, while I use this modifier on a view, like this
Code Block struct TestView: View { var body: some View { Text("Hello World") .onTapGestureWithFeedback { print("test") } } }
the SwiftUI Preview breaks. This is the error I'm getting in the diagnosis window: MessageSendingError: Connection interrupted: send message to agent. This used to work fine in Xcode 11.
Please find attached the crash log as well.