Rorschach Rorschach - 3 months ago 15
Swift Question

How to reload a previous page when segue back

I use this line of code in my iOS app

self.navigationController?.popToRootViewControllerAnimated(false)


It takes the user back the login page, but it does not reload the login with all the most recent data.

It will not run this code again:

override func viewDidLoad() {
super.viewDidLoad()
...
}


How do I make the segue cause the viewDidLoad again?

Answer

Use viewWillAppear method for that.

Comments