Posting a Notification with Data
suggest changeSwift
let userInfo: [String: AnyObject] = ["someKey": myObject]
NSNotificationCenter.defaultCenter().postNotificationName("TestNotification", object: self, userInfo: userInfo)
Objective-C
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:myObject forKey:@"someKey"];
[[NSNotificationCenter defaultCenter] postNotificationName: @"TestNotification" object:nil userInfo:userInfo];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents