Harry Merzin Harry Merzin - 1 year ago 115
iOS Question

iOS app launches to black view

I have been trying to run my Xcode project on my iOS simulator an iPhone but I only get a black screen. I have tried multiple solutions but none seem to work.

I have tried:

  1. Setting main interface to "Main.storyboard"

  2. Installing all views i.e.: width: any, height: any

  3. Adding print statement to
    to state that the view did in fact load (didn't print that the view loaded)

  4. Resetting all content of the iOS simulator

  5. Running on my iPhone

  6. Setting initial view controller

None of these have solved my problem

Answer Source

Make sure in your AppDelegate that you are creating the variable window like so (right after the app delegate class declaration): var window: UIWindow?.

Without this line of code, your views just never launch.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download