I am struggling with passing data from my appDelegate to one of my view controllers. I have tried to use segues to do this, but this just doesn't work. So what I am wondering about is; is there any other way to present another view controller and pass data to it, other than using segues?
Thanks in advance.
You can't use segue to
ViewController
fromAppDelegate
, becauseAppDelegate
is not aViewController
. Segues are only work withViewControllers
.But you can initiate a storyboard identifier from your
AppDelegate
to yourViewController
so you can send data.There is a example for you;
You can set your
Storyboard ID
in yourMain.storyboard
. Just select yourViewController
and set storyboard ID section click the Use Storyboard ID checkmark like image.