Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reload a UIView?

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.

like image 509
smtlaissezfaire Avatar asked Feb 15 '11 20:02

smtlaissezfaire


People also ask

How do I reload a full view in Swift?

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().

How can you reload a ViewController after dismissing a modally presented view controller in Swift?

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.


1 Answers

How about [yourViewController.view setNeedsDisplay]?

like image 199
Nava Carmon Avatar answered Sep 19 '22 14:09

Nava Carmon