1

I saw the Facebook app update for iOS (6.1.1) and it has a rely nice slide back function. For now I have a UISlideGestureRecognizer that when is called a do a [self.navigationController popViewController:YES];. But how can I make it with a UIPanGestureRecognizer like in the Facebook app? Should I build my own UINavigationController?

I do not know more than this (yet):

backView1 = [[self.navCon.viewControllers objectAtIndex:self.navCon.viewControllers.count - 2] view];
backView2 = [[self.navCon.viewControllers objectAtIndex:self.navCon.viewControllers.count - 1] view];

Please help in advance!

UPDATE:

Screenshot: enter image description here

Gustaf Rosenblad
  • 1,902
  • 2
  • 25
  • 45

3 Answers3

3

I've created a subclass of UINavigationController to do that. Here you go: https://github.com/MarcoSero/MSSlideNavigationController

Marco Sero
  • 460
  • 6
  • 18
0

if you're talking about slide out menu you can partially 'swipe', see this for several examples.

SplitView like Facebook app on iPhone

Community
  • 1
  • 1
Augie
  • 1,341
  • 1
  • 11
  • 18
  • No, I'm more talking about: when you are in the newsfeed and then touch a story (The Facebook app shows that story with some code lik: [self, navigationController pushViewController:con];) then when you want to go back you can now slide your finger from left to right to go back to the news feed. Understand? – Gustaf Rosenblad May 16 '13 at 21:10
0

To add effect of Slide back in UINavigationController add the following code line and add gesture recognizer delegate

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

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


- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    return YES;
}
Subhash Khimani
  • 427
  • 7
  • 22