Skip to content

Instantly share code, notes, and snippets.

@Alos
Created July 24, 2011 18:55
Show Gist options
  • Save Alos/1102940 to your computer and use it in GitHub Desktop.
Save Alos/1102940 to your computer and use it in GitHub Desktop.
-(void) slideView:(UIView *)uiv_slide toReveal:(UIView *)uiv_reveal withDuration:(double)d_duration {
//Bring the view to slide to the front
[self.view bringSubviewToFront:uiv_slide];
//Add the subview to the ViewController's view
[self.view addSubview:uiv_reveal];
//Make an animation to slide the view off the screen
[UIView animateWithDuration:d_duration
animations:^ {
uiv_slide.center = CGPointMake(-1*(uiv_slide.frame.size.width/2), uiv_slide.frame.size.height/2);
}completion:^(BOOL finished) {
NSLog(@"Finished the animation");
}
];
}
@Alos
Copy link
Author

Alos commented Jul 24, 2011

-(void) slideView:(UIView *)uiv_slide toReveal:(UIView *)uiv_reveal withDuration:(double)d_duration {

//Add the subview to the ViewController's view
[self.view addSubview:uiv_reveal];

//Bring the view to slide to the front
[self.view bringSubviewToFront:uiv_slide];

//Make an animation to slide the view off the screen
[UIView animateWithDuration:d_duration
                 animations:^ {
                     uiv_slide.center = CGPointMake(-1*(uiv_slide.frame.size.width/2), uiv_slide.frame.size.height/2);  
                 }completion:^(BOOL finished) {
                     NSLog(@"Terminé la animacion");
                 }  
 ];

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment