I need to refresh a view controller when a certain button is tapped. Simply activating viewDidLoad() does not seem to be working for what I need to do. However, when I leave the view controller then come back to it, it seems to work perfectly?
view controller
viewDidLoad()
How can I refresh/reload a view controller as if I have left it then come back to it without ever actually leaving it?
Whatever code you are writing in viewDidLoad, Add that in viewWillappear(). This will solve your problem.
viewDidLoad
viewWillappear()
1.4m articles
1.4m replys
5 comments
57.0k users