Reputation: 41
I am trying to detect when a user taps anywhere within my Today Extension widget.
Currently I have a tap gesture recognizer on the primary view which contains all the labels displayed within the widget. However, with this configuration, only taps on the individual labels contained within the view are detected. If a tap occurs within the view, but not on a visible label, the tap does not appear to be detected.
I know this has to do with tap detection not occurring on any visual object that has less than 100% opacity. Unfortunately I cannot figure out how to detect taps on anything that isn't an opaque visual object.
Is there any way to simply detect a tap anywhere within the widgets bounds, including negative space?
Thanks!
Upvotes: 2
Views: 954
Reputation: 41
Ended up just putting a view that covered the entire background of the widget's container. Setting the view's fill opacity and the view's opacity itself both to .1% made it effectively invisible while still capturing taps. :P
Upvotes: 2