-(void)viewDidAppear:(BOOL)animated {
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationUserDidTakeScreenshotNotification object:nil queue:mainQueue usingBlock:^(NSNotification *note) {
NSLog(@"SShot");
}];
}
- (void)viewWillDisappear:(BOOL)animated{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil];
NSLog(@"VWD");
}
-(void)viewDidDisappear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil];
NSLog(@"VDD");
}
I am getting SShot
logged in console even after I have removed the observer.
Is there any other way to remove UIApplicationUserDidTakeScreenshotNotification
observer.