Skip to content

Instantly share code, notes, and snippets.

@muukii
Created February 10, 2014 13:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muukii/8915623 to your computer and use it in GitHub Desktop.
Save muukii/8915623 to your computer and use it in GitHub Desktop.
Drawrect Animation
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
[super setHighlighted:highlighted];
[self setNeedsDisplay];
if (animated) {
[UIView transitionWithView:self duration:0.1
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
[self.layer displayIfNeeded];
} completion:nil];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment