Sharing scene between multiple storyboard files. iPhone vs iPad

独自空忆成欢 提交于 2019-12-22 07:50:09

问题


I'm working on a Universal app using storyboarding. I have 2 storyboard files. One for iPhone and one for iPad. I will have a handful of scenes that I would like to share between both and I want to use the storyboard editor to set them up. A common one is a UITableViewController and its prototype cells. I can make it in 1 of the storyboard files but how do I show it in both files without redoing its design?


回答1:


I don't think that's currently possible, though it would be cool. You could have a third storyboard that was for common views but segues to those views would have to be done programmatically.

Once you create an instance of that third storyboard, you can do [storyboard instantiateViewControllerWithIdentifier:STRING_ID] to get an instance of it.

This is what I did in one of my apps where I had some common tools that were shared.



来源:https://stackoverflow.com/questions/8705160/sharing-scene-between-multiple-storyboard-files-iphone-vs-ipad

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!