Skip to content

Instantly share code, notes, and snippets.

View langleyd's full-sized avatar

David Langley langleyd

  • Element
  • Dublin, Ireland
  • 05:34 (UTC +01:00)
View GitHub Profile
@kommen
kommen / gist:5743831
Created June 9, 2013 14:56
Queue presentViewController and dismissViewControllerAnimated with dispatch semaphores.
- (void) queueViewControllerTransition:(BOOL)show {
static dispatch_queue_t presentAndDismissViewControllerQueue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
presentAndDismissViewControllerQueue = dispatch_queue_create("presentAndDismissViewControllerQueue", DISPATCH_QUEUE_SERIAL);
});
dispatch_async(presentAndDismissViewControllerQueue, ^{
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
dispatch_async(dispatch_get_main_queue(), ^{