Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode: LaunchScreen.storyboard is not showing up

I'm trying to set up the launch screen and initial view of my app. However, I can't get either to show up.

I have this set up:

enter image description here

enter image description here

Am I missing a step? Shouldn't I be seeing a page with "blah" on it as the launch screen? Instead, when I run the simulator it's just black.

Also, I don't understand why my initial view isn't showing up either.

In my AppDelegate.swift file:

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(application: UIApplication,
      didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        self.window?.rootViewController = self.rootViewController()
    return true
  }

  private func rootViewController() -> UIViewController {
    return MapViewController.init()
  }

}

And my MapViewController.swift:

import UIKit

class MapViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        var label = UILabel(frame: CGRectMake(0, 0, 200, 21))
        label.center = CGPointMake(160, 284)
        label.textAlignment = NSTextAlignment.Center
        label.text = "I am a test label"
        self.view.addSubview(label)
        NSLog("heyyyy!!") // <----------------- doesn't get printed either, so I think I'm missing something again...
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}

Sorry for the noob questions.

== UPDATE ==

I do get these 2 warnings when I build it:

file:///Users/emai/Documents/ios/Sherpa/SherpaNewYork/LaunchScreen.storyboard: warning: Unsupported Configuration: Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:.

/Users/emai/Documents/ios/Sherpa/SherpaNewYork/LaunchScreen.storyboard:9: Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:.

like image 903
bigpotato Avatar asked Dec 02 '22 16:12

bigpotato


1 Answers

I also struggled with a launchscreen storyboard not showing up. I tried everything fix I could find to no avail. Then I cleared the cache on my Simulator and it worked! Turned out it was a simulator problem. I cleared the cache with this command in terminal: xcrun simctl erase all

like image 196
Nate Avatar answered Dec 07 '22 23:12

Nate