As for me I do not like to use NSNotificationCenter
because it is overloaded with a big amount of system and custom events.
If you add a lot of observers to NSNotificationCenter
, you should not forget to remove these observers, also sometimes it is difficult to know the sequence, in which observing methods will be called. Also NSNotificationCenter
doesn't check or manage adding the same observer more than one time(it sometimes becomes a real trouble, when you addObserver not in the correct place).
So: Why just not create some LoginManager
singleton which will contain all the needed data and manage all login behaviour? It will contain some data as : isAuthorithed
, etc.. And of course if you need to implement Observer
pattern, your singleton class can implement this in the same way as NSNotificationCenter