Use protocol and set parent view controller as delegate for your UIView.
In your UIView subclass .h file:
@protocol YourClassProtocolName <NSObject>
@optional
- (void)methodThatNeedsToBeTriggered;
@end
@interface YourClass : UIView
...
@property(weak) id<YourClassProtocolName> delegate;
@end
In .m file:
@interface YourClass () <YourClassProtocolName>
@end
@implementation YourClass
...
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
CGPoint tap = [[touches anyObject] locationInView:self];
if(CGPathContainsPoint(region, NULL, tap, NO)){
if (_delegate && [_delegate respondsToSelector:@selector(methodThatNeedsToBeTriggered)]) {
[_delegate methodThatNeedsToBeTriggered];
}
}
}
@end
And now set needed UIViewController as delegate for this new protocol and implement methodThatNeedsToBeTriggered in it.