This might looks like another questions about passing data that have been already replied, but not (I have searched many times in stackoverflow)
I explain :
I use Firebase to authentificate users. In my problem, I use Google Sign In, and the func is located in Appdelegate
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
I have a navigation based on scrollView (https://github.com/jakespracher/Snapchat-Swipe-View) so the viewdidload/didappear is launched only once on my app (at the beginning, and not when I swipe to the UIController).
So my question:
I want to pass an image from my func sign (the Google Profile Image) from my Appdelegate, to a ProfileViewController. I want to do it from my func in my Appdelegate (the segue/present doesn't work. present because it's on appdelegate and segue because the viewdidload/did appear only launch once)
So how can I do ?
I tried this on my func sign on Appdelegate, but it goes nowhere with a nil on controller.profile.image :
let image: UIImage = UIImage(data: data)!
var storyboard = UIStoryboard(name: "Main", bundle: nil)
var controller = storyboard.instantiateViewControllerWithIdentifier("Profile") as! ProfileViewController
controller.profile.image = image
So please please please, I will be grateful if somebody helps me.
Thanks