Created
January 19, 2012 03:38
-
-
Save nurey/1637624 to your computer and use it in GitHub Desktop.
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
[successDialog hideAfterDelay:1.5f withCompletion: ^ | |
{ | |
[self doSomething]; | |
}]; | |
- (void)hideWithCompletion: (void (^)())completion | |
{ | |
if (self.visible == YES) | |
{ | |
[UIView animateWithDuration: 0.33f | |
delay: 0.0f | |
options: UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction | |
animations: ^ | |
{ | |
self.alpha = 0.0f; | |
} | |
completion: ^(BOOL finished) | |
{ | |
[self removeFromSuperview]; | |
completion(); | |
}]; | |
} | |
} | |
- (void)hideAfterDelay: (CGFloat)delay | |
withCompletion: (void (^)())completion | |
{ | |
[self performSelector: @selector(hideWithCompletion:) | |
withObject: completion | |
afterDelay: delay]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment