Starting in Xcode 12 buttons are causing my code to not compile.
At the basic level it's failing which was not failing in Xcode 11.*.
At the basic level it's failing which was not failing in Xcode 11.*.
Code Block import SwiftUI struct Foo1: View { var body: some View { VStack { Button(action: print("How about now?")) { Text("test") } } } } struct Foo1_Previews: PreviewProvider { static var previews: some View { Foo1() } }
Your code causes error even in Xcode 11.
Cannot convert value of type '()' to expected argument type '() -> Void'
The line should be:
But with this change, the code compiles well both in Xcode 12 and 11.7.
There may be some code failing which was not failing in Xcode 11, but currently shown code is not a good example.
Cannot convert value of type '()' to expected argument type '() -> Void'
Code Block Button(action: print("How about now?")) {
The line should be:
Code Block Button(action: {print("How about now?")}) {
But with this change, the code compiles well both in Xcode 12 and 11.7.
There may be some code failing which was not failing in Xcode 11, but currently shown code is not a good example.