In my app, i am using a UISplitViewController like this:
let splitViewController = UISplitViewController()
splitViewController.preferredDisplayMode = .oneBesideSecondary
splitViewController.viewControllers = [
UINavigationController(rootViewController: CalendarViewController()),
DetailViewController()
]
Result:
But when i set the style to doubleColumn like this:
let splitViewController = UISplitViewController(style: .doubleColumn)
The Result looks like this:
i don't understand why now CalendarViewController is wider than master view. I would like to use the sidebar so that the user can show and hide the Calendar.
How can I fix this display error so that CalendarViewController has the same width as master view?


It was a bug in the CalendarKit library and it has been fixed in the following commit: Fix Layout Issue when using UISplitViewController
The problem was in the layout code that didn't account for
safeAreaguides:After switching to AutoLayout, the issue has gone away: