Skip to content

Instantly share code, notes, and snippets.

@davidcann
Created May 7, 2009 23:31
Show Gist options
  • Save davidcann/108476 to your computer and use it in GitHub Desktop.
Save davidcann/108476 to your computer and use it in GitHub Desktop.
// assumes sheet is an ivar
var mainWindow = [[[CPApplication sharedApplication] delegate] theWindow];
[[mainWindow contentView] addSubview:shadeView];
[[CPApplication sharedApplication] runModalForWindow:sheet];
[sheet setFrame:CGRectMake(
([mainWindow frame].size.width / 2) - ([sheet frame].size.width / 2),
-[sheet frame].size.height - 20,
[sheet frame].size.width,
[sheet frame].size.height)];
var anim = [[CPPropertyAnimation alloc] initWithView:sheet property:@"frame"];
[anim setStart:CGRectMakeCopy([sheet frame])];
[anim setEnd:CGRectMake([sheet frame].origin.x, -20, [sheet frame].size.width, [sheet frame].size.height)];
[anim setDuration:0.3];
[anim startAnimation];
[sheet becomeKeyWindow];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment