0

I am trying to learn swift.

I have created two view controllers and can navigate between them based on a button click.

let welcomeScreen = storyBoard.instantiateViewControllerWithIdentifier("view2") as! ViewController2
self.presentViewController(welcomeScreen, animated:true, completion:nil)

This works, but when it transitions, it transitions from the bottom, so the new controller slides up from the bottom .

What I was hoping for was to slide it from the right-left rather than bottom - top.

Is there a way to do this?

Lawrence Cooke
  • 1,567
  • 3
  • 26
  • 52
  • In iOS there are basically two presentation styles: modal (bottom-up) and push (right-left). For push style your view controller has to be embedded in a UINavigationController. So search for tutorials for UINavigationController. – Darko Aug 15 '15 at 08:49

2 Answers2

1

You have to set the animation on "presentViewController" or use custom segue for your requirement. You can also add navigation controller to this view controller and try "pushViewController". Please check the below link for some examples

Link 1 Link 2 Link 3

Karlos
  • 1,653
  • 18
  • 36
0

I don't think there's any right to left transition available in iOS by default. Read this post for more info on left to right transitions.

Community
  • 1
  • 1
Kyle Emmanuel
  • 2,193
  • 1
  • 15
  • 22