Skip to content

Instantly share code, notes, and snippets.

@uniring
Created June 6, 2013 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uniring/5720506 to your computer and use it in GitHub Desktop.
Save uniring/5720506 to your computer and use it in GitHub Desktop.
Cocoa (mac) animation with blocks
__block NSView *bView = self;
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
context.duration = 0.3;
context.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
[[bView animator] setAlphaValue:0];
} completionHandler:^{
[bView removeFromSuperview];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment