You can't use segue to ViewController
from AppDelegate
, because AppDelegate
is not a ViewController
. Segues are only work with ViewControllers
.
But you can initiate a storyboard identifier from your AppDelegate
to your ViewController
so you can send data.
There is a example for you;
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let yourViewController = storyboard.instantiateViewController(withIdentifier: "yourViewControllerStoryboardIdentifier") as! YourViewControllerClassName
yourViewController.yourProperty = "yourValue"
self.window?.rootViewController = yourViewController
self.window?.makeKeyAndVisible()
return true
}
You can set your Storyboard ID
in your Main.storyboard
. Just select your ViewController
and set storyboard ID section click the Use Storyboard ID checkmark like image.
