Created
August 12, 2014 19:41
-
-
Save izackp/eb469b185b2b85422a05 to your computer and use it in GitHub Desktop.
Have a dispatch queue listen for the pause button in xcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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