cs193p – Lecture #13 Application Lifecycle and Core Motion

Please note, this blog entry is from a previous course. You might want to check out the current one.


Notifications provide a way to react to asynchronous events. e.g.:


func addObserverForName(String, // name of the "radio station"
    object: AnyObject?, // broadcaster (or nil for "anyone")
    queue: NSOperationQueue?) // queue to execute the closure on 
    { (notification: NSNotification) -> Void in
        let info: [NSObject:AnyObject]? = notification.userInfo // notification-specific information

Continue reading “cs193p – Lecture #13 Application Lifecycle and Core Motion”