this is my first question, but i use this site a lot this last months (thanks for all).
My problem: i have a split-view project for i-Pad. In the DetailViewController I use a UIButton. Here's some code from DetailViewController.h:
@property (strong, nonatomic) IBOutlet UIButton *button;
- (void)swipeRightDetected:(UISwipeGestureRecognizer *)recognizer;
In DetailViewController.m I just do this:
- (void)viewDidLoad
{
[super viewDidLoad];
[self configureView];
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeRightDetected:)];
swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
[self.button addGestureRecognizer:swipeRight];
}
- (void)swipeRightDetected:(UISwipeGestureRecognizer *)recognizer
{
if (recognizer.view == self.button) {
NSLog(@"YEAH");
}
}
Now the problem is: it was working perfectly with iOS 5.0.1 and previous. Now it doesn't work any longer. IT WORKS FOR ANY OTHER DIRECTION but NOT for RIGHT direction and only in a DetailViewController!! It only works if you hit the iPad with strength and speed (like a slap!), and same thing for the simulator.. it only works if you do the swipe very very very fast!
I think it's a bug.. what should i do? Maybe post the same question on apple forum? Thank you all, you're all great!! Marco
I would guess that this has to do with the new "sliding presentation style" of the split view controller in iOS 5.1. The release notes say that you can disable this behavior by setting presentsWithGesture
to NO
.
Another option might be to implement gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
in your gesture recognizer's delegate.