Skip to content

Instantly share code, notes, and snippets.

@sapzildj
Created June 24, 2012 20:01
Show Gist options
  • Select an option

  • Save sapzildj/2984690 to your computer and use it in GitHub Desktop.

Select an option

Save sapzildj/2984690 to your computer and use it in GitHub Desktop.
prevent ios5 crash becuase of multiful presentInModalViewController call
BOOL gIsTransitionAvailable = YES;
+ (void)presentInModalViewController:(UIViewController *)aViewController animated:(BOOL)aAnimated
{
if (bIOS5) // iOS5인 경우
{
if (gIsTransitionAvailable)
{
gIsTransitionAvailable = NO;
[[[selfclass] currentViewController] presentViewController:aViewController animated:aAnimated completion:^{
gIsTransitionAvailable = YES;
}];
}
}
else
{
[[[selfclass] currentViewController] presentModalViewController:aViewController animated:aAnimated];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment