UINavigationController back button not animating

2019-02-22 03:39发布

I'm having a weird issue with a navigation controller's back button animation:

my app has a tab bar control with 3 tabs, one of them has a navigation controller with two subsequent view controllers, the first one just show a master table and the second one details, the problem comes when I tap the back button from the detail view controller, instead of slide back to the master view controller it just pops the view without animation.

I've noticed that if I first go to another tab, and then return again to this one, the animation will trigger normally.

I've rebuilt the whole app navigation from scratch but the problem still persist, any help is appreciated.

Thanks in advance!.

Edit: More info added

This is how my storyboard looks like in that particular branch: enter image description here

Here's the prepareForSegue from "Partidos Activos" view controller:

#pragma mark - Segues

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    if ([segue.identifier isEqualToString:@"PartidosEnDia"]) {
        PartidosActivosEnFecha *paf = segue.destinationViewController;
        CalendarCell *senderCell = (CalendarCell *)sender;
        paf.datos = senderCell.dataDic;
    }
}

Both viewController viewDidLoad methods are calling super at the start of the method.

As I told before, if I just tap on other tab and then come back to this one, the slide back animation from "Partidos Activos En Fecha" viewController works as expected, it's only when I start the application and go directly to this viewController when the slide back animation doesn't work, and it just gets to the caller viewController without animation.

Hope I added enough info, if not just tell me and I will add it again.

3条回答
萌系小妹纸
2楼-- · 2019-02-22 04:12

I think this it's what you want. If I understand, your problem is handle the stack of the navigation controller right? So, check that link.

查看更多
Lonely孤独者°
3楼-- · 2019-02-22 04:14

I finally found where the problem was, I was missing a call to super in the viewDidAppear method but in UITabBarController!, I was checking only viewControllers for the tabs but not the tabbarviewcontroller. @rdelmar was right.

查看更多
爷、活的狠高调
4楼-- · 2019-02-22 04:23

I had the exact same problem. The cause for me was an empty viewDidAppear:animated method in my UITabBarController. Once I deleted that method, the animation worked normally again.

查看更多
登录 后发表回答