Search code examples
iosswiftuitabbarcontroller

How To Extending UITabBarController NavigationController Tabs to the top of screen?


I can't seem to figure out how to make my navigation controller tabs full screen for a UITabBarController programmatically. It works through the storyboard, but I have a need to create the tab bar programmatically and they pop out like the below image shows. I'd prefer the ones with the back arrows that aren't popped out.

Is there some sort of option to make them all full screen programmatically? I have searched around and not found anything for Swift.

Showing Tab Bar Nav Controller Unwanted Tab Popout


Solution

  • let myViewController = UIViewController()
    myViewController.modalPresentationStyle = .fullScreen // you can display in fullscreen