/thirdparty/SPMediaKeyTap/SPInvocationGrabbing/gistfile3.m
http://github.com/tomahawk-player/tomahawk · Objective C · 28 lines · 19 code · 4 blank · 5 comment · 0 complexity · 1794e4fc655ea831def78ad9b3b22f5d MD5 · raw file
- // A
- +(UIView*)flashAt:(CGRect)r in:(UIView*)parent color:(UIColor*)color;
- {
- float duration = 0.5;
- UIView *flash = [[[UIView alloc] initWithFrame:r] autorelease];
- flash.backgroundColor = color;
- [parent addSubview:flash];
- [[flash invokeAfter:duration+0.1] removeFromSuperview];
-
- [UIView beginAnimations:@"SPFlash" context:NULL];
- [UIView setAnimationDuration:duration];
- flash.alpha = 0.0;
- [UIView commitAnimations];
- return flash;
- }
- // B
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
-
- // Force the animation to happen by calling this method again after a small
- // delay - see http://blog.instapaper.com/post/53568356
- [[self nextRunloop] delayedTableViewDidSelectRowAtIndexPath: indexPath];
- }
- // C
- [[tableView invokeAfter:0.15] selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
- [[tableView invokeAfter:0.30] deselectRowAtIndexPath:indexPath animated:YES];
- [[tableView invokeAfter:0.45] selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];