-2

I want open viewcontroller by clicking button on another view controller.all of my project is codebase and i didnt use storyboard.how can i do it?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
AnaHejazi
  • 49
  • 1
  • 9
  • Modal Presentation or Push to Navigation stack, depending on your approach. Do it in button's `IBAction` method – NSNoob Dec 31 '15 at 08:15
  • 2
    Possible duplicate of [Navigation Controller Push View Controller](http://stackoverflow.com/questions/20742745/navigation-controller-push-view-controller) – NSNoob Dec 31 '15 at 08:17

1 Answers1

1

You can do it like this

let vc = YourViewController()
self.navigationController!.pushViewController(vc, animated: true)
Rashwan L
  • 38,237
  • 7
  • 103
  • 107