0

I have a view controller, that should be wrapped into navigation controller and presented in a popover, and also presented through a custom UIPresentationController.

The view controller has dynamic preferredContentSize and popover and custom presentation controller animate the changes in the size.

To workaround a known feature/bug of UINavigationController I'm using a custom subclass of UINavigationController that updates it's preferredContentSize.

Experimenting with UINavigationController, I've learned that regardless of the UINavigationBar.isTranslucent preferredContentSize should set to the size of the content, excluding the height of the navigation bar and top safe area.

Custom presentation controller presents view controller from the bottom, and presentation is affected by the bottom safe area.

What is the best way to design the contract between my custom presentation controller and presented view controllers regarding the preferredContentSize?

Example of the UINavigationController in a popover makes me think that preferredContentSize should not include safe area insets. What are the best practises here?

kjam
  • 721
  • 1
  • 6
  • 17

0 Answers0