My root view controller is a navigation controller, which leads to all my other view controllers. However, when running, it just displays a black screen and I am unable to go further in the app to all the other view controllers. The only code I have to load it is in the AppDelegate.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UINavigationController?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
return true
}
}
Probably you have mistaken to declare 'var window: UIWindow?' in your AppDelegate class.
Probably you forget to check the box is initial view controller. Go to the navigation storyBoard and try to check it.
you did not have to change anything in Appdelegate.
just remove navigationController from storyboard and than select your firstViewController than do this from the option on top of the mac:=
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.