April 2015
Intermediate to advanced
556 pages
17h 47m
English
The NSNotificationCenter is the brains of the operation. It allows you to do three things: register observer objects, post notifications, and unregister observers.
Here are some commonly used methods implemented by NSNotificationCenter:
class func defaultCenter() -> NSNotificationCenter
Returns the notification center.
func addObserver(observer: AnyObject,
selector aSelector: Selector,
name aName: String?,
object anObject: AnyObject?)
Registers observer to receive notifications with the name aName and containing anObject (Figure 16.1).
If aName is nil,
the notification center sends the observer all notifications
with an object matching anObject.
If anObject is nil, the notification center ...