Search code examples
iosobjective-cuikitinterface-builderuistoryboardsegue

How to change kind of UIStoryboardSegue based on traits


Depending on the device type, I would like to either push a view controller onto a navigation controller stack, or present it as a popover.

Is it possible to add a customization to the kind property of UIStoryboardSegue in a storyboard based on traits?

I would like to use a segue for this rather than programatically presenting the view controllers. But I'm unable to figure out if that is possible. I tried subclassing UIStoryboardSegue, but I don't know how to programatically change the kind property.


Solution

  • @Paulw11's answer works: Use two manual segues. Then programatically call them when a button gets pressed.

    It still seems odd that there is no way to do this in interface builder itself.