Reputation: 4936
I was wondering if there is a way to reload a view controller inside one tab from another tab. This is my scenario
IS there something like tab bar -> tab -> view controller -> reload viewDidLoad?
Thanks
Upvotes: 0
Views: 313
Reputation: 27601
The general way I solve this problem is by having a "Settings"-type object (Model) that is observed by my view controllers. In your case, you'd initialize it in your app delegate, pass it along to the view controllers for Tab 1 and Tab 2, which would then use KVO to observe it. You'd also directly modify it in Tab 2's view controller.
You could also use a NSNotifcation
to signal a change in the settings to any view controller that wants to observe it.
Upvotes: 1