Share the same UI for two subclasses in Obj-C/Storyboard

末鹿安然 提交于 2019-11-28 11:07:48

问题


I have a ViewControllerA, and its UI layout is designed in the Interface Builder (storyboard).

ViewControllerA has two concrete subclasses, ViewControllerB1 and ViewControllerB2; they have the same UI with its superclass ViewControllerA, but run with different logic.

How can I create two different concrete classes but they share the same UI with storyboard in which you must indicate the view controller's class?


回答1:


Unfortunately storyboard doesn't support subclassing. You should create delegate in ViewControllerA for different logic.



来源:https://stackoverflow.com/questions/30251707/share-the-same-ui-for-two-subclasses-in-obj-c-storyboard

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