简体   繁体   中英

Xcode Segue View Controller Right to left without UINavigation

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM