I have a UITapGestureRecognizer
(TapGes) on the UIWindow
with target on a UIViewController
(vc).
I don't and I can't have a strong pointer to TapGes from vc. So after certain time vc is going to dealloc (when its done) and at this point I would like to remove TapGes from the UIWindow but I haven't found a way to do so.
If it was a view I would do something like:
- Set a Tag to that view
- Iterate on
UIWindow
subviews - Find the
UIView
with that tag - Remove it from superview
The problem is that UITapGestureRecognizer
does not have a way of identify it like tag.
Is there a solution to this problem with the conditions:
- Not having a strong pointer to
UITapGestureRecognizer
- Not adding an aux view on to
UIWindow
to add theUITapGestureRecognizer
to it and then remove this view.
Thank you.