I'm using a UIView
subclass in my Today widget. The view makes use of swiping gestures. However, these gestures either scroll the whole Notification Center up and down, or make the Notification Center switch from Today to Notifications.
Is there any way to prevent the touch events to be bubbled up to the Notification Center scroll view? Using [self setExclusiveTouch:YES];
in the subclass did not solve it unfortunately.
Is there any way to prevent the touch events to be bubbled up to the Notification Center scroll view? Using [self setExclusiveTouch:YES]; in the subclass did not solve it unfortunately.
No. Because of the remote view hosting that your Today widget is being presented inside, [self setExclusiveTouch:YES]
doesn't quite do what you want.
The rough architecture in iOS 8.0 is:
[User touch creates a UITouch] | v Notification Center (UIScrollView) | v UIRemoteView container (presents your UIView) [crosses process boundary] | v your Today widget's UIView
Think of the touch as basically becoming cloned when it crosses the process boundary. Your view's exclusive touch desires are only relevant in your widget's process space/window, and don't propagate back outwards to the Notification Center which is hosting you remotely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With