Created
September 3, 2010 20:43
-
-
Save jemmons/564531 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
-(IBAction)show:(id)sender{ | |
CGRect frame = [aView frame]; | |
frame.origin.y = [[self view] bounds].size.height; | |
[aView setFrame:frame]; | |
[[self view] addSubview:aView]; | |
[UIView beginAnimations:@"slide up" context:NULL]; | |
frame.origin.y = [[self view] bounds].size.height - frame.size.height; | |
[aView setFrame:frame]; | |
[UIView commitAnimations]; | |
} | |
-(IBAction)dismiss:(id)sender{ | |
CGRect frame = [aView frame]; | |
frame.origin.y = [[self view] bounds].size.height; | |
[UIView beginAnimations:@"slide down" context:NULL]; | |
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)]; | |
[UIView setAnimationDelegate:self]; | |
[aView setFrame:frame]; | |
[UIView commitAnimations]; | |
} | |
-(void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context{ | |
[aView removeFromSuperview]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment