Through this project, I have learnt how to programmatically build a navigation bar and its main components
https://www.youtube.com/watch?v=wcN3-E1_ZxU&t=2s
This NavigationBar was built and run on iOS 15.0
-
Go to info
- Select 'Main storyboard file base name'
- Delete it
-
Go to Application Scene Manifest
- Open it up until you get to 'Storyboard Name'
- Delete it
-
Go to Xcode sidebar
- Delete the main storyboard 'main'
-
Go to the 'SceneDelegate' file, inside the scene function, remove the existing and copy paste the following code;
guard let windowScene = (scene as? UIWindowScene) else {return} let window = UIWindow(windowScene: windowScene) let vc = ViewController() let nav = UINavigationController(rootViewController: vc) window.rootViewController = nav self.window = window self.window?.makeKeyAndVisible()