观察通知的简单安全方法
self.notificationController = [FTGNotificationController controllerWithObserver:self];
[self.notificationController observeNotificationName:UIApplicationDidReceiveMemoryWarningNotification
object:nil
queue:[NSOperationQueue mainQueue]
block:^(NSNotification *note, id observer)
{
NSLog(@"observer %@ notification payload %@", observer, note);
}];
有两种方法
pod 'FTGNotificationController'
或
pod 'FTGNotificationController', :git => 'https://github.com/onmyway133/FTGNotificationController.git'