3

In my app I am partially swiping my ViewController and swiping back to the same view. While doing this viewDidLoad is not getting called. But if I swipe fully and come back to the view again, viewDidLoad gets called. It is creating some issue.

So even if I swipe partially and stay in the same view viewDidLoad needs to be called (currently only viewWillAppear is getting called). How to do this?

aksh1t
  • 5,410
  • 1
  • 37
  • 55
  • Why would you want to call the `viewDidLoad` method of the second view if it is swiped halfway and returned back? – aksh1t Apr 16 '15 at 05:51
  • The problem I am facing is, once I half swipe and land on the same view the back button (in navigation bar) stops working but if I go back fully and come again back action works fine. The only difference I am seeing between these two scenario is didload call... So I want it to be called in half swipe also – Rajkumar Gurunathan Apr 16 '15 at 07:14
  • I had a similar problem to yours, check it out: http://stackoverflow.com/questions/23261304/navigation-bar-title-bug-with-interactivepopgesturerecognizer – aksh1t Apr 16 '15 at 07:16
  • It makes sense ... Thank you very much.. Will try the steps.. – Rajkumar Gurunathan Apr 16 '15 at 07:28

1 Answers1

0

Half swipe of the back button is just like a back to the previous viewcontroller. When you half swipe the viewcontroller and again come to that viewcontroller viewdidload will never be called. Its better you put the swipegesture disable.

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
Gaurav Gilani
  • 1,584
  • 14
  • 18