0

My app has an app delegate and I have put code in there that I need to be there under the following method in the delegate:

func application(_ application: UIApplication,
                          willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool{
    let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
    let initialFrontViewController: ViewController2 = storyboard.instantiateViewController(withIdentifier: "initialFrontRevealController") as! ViewController2
    let revealController: RevealViewController = storyboard.instantiateViewController(withIdentifier: "revealVC") as! RevealViewController
    revealController.setFront(initialFrontViewController, animated: true)

    print("seen command")

    return true
}

My problem is that my print statement doesn't print to the console and none of the tasks I have put in the method actually go in to effect when I build and run my app.

So far I have tried several content and settings resets but to no avail. Any help would be greatly appreciated.

needshelp
  • 595
  • 1
  • 6
  • 25
  • I think you are also having some errors **before** the print statement but you didn't say about. Otherwise it's impossible for the print statement to not print. Like you have had a crash because of the forced unwrapped you did using `as!` – mfaani Jan 14 '17 at 17:59

1 Answers1

2

Change the code "print("seen command")" to the first line in fund

application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool

Observe whether there is a print log, Out of the current methods can not run the code error.

Fruchtzwerg
  • 10,999
  • 12
  • 40
  • 49
Casanova.Z
  • 34
  • 1