问题
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