AnswerBun.com

pushViewController & popViewController animation no longer functioning in iOS 14

Stack Overflow Asked by Catas on November 5, 2020

For some reason this code:

self.navigationController?.pushViewController(vc, animated: true)

Is behaving the exact same way as:

self.navigationController?.pushViewController(vc, animated: false)

The behavior is a non-animated push. I am not sure why the animation parameter is no longer functioning. It worked properly in iOS 13. Is this a bug?

Upon further research, I also noticed that in viewWillAppear, ViewWillDisappear, and ViewDidAppear that the animated property is false. Overriding the functions with:

super.viewWillAppear(true)

does not make any difference.

For further context, I am using a UIViewControllerRepresentable that displays a UITabBarController that contains a NavigationController inside of it. The view in the UINavigationController, and all of the pushed views, are where I am experiencing this issue.

One Answer

Fixed my problem!

Turns out that in my UITabBarController I had this line of code in my viewDidAppear function:

super.viewWillAppear(animated)

instead of viewDidAppear! As a result, the nested UINavigationController had animations off. Unsure why this worked in iOS 13, but it shouldn't have!

Key takeaway: remember to properly override your viewWillAppear and viewDidAppear functions!

Going to keep this in here in case someone else runs into this issue.

Correct answer by Catas on November 5, 2020

Add your own answers!

Related Questions

Infinite loop in Go

2  Asked on December 5, 2021 by uxtrejo

     

Why the buttons get disappeared when clicking them?

2  Asked on December 5, 2021 by kiyubi

     

image validation error : The profile picture must be an image

2  Asked on December 5, 2021 by akinori-kuwabara

         

How do you pass props through react router?

1  Asked on December 5, 2021 by aidan-paetsch

       

Refresh/Retrigger “Fetch” in a HTML/javascript

3  Asked on December 4, 2021 by sabrina-s

   

How to fix errors when doing a git commit?

1  Asked on December 4, 2021 by davidonstack

   

Get index of enum value typescript

2  Asked on December 4, 2021 by hlose-chauvel

   

create a new column to show the quintile in groupby

3  Asked on December 4, 2021 by warrior

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP