Perform Segue from App Delegate swift

前端 未结 7 1031
野的像风
野的像风 2020-12-06 00:53

I need to launch a view controller from the app delegate.

In the way you would perform a segue between view controllers.

I have an if statement that if true

7条回答
  •  攒了一身酷
    2020-12-06 01:24

    if you want to use segue identifier, you can use in Swift 2.2.

    self.window?.rootViewController!.performSegueWithIdentifier("YOUR SEGUE IDENTIFIER", sender: nil)
    

    and for Swift 3.1 :

    self.window?.rootViewController!.performSegue(withIdentifier: "YOUR SEGUE IDENTIFIER", sender: nil)
    

提交回复
热议问题