Skip to content

Instantly share code, notes, and snippets.

@pratikshabhisikar
Created August 10, 2011 06:26
Show Gist options
  • Save pratikshabhisikar/1136244 to your computer and use it in GitHub Desktop.
Save pratikshabhisikar/1136244 to your computer and use it in GitHub Desktop.
Dismissing UIView manually
- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
[self.view removeFromSuperview];
}
-(void) dismiss {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
CGRect rect = self.view.frame;
rect.origin.y =+ rect.size.height;
self.view.frame = rect;
[UIView commitAnimations];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment