How to upload an image on the left side?

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated 

This function loads the view on the right side. How can I load the view on the left side?

+6
source share
3 answers

Here

 CATransition *animation = [CATransition animation]; [[self navigationController] pushViewController:elementController animated:NO]; [animation setDuration:0.45]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromLeft]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]]; [[elementController.view layer] addAnimation:animation forKey:@"SwitchToView1"]; 

For this you need #import <QuartzCore/QuartzCore.h>

+7
source

Do not think that there is a ready-made way to do this. You will need to animate the presentation yourself using animateWithDuration:delay:options:animations:completion: or animateWithDuration:animations:completion: (or any other animation methods) and change the frames of your view accordingly to animate them on the right side. Hope this helps :)

+3
source

if you have already been clicked on viewController, you can use this:

 [self.navigationController popViewControllerAnimated:YES] 
+1
source

All Articles