Presents the specified view controller as the secondary view controller of the split view interface.
- iOS 8.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
The view controller to display in the secondary (or detail) location of the split view interface. If you specify
nilfor this parameter or if this view controller is the same as the one it would replace, this method does nothing.
The view or view controller that made the request.
Whenever possible, use this method (instead of modifying the contents of the
viewproperty directly) to replace the secondary view controller of your split view interface. This method displays the specified view controller in the best way possible given the current size class in effect. It also takes advantage of existing navigation controller behaviors whenever possible to minimize changes to the split view interface.
This method calls the delegate’s
split method to give the delegate an opportunity to show the view controller. If the delegate does not show the view controller, the split view controller forwards the message to the view controller being replaced to see if it wants to do anything. For example, a navigation controller responds by pushing
vc onto its navigation stack. If no other object wants to show the view controller, the split view controller shows it using the following heuristics:
In a horizontally regular environment, the split view controller installs
vcas the secondary view controller.
In a horizontally compact environment, the split view controller presents
All view controllers implement this method. If they do not show the view controller themselves, they forward the message to the parent split view controller (if any) and let it show the view controller. As a result, a child view controller can call this method on itself to achieve the same results as calling this method on the split view controller object.