Skip to content
UITapOutsideGestureRecognizer is a subclass of UIGestureRecognizer that is executed with any tap OUTSIDE one view.
Objective-C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
AMPTouchOutside.xcodeproj
AMPTouchOutside
.gitignore
README.md

README.md

UITapOutsideGestureRecognizer

UITapOutsideGestureRecognizer is a subclass of UIGestureRecognizer that is executed with any tap OUTSIDE one view.

Use

The use of this UITapGestureRecognizer subclass differs a little from the rest. You create the UITapOutsideGestureRecognizer as always but using the method:

- (id)initWithTarget:(id)target action:(SEL)action view:(UIView *)view;

In the view parameter you pass the view in wich you want to apply the gesture recognizer.

The you need to add the gesture to the controller view.

Example

UITapOutsideGestureRecognizer *tap = [[UITapOutsideGestureRecognizer alloc] initWithTarget:self action:@selector(tapOutside:) view:self.importantView];
[self.view addGestureRecognizer:tap];
Something went wrong with that request. Please try again.