Perform Segue from App Delegate swift

前端 未结 7 1070
野的像风
野的像风 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:11

    if you want to perform segue from AppDelegate. Implement segue between ViewControllers in your storyboard. Give identifier to your segue.

    self.window?.rootViewController!.performSegue(withIdentifier: "your_identifier", sender: nil)
    

提交回复
热议问题