Monday, October 14, 2019

New behaviour of navigation controllers in IOS 13

I resumed working on an app that had been resting for a few weeks (while I had updated to iOS 13) and thought, Whaaat?

Navigation controllers do not display in fullscreen anymore, but overlaid, somewhat similar to popover controllers. You can also pull the whole controller down to dismiss it.



Interestingly, Apple has introduced a new setting and changed the default behaviour.

If you want the old behaviour, you need to modify the code. The workaround is fairly simple:

        let viewController = ...
        let navController = UINavigationController(rootViewController: viewController)
        if #available(iOS 13.0, *) {
            navController.modalPresentationStyle = .fullScreen
        }
        self.present(navController, animated: true, completion: nil)

Still, backward compatibility, grumble, grumble...

No comments:

Post a Comment

New behaviour of navigation controllers in IOS 13

I resumed working on an app that had been resting for a few weeks (while I had updated to iOS 13) and thought, Whaaat? Navigation controll...