I want to create a button, but for some reason it does not work. The text message is not printed in the console.
import SwiftUI
struct Test: View {
var body: some View {
NavigationView {
Text("My Test")
.navigationTitle("Welcome")
.toolbar {
Button("Help") {
print("Help tapped!")
}
}
}
}
}
struct Test_Previews: PreviewProvider {
static var previews: some View {
Test()
}
}