Skip to content

Instantly share code, notes, and snippets.

@izackp
Created August 12, 2014 19:41
Show Gist options
  • Save izackp/eb469b185b2b85422a05 to your computer and use it in GitHub Desktop.
Save izackp/eb469b185b2b85422a05 to your computer and use it in GitHub Desktop.
Have a dispatch queue listen for the pause button in xcode
//Brandon Levasseur
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
source = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGSTOP, 0, queue);
if (source) {
dispatch_source_set_event_handler(source, ^{
NSLog(@"Hi, I am: %@", weakSelf);
});
dispatch_resume(source);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment