Asks the delegate to adjust the primary view controller and to incorporate the secondary view controller into the collapsed interface.
- iOS 8.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The split view controller whose interface is collapsing.
The secondary view controller of the split view interface.
The primary view controller of the split view interface. If you implement the
primarymethod in your delegate, this object is the one returned by that method.
View Controller For Collapsing Split View Controller:
NO to let the split view controller try and incorporate the secondary view controller’s content into the collapsed interface or
YES to indicate that you do not want the split view controller to do anything with the secondary view controller.
This method is your opportunity to perform any necessary tasks related to the transition to a collapsed interface. After this method returns, the split view controller removes the secondary view controller from its
view array, leaving the primary view controller as its only child. In your implementation of this method, you might prepare the primary view controller for display in a compact environment or you might attempt to incorporate the secondary view controller’s content into the newly collapsed interface.
NO tells the split view controller to use its default behavior to try and incorporate the secondary view controller into the collapsed interface. When you return
NO, the split view controller calls the
collapse method of the primary view controller, giving it a chance to do something with the secondary view controller’s content. Most view controllers do nothing by default but the
UINavigation class responds by pushing the secondary view controller onto its navigation stack.
YES from this method tells the split view controller not to apply any default behavior. You might return
YES in cases where you do not want the secondary view controller’s content incorporated into the resulting interface.