Post

Replies

Boosts

Views

Activity

Reply to Triple-column split view controller in portrait mode
Sorry, I meant what is the recommended way to initially set these properties, as viewWillTransition(to size:, with coordinator:) only gets called when there is a size change, not initially? I'm thinking about setting them initially in viewDidLoad:, but does the size provided by viewWillTransition(to size:, with coordinator:) is always equals to view.bounds.size? Thanks.
Jun ’20
Reply to Triple-column split view controller in portrait mode
Thank you. I've added a function that takes the size as its input to update the split view controller properties, like this:     private func updatePreferredBehavior(for size: CGSize) {         if size.width >= 1194 {             preferredDisplayMode = .twoBesideSecondary             preferredSplitBehavior = .tile         }         else {             preferredDisplayMode = .automatic             preferredSplitBehavior = .automatic         }     } What is the recommended event to call such a method though? Should I call it in viewDidLoad: with the view.bounds.size or is there a better way? Thanks.
Jun ’20