вот моя проблема: в mainviewcontroller я добавил жест смахивания вниз, чтобы переключить другой вид, но внутри других представлений, добавленных к mainview, с помощью жеста смахивания открывается этот конкретный вид.Тем не менее, я не хочу, чтобы жест проводил вниз в других видах, а не в главном.
//---gesture recognizer
- (IBAction) handleSwipes:(UIGestureRecognizer *) sender {
UISwipeGestureRecognizerDirection direction = [(UISwipeGestureRecognizer *) sender direction];
if (direction == UISwipeGestureRecognizerDirectionDown) {
shakeController = [[ShakeViewController alloc]
initWithNibName:@"ShakeViewController" bundle:nil];
CATransition *transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromBottom;
transition.delegate = self;
// Next add it to the containerView's layer. This will perform the transition based on how we change its contents.
[self.view.layer addAnimation:transition forKey:nil];
[self.view addSubview:shakeController.view];
}
}
- (void)viewDidLoad {
[super viewDidLoad];
//gesture recognizer
UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc]
initWithTarget:self
action:@selector(handleSwipes:)];
swipeGesture.direction = UISwipeGestureRecognizerDirectionDown;
[self.view addGestureRecognizer:swipeGesture];
[swipeGesture release];
}
Спасибо