By tapping simple UIButton on main UIView, additional View (subview) appears in the center of screen (subview created programmatically). On that subview I have UIButton that lau
Are you adding a UITapGestureRecognizer
to infoView or any of it subviews?
If that is the case, your gesture recognizer is inhibiting the UIButton action. You could use the solution provided by Kevin Ballard or cdasher on this post
You just need to set the view that has the UITapGestureRecognizer
as the delegate of that Gesture Recognizer (UIGestureRecognizerDelegate
). Then you can add the following code:
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
return ! ([touch.view isKindOfClass:[UIControl class]]);
}
And your Tap Gesture Recognizer should look like this:
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureAction)];
tap.delegate = self;
[self.view addGestureRecognizer:tap];
Hope this helps!