I have an app that I need to display a pin code screen every time the app is opened. I'm successfully displaying the modal view, but it doesn't cover the navigation bar at the top, and it doesn't cover the tab bar at the bottom. I believe it's because of how I'm presenting it, but I'm not seeing a way to change it.
This is how I'm presenting the controller
let newVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LoginView")
let view = window?.rootViewController as! UITabBarController
view.selectedViewController?.show(newVC, sender: nil)
The problem is your use of UIViewController's
api, show. The function is overridden by UINavigationController
in this case and push
will be used to present the view controller. If your plan is to modally present a view controller, rather use present
selectedViewController?.present(newVC, animated: true, completion: nil)