programatically create horizontal slide view controller transition in ios

677 Views Asked by At

I would like to use horizontal slide view controller transition without implementing navigation view controller. Under modalTransitionStyle property I only found the CoverVertical, CrossDisolve, ParticalCurl, FlipHorizontal and RawValue (which I don't know what is means) options. Is it possible to use horizontal slide without UINavigationViewController? If it is, how?

Current code:

  let mapViewController = story.instantiateViewControllerWithIdentifier("nearbyVC") as! MapViewController
  mapViewController.modalTransitionStyle = UIModalTransitionStyle.CoverVertical
  self.showViewController(mapViewController, sender: self)
2

There are 2 best solutions below

0
On

Ended up using navigation view controller and hiding navigation bar. It really isn't a problem implementing a navigation controller.

1
On

Try this

let mapViewController = self.storyboard!.instantiateViewControllerWithIdentifier("PLoginVC") as! PLoginVC mapViewController.modalTransitionStyle = UIModalTransitionStyle.CoverVertical self.presentViewController(mapViewController, animated: true, completion: { () -> Void in })