I have this code:
UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(rightSwipeHandle:)];
[recognizer setNumberOfTouchesRequired:1];
[view1 addGestureRecognizer:recognizer];
[view2 addGestureRecognizer:recognizer];
[view3 addGestureRecognizer:recognizer];
[recognizer release];
- (void)rightSwipeHandle:(UISwipeGestureRecognizer*)gestureRecognizer{ //do something}
it recognizes swipe only in view3, why? and how can I solve this problem? Should I do a new swipegesture for every views? but I have 20 views.
If you have 20 views, they might be stored in an array or something? If yes, have you tried something like this?
With this you add a new recognizer to every view