0

i have two view in my app there are one button in first view so when i click on this button then second view open

My problem is on second view when i horizontally swipe or scroll then why first view open without logout process or back button action perform?

please some one help me

arun
  • 57
  • 6
  • Are you pushing the second view onto a navigation stack? If so, there's a swipe gesture from left edge of screen by default. When it's used to pop the top controller, it doesn't trigger any event handlers. – Avi Jun 21 '16 at 06:42
  • 5
    Are you talking about a back swipe gesture using a UINavigationController? In that case have a look [here](http://stackoverflow.com/questions/17209468/how-to-disable-back-swipe-gesture-in-uinavigationcontroller-on-ios-7). Otherwise if you can be a bit more specific and show some code/diagrams that might help you get a better answer. – akiraspeirs Jun 21 '16 at 06:45

2 Answers2

0

This is default behavior when you push new view controller into navigation stack. You can disable this behavior by setting interactivePopGestureRecognizer.enabled to false

Thien Liu
  • 46
  • 3
0

You must have push to the second view , This is default behaviour of iOS after iOS 7.

You need to add this code for iOS 8

- (void)viewDidAppear:(BOOL)animated
{
 [super viewDidAppear:animated];

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
}

- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}

}

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
 return NO;
}

For more information , Please follow this link

Hope this helps!.

Community
  • 1
  • 1
saurabh goyal
  • 328
  • 4
  • 11