Hello, I'm new to Xcode and trying to understand the first programs. Unfortunately the buttons don't work in my preview and simulator. You can't trigger a click with the mouse. But as soon as you use your own iPhone instead of the simulator, the clicks or taps on the buttons work. With the Accessibility Inspector it is possible to control the buttons and trigger the click. Everything works fine on my MacBook Air, just not on my iMac. I haven't found anything similar on the forums either. I've already completely erased and reinstalled Xcode, swapped out the mouse and keyboard, tested various settings in Xcode and the simulator, and compared MacBook and iMac, all to no avail. The mouse does not trigger a click on the simulator. What do I have to set in the Xcode editor or in the simulator so that the buttons work in the preview and simulation mode? I'm really grateful for any help or advice.
Xcode: Version 14.3.1 (14E300c) iOS16.4 iMac: 3.4GHz quad-core Intel Core i5 / 32GB 2400MHz DDR4 Simulator iPhone 14 / 13 Pro / SE (2.) / XS
import SwiftUI
struct ContentView: View { var body: some View { HStack { Button("Tap me") { print("tapped1") } Button("test") { print("tapped2") } } }
}
struct Previews_ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }