I'm having this issue with SwiftUI on Mac Catalyst wherein a simple view like the following :
struct ContentView: View {
@State var count : Int = 0
var body: some View {
HStack{
Button("tap me"){
count += 1
}
Button("test \(count)"){
count += 1
}.buttonStyle(CustomButtonStyle())
Button("test \(count)"){
count += 1
}.buttonStyle(CustomButtonStyle())
Button("test \(count)"){
count += 1
}.buttonStyle(CustomButtonStyle())
}
}
}
struct CustomButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration
.label
}
}
The button with no style (but also everything else from pickers to sliders) becomes unresponsive after a number of renders. This happens only when two or more Buttons with custom style are visible on the screen. Having different styles doesn't solve the issue. Have you encountered this issue before? Is it a bug with SwiftUI on mac?