How do I reload a UIView after viewDidLoad + viewWillAppear have already been called (and the view displayed)?
If it helps - I'm loading it from a xib/nib file, and expect that calling the method should only trigger viewWillAppear on the controller, not to reload the whole nib file.
In the ViewDidLoad include a loadData() function to prepare the data. This is executed in the initial run. When you want to reload, call loadData() again to get the data from model. In a tableView call reloadData() or in a regular view setNeedsDisplay().
Swift 5: You can access the presenting ViewController (presentingViewController) property and use it to reload the table view when the view will disappear. When you dismiss the SecondViewController, the tableview of the FirstViewController will reload. In my case, presentingViewController is SecondViewController.
How about [yourViewController.view setNeedsDisplay]
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With