My solution is a bit hacky. I added the built-in tool PKToolPicker and displayed the tools. When selecting Text("Lasso"), I set self.toolPicker.setVisible(true, forFirstResponder: context.coordinator) so that PKLassoTool can be used. When selecting other tools, I set self.toolPicker.setVisible(false, forFirstResponder: context.coordinator).
It's quite cumbersome, and I hope there is a better way.
let toolPicker = PKToolPicker()
func makeCoordinator() -> Coordinator {
Coordinator()
}
class Coordinator: NSObject, PKToolPickerObserver {
....
}
Post
Replies
Boosts
Views
Activity
ITMS-90338: Non-public API usage - The app contains or inherits from non-public classes in Contents/MacOS/Whiteboard: UIPrintPageRenderer, UISimpleTextPrintFormatter . If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/
Why doesn't Apple pay attention to this bug? A year has passed since then.
Why doesn't Apple pay attention to this bug?
I had the same problem, and what's worse, when I changed all the buttons to “Button action” form, the “override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) ” in my UIVIEW. doesn't work.
I tried to add a piece of code
“
.gesture(DragGesture()
.onChanged { value in
}
.onEnded { value in
}
)
”
and it gets better, but sometimes it still fails to click!
#if targetEnvironment(macCatalyst)
Anytools()
.gesture(DragGesture()
.onChanged { value in
}
.onEnded { value in
}
)
#else
Anytools()
#endif
I had the same problem, and what's worse, when I changed all the buttons to “Button action” form, the “override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) ” in my UIVIEW. doesn't work.
I tried to add a piece of code
“
.gesture(DragGesture()
.onChanged { value in
}
.onEnded { value in
}
)
”
and it gets better, but sometimes it still fails to click!
#if targetEnvironment(macCatalyst)
Anytools()
.gesture(DragGesture()
.onChanged { value in
}
.onEnded { value in
}
)
#else
Anytools()
#endif