简体   繁体   中英

Custom UIViewController subclass only shows a black screen

I have created a subclass of UIViewController called LoginController. I have a LoginController.xib file that contains a view controller with a few elements in it. I have set the class of the view controller to LoginController and I have set my Main Interface to LoginController. Upon launching my app, I see my splash screen, followed by a pure black screen. My LoginController class just has the default code like so

class LoginController: UIViewController
{
    override func viewDidLoad()
    {
        super.viewDidLoad()

    }

    override func didReceiveMemoryWarning()
    {
        super.didReceiveMemoryWarning()
    }
}

I just created a new xcode project. My results are totally normal. So I guess it's because you are not setting the LoginController.xib as the initial xib to load?

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM