PageRenderTime 122ms CodeModel.GetById 40ms app.highlight 8ms RepoModel.GetById 73ms app.codeStats 0ms

/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
 1// A
 2+(UIView*)flashAt:(CGRect)r in:(UIView*)parent color:(UIColor*)color;
 3{
 4	float duration = 0.5;
 5	UIView *flash = [[[UIView alloc] initWithFrame:r] autorelease];
 6	flash.backgroundColor = color;
 7	[parent addSubview:flash];
 8	[[flash invokeAfter:duration+0.1] removeFromSuperview];
 9		
10	[UIView beginAnimations:@"SPFlash" context:NULL];
11	[UIView setAnimationDuration:duration];
12	flash.alpha = 0.0;
13	[UIView commitAnimations];
14	return flash;
15}
16
17// B
18- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
19	
20	// Force the animation to happen by calling this method again after a small
21	// delay - see http://blog.instapaper.com/post/53568356
22	[[self nextRunloop] delayedTableViewDidSelectRowAtIndexPath: indexPath];
23}
24
25// C
26[[tableView invokeAfter:0.15] selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
27[[tableView invokeAfter:0.30] deselectRowAtIndexPath:indexPath animated:YES];
28[[tableView invokeAfter:0.45] selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];