Observing a Notification

suggest change

Swift

func testNotification(notification: NSNotification) {
    let userInfo = notification.userInfo
    let myObject: MyObject = userInfo["someKey"]
}

Objective-C

- (void)testNotification:(NSNotification *)notification {
    NSDictionary *userInfo = notification.userInfo;
    MyObject *myObject = [userInfo objectForKey:@"someKey"];
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents