Created
May 7, 2009 23:31
-
-
Save davidcann/108476 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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