0

I'm currently developing a framework in Swift that includes a storyboard that I designed myself. What I need to do is that the user that uses my framework can create a segue to my storyboard. Then I'd like to be able to recreate a segue to the user storyboard that that I "leave" my storyboard.

How could I do so ?

Thx !

jlejoux
  • 23
  • 1
  • 5

2 Answers2

0

Your question is vague and I am not entirely sure what you are asking. However, I can't comment yet so I will try to answer with what little I know. It seems like you are asking how to transition storyboards. The simplest way is using a UIButton in your storyboard. Open up storyboard and go to the navigation controller. Then, add a button to the Nav Controller. Right click (or control click, depending on your settings), and drag the line to the main storyboard. Lastly, click on the show option. When a user clicks on the button, it will immediately switch to the main view controller. Don't forget to add the button in the view controller. Hopefully, this is what you meant and helps. If you wish switch view controllers in code, this is a duplicate and you should go here: How to switch view controllers in swift?. If this doesn't answer your question, comment and I will try and help. For future reference, please provide more information: snippets of code, pictures, anything that better demonstrates your problem.

Community
  • 1
  • 1
jbcd13
  • 145
  • 8
  • First of all thank you ! Sorry if I did not give you enough details. I edited the post so that you can better understand my issue. The problem is that I need to do everything programmatically because I am working on a framework. i.e I don't have access to the storyboard. – jlejoux Dec 26 '15 at 12:50
  • Did you make the storyboard or the framework yourself? – jbcd13 Dec 26 '15 at 21:12
  • Yes it is a storyboard I made myself. – jlejoux Dec 27 '15 at 18:05
0

I fixed it by getting the instance of a new view controller added on the user storyboard with the view controller identifier like so :

        ProcessOut.backViewController = storyboard?.instantiateViewControllerWithIdentifier("back")

And then I present it like I would present a normal viewController from my storyboard.

jlejoux
  • 23
  • 1
  • 5