I tried to write a simple view with a stepper, but it immediatly crashes on MacOS if I hover the mouse over the stepper in in NSHostingView.hoverRegionIdentifier(for:) ()
struct ContentView: View {
var body: some View {
Stepper(onIncrement: { print("Inc") }, onDecrement: { print("Dec") }, label: { Text("Stepper") })
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
Is there something wrong or it is a bug in SwiftUI?
I even tried to write my own view with NSViewRepresentable
struct MyStepper: NSViewRepresentable {
func updateNSView(_ nsView: NSView, context: NSViewRepresentableContext<MyStepper>) {
}
func makeNSView(context: Context) -> NSView {
return NSStepper(frame: .zero)
}
}
struct ContentView: View {
var body: some View {
MyStepper()
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
Same problem.