Search code examples
iosiphoneswiftuisplitviewcontroller

Can SplitViewControllers be used on an iPhone?


I am building an App for the iPhone in Swift.

I want a small slice of the top of my app to be a User Area, and the rest of the screen to be whatever view/page the user is currently viewing.

This leads me to think that I need to use a UISplitViewController, but everything I read about UISplitViewControllers tells me that they only work on iPads.

Is this correct?

If this is the case can someone tell me how to create the effect I am after on an iPhone (programmatically in Swift would be great). Sorry for asking (what seems to me) to be a basic question, after much searching online I couldn't find anything definitive on the subject.

Many thanks


Solution

  • The docs says:

    In iOS 8 and later, you can use the UISplitViewController class on all iOS devices; in previous versions of iOS, the class is available only on iPad.

    So you can use if its at least iOS8.