简体   繁体   中英

Can we use one project view controller class to another project in same workspace using swift3.0

I have created 3 different project and added in one workspace all three project has it own storyboard I have to use first project storyboard view controller in second project storyboard or vice versa. Is it possible?, How can I achieve this in swift 3.0?

Make global variables like so:

let firstStoryboard = UIStoryboard(name: "<First Storyboard name>", bundle: nil)
let secondStoryboard = UIStoryboard(name: "<Second Storyboard name>", bundle: nil)

in whichever file you need to access it.

This might work!

You cannot create project which depend on each other like

FrameworkA is linked with FrameworkB and FrameworkB is linked with FrameworkA . This setup create dependecy circle.

You can create two frameworks but only one of them can know about other:

FrameworkA is linked with FrameworkB but FrameworkB don't know any think about FrameworkA or vice versa.

If you have setup like:

- Application
| - FrameworkA
| - FrameworkB

you can use your ViewController in Application project and it is ok.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM