问题描述:

This question already has an answer here:

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

    1 answer

网友答案:

A segue instantiates a specific class. If you want multiple subclasses of SomeDetailViewController then you will need to layout multiple viewControllers in your Storyboard and create multiple segues.

You can do this by control-dragging from the viewController icon at the top of your viewController to each viewController that is a subclass of SomeDetailViewController. Then add identifiers to the segues and call them with performSegueWithIdentifier in didSelectRowAtIndexPath.

Another way to do this would be to create multiple prototype cells for your tableView, with each one wired to the specific viewController it is segueing to.

相关阅读:
Top