How to reload a ui view's content Swift
问题 I have a view controller which has scroll view in it, and the scroll view has a view. So, view has a lot of buttons and labels which are being showed depending on data which comes from api. And I have a button after pressing it, I want to reload a views (it's content). 回答1: one of the easy hack and NOT the recommended way is to do self.view.setNeedsLayout() also you can do self.viewDidLoad() OR self.viewWillAppear(true) well the different recommended approaches you can use are the following