Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-initialiaze tabs in tabbar

I've got a tab bar set up in a storyboard with 4 tabs. The app has a login system, and when I log out I want to zero-out the second and third tabs. The second and third tabs content depends upon which user is logged in, so I don't want the old info appearing there.

How would I re-initialise them?

like image 796
cannyboy Avatar asked Dec 02 '13 13:12

cannyboy


1 Answers

This is a situation suitable for NSNotification usage. When the 'logged-in' status changes, post a notification. Observe this notification in the appropriate view controllers and have then react by enabling / disabling / showing / clearing UI elements in their view.

like image 196
Wain Avatar answered Sep 28 '22 05:09

Wain