Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I load a view from left side?

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

This function load a view from right side. How can I Load a view from left side?

like image 413
Harikrishnan Avatar asked Dec 06 '12 06:12

Harikrishnan


People also ask

How do I present a ViewController from the left in Swift?

Simply use popToViewController method. You can look for the viewController you need by searching for it's restorationIdentifier.

How do I move the view controller?

in interface builder control click on your button and drag the blue line that appears to the second view controller. The second view controller will highlight blue. You can release and the button is connected.

How do you present a modal view controller programmatically?

Use presentViewController:animated:completion: instead.) The default modal presentation style is a card. This shows the previous view controller at the top and allows the user to swipe away the presented view controller. This is the same for both programmatically created and storyboard created controllers.


1 Answers

Here it is

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 have to #import <QuartzCore/QuartzCore.h>

like image 105
Inder Kumar Rathore Avatar answered Sep 19 '22 10:09

Inder Kumar Rathore