Skip to content

Instantly share code, notes, and snippets.

@jemmons
Created September 3, 2010 20:43
Show Gist options
  • Save jemmons/564531 to your computer and use it in GitHub Desktop.
Save jemmons/564531 to your computer and use it in GitHub Desktop.
-(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