Buttons don't work in my canvas and in the simulator.

Hello, I'm new to Xcode and trying to understand the first programs. Unfortunately, the buttons don't work in my canvas and in the 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. What do I have to set in the Xcode Editor or in the Siimulator so that the buttons work in simulation mode? I really appreciate 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 { VStack { Button("Tap me") { print("tapped") } } } }

struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }

maybe canvas is not the right name. I meant the preview in Xcode.

it could maybe be related to the simulator somehow. But I can't find anything similar as a problem in any forum

Buttons don't work in my canvas and in the simulator.
 
 
Q