let chatController = ChatLogController()
chatController.user = user
let nav: UINavigationController = UINavigationController(rootViewController: chatController)
self.presentViewController(nav, animated: true, completion: nil)
The code above works, I am trying to pass user, to the next view controller, before presenting However this doesn't work, it gives me nil for user, in the next viewcontroller:
let chatController = ChatLogController()
chatController.user = user
let nav: UINavigationController = UINavigationController(rootViewController: MessagesController())
// self.presentViewController(nav, animated: true, completion: nil)
nav.pushViewController(chatController, animated: true)
I really have no idea why, sorry for the dumb questions, I'm very new to this.