Search code examples
iosswiftipaduisplitviewcontrolleruicontainerview

How to change width sizes of split view controller items (Master View Controller - Detail View Controller)?


I need to change width sizes of View Controllers in Split View Controller. I mean the default value of first view controller is 320. Second one is 703. I need to change them with 605 and 419. Btw project is iPad - Landscape project. So is there any way to do this ?


Solution

  • The class UISplitViewController exposes a property to change the width of the master view. This property is preferredPrimaryColumnWidthFraction with which you can specify the width of the master view as a percentage respect the total width of the split view.