Xcode Segue View Controller Right to left without UINavigation - ios

I want to transition my View Controller Right to Left (just like a Navigation Controller does IT) BUT without a UINavigationController embedded. I'm using Xcode 7 and the standard Segue seems to not have this option. Any guidance is VERY much welcome!!!

If you want to be a hack, you can do this:
CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.view.window.layer addAnimation:transition forKey:nil];
[self presentModalViewController:viewCtrl animated:NO];
You should really just use a navigation controller or write a custom transition animation see here for a project that does the animation you want.
let transition = CATransition()
transition.duration = 0.3
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
self.view.window?.layer.addAnimation(transition,forKey:nil)
self.presentViewController(viewCtrl, animated: false, completion: nil)
if you need it in Swift.

Related

How to do presentViewController transition from Right to left and dissmissViewController for it reverse?

for transition from one viewController to another view i wrote code below like this
if (UIInterfaceOrientationIsLandscape(STATUSBAR_ORIENTATION)) {
transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromBottom;
[self.view.window.layer addAnimation:transition forKey:nil];
}
else
{
transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[self.view.window.layer addAnimation:transition forKey:nil];
}
[self presentViewController:webView animated:NO completion:nil];
It is working fine but when i am rotate in landscape to portrait at the time onwards the view transition from right to left coming how to resolve this...please help me

View image in fullscreen transition same as Facebook app in IOS

I want to make the transition when touch on image to open the fullscreen same as Facebook app. When user touch on image, the transition is push down image to center, user touch on image again, it will back to previous page. How can i do that? For now, I have 1 viewcontroller contains the imageview in center. I used the code below to make animation when push viewcontroller but it seems not correct.
This is my code :
CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFromTop; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade
//transition.subtype = kCATransitionFromTop; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:imageView animated:NO];
Please give me some advices. Thanks.

UINavigationBar fades when pushing/popping

I am using the old (pre-iOS7) push/pop animation by using the method described here:
#implementation UINavigationController (Retro)
- (void)pushViewControllerRetro:(UIViewController *)viewController {
CATransition *transition = [CATransition animation];
transition.duration = 0.25;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.view.layer addAnimation:transition forKey:nil];
[self pushViewController:viewController animated:NO];
}
- (void)popViewControllerRetro {
CATransition *transition = [CATransition animation];
transition.duration = 0.25;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[self.view.layer addAnimation:transition forKey:nil];
[self popViewControllerAnimated:NO];
}
#end
My problem is that iOS7 seems to fade the UINavigationBar of the previous view controller when pushing a new view controller. Normally this looks fine because iOS 7 is dragging the views on top of each other. But when I am using the pre-iOS7 animation it gives me a short flash, because the navigation bar fades while the new view it getting pushed in from the right side.
Is there a way to disable the fade animation on the navigation bar?

Unable to change the popviewcontrolleranimation

I am trying to change the navigationController push and pop animation like presentModalView and dismissModalView animation.
I am successfully change the push view animation by using the below code. For changing push animation is working fine. This code is shows the view from bottom to top animation(for push view).
CATransition *transition = [CATransition animation];
transition.duration = 0.4f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:locationObj animated:NO];
But When I am trying to change the pop view animation by using the below code. I am unable to get the top to bottom animation(for pop view).
CATransition *transition = [CATransition animation];
transition.duration = 0.4f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController popViewControllerAnimated:NO];
Please can some one help me.
Tested Code:
CATransition *transition = [CATransition animation];
transition.duration = 0.4f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
//Pop Animation
transition.type = kCATransitionReveal;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController popViewControllerAnimated:NO];
//Push Animation
//transition.type = kCATransitionMoveIn;
//transition.subtype = kCATransitionFromTop;
//[self.navigationController.view.layer addAnimation:transition forKey:nil];
//[self.navigationController pushViewController:viewControllerToBePushed animated:NO];

Navigation Controller Custom Direction Not Changing

I am trying to get the navigation controller direction to be kCATransitionFromTop with the CATransition and it is set up to do that however for some reason it is still going from right to left. The fade portion works perfectly. Is there anything that I am doing wrong to have this not work? Do I need to add code in the other view controller? Thanks
- (void)bottomButtonScreen4:(UIGestureRecognizer *)gestureRecognizer {
settingsViewController = [[SettingsViewController alloc] init];
CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:settingsViewController animated:YES];
}
The type should be push, and the subtype kCATransitionFromBottom (which actually makes it come in from the top):
CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:settingsViewController animated:NO];

Resources