I'm trying to restrict the handling of touch events for a UIView subclass to certain touch types, i.e. the pencil.
Of course I have read the classic question regarding a similar topic:
iOS - forward all touches through a view
In the discussion I found, that the touches of the event are added to the event at a later stage, which can easily be verified:
public override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
let touches = event?.allTouches // This is always nil, touches are added later :-/
return super.point(inside: point, with: event)
}
So it seems that hit testing can not be manipulated to solve my task… any other ideas?
Thanks!