NSNotifications – Swift
in VC1, ViewDidLoad
NSNotificationCenter.defaultCenter().addObserver(self, selector: “myFunc:”, name:”notificationName”, object: nil)
in VC1, create this function
func myFunc(notification: NSNotification){
//Do whatever
}
in VC2,
NSNotificationCenter.defaultCenter().postNotificationName(“notificationName”, object: nil)
Reply