0

I am developing an iOS application using swift, and I have used aUIContainerView. I have set a segue forUIViewController to be embedded in the UIContainerView.

Now, I need to change this UIViewController on aUIButton click. Is that possible? If so how it can be achieved?

Thank you in advance.

Ashok Londhe
  • 1,491
  • 11
  • 29
LIH
  • 933
  • 2
  • 10
  • 25
  • please share some code – iAnurag May 19 '15 at 07:20
  • possible duplicate http://stackoverflow.com/questions/9674685/creating-a-segue-programmatically – Vijay Masiwal May 19 '15 at 07:31
  • possible duplicate of [How do I create a segue that can be called from a button that is created programmatically?](http://stackoverflow.com/questions/26456989/how-do-i-create-a-segue-that-can-be-called-from-a-button-that-is-created-program) – Lefteris May 19 '15 at 07:40
  • This was done from storyboard. I need to do it programatically – LIH May 19 '15 at 07:50

1 Answers1

0

You can create a segue programmatically with the segueWithIdentifier:source:destination:performHandler: method. Your perform handler should do all of the work necessary to transition between the source and destination view controllers. Then you can initiate it programmatically using the performSegueWithIdentifier:sender: method of UIViewController

Vlad
  • 7,199
  • 2
  • 25
  • 32