Skip to content

Instantly share code, notes, and snippets.

@jen2
Created May 7, 2017 20:27
Show Gist options
  • Save jen2/0d0da21648d06285d5b9b98dccfeada6 to your computer and use it in GitHub Desktop.
Save jen2/0d0da21648d06285d5b9b98dccfeada6 to your computer and use it in GitHub Desktop.
Set up listener for NSNotification in Objective-C for "Broadcasting with NSNotification Center."
[[NSNotificationCenter defaultCenter] addObserverForName:@”SomeActionIsComplete” object:nil queue:nil usingBlock:^(NSNotification *note)
{
NSLog(@”The action I was waiting for is complete!!!”);
[self dismissViewControllerAnimated:YES completion:nil];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment