My iPad app needs to be able to completely dismiss specific touches i.e. those that come from a finger or stylus and not from, say, the palm of your hand. The view has multi-touch enabled so that I analyse each touch separately.
I can currently differentiate between these touches using the majorRadius
attribute but I'm not sure how I might be able to dismiss the larger touches i.e. those greater than my decided threshold.
let touchThreshold : CGFloat = 21.0
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
if touch.majorRadius > touchThreshold {
//dismiss the touch(???)
} else {
//draw touch on screen
}
}
}
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
if touch.majorRadius > touchThreshold {
//dismiss the touch(???)
} else {
//draw touch on screen
}
}
}