Swift: Reload a View Controller
问题 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? How can I refresh/reload a view controller as if I have left it then come back to it without ever actually leaving it? 回答1: Whatever code you are writing in viewDidLoad , Add that in viewWillappear() . This will solve your problem. 回答2: You shouldn't