Instance Property

isCollapsed

A Boolean value indicating whether only one of the child view controllers is displayed.

Declaration

var isCollapsed: Bool { get }

Discussion

This property is set to true when the split view controller content is semantically collapsed into a single container. Collapsing happens when the split view controller transitions from a horizontally regular to a horizontally compact environment. After it has been collapsed, the split view controller reports having only one child view controller in its viewControllers property. The other view controller is collapsed into the other view controller’s content with the help of the delegate object or discarded temporarily. When collapsed, the displayMode property has no impact on the appearance of the split view controller interface.

The value of this property is false when the split view controller is capable of displaying both of its child view controllers at the same time, even if it is not showing them both at the moment. In this expanded mode, the split view controller’s configuration of its child view controllers is determined by the displayMode property. In addition, the viewControllers property contains both the primary and secondary view controllers.

During a transition from an expanded to collapsed interface, the value of this property is false until after the collapse transition finishes and all of the relevant delegate methods have been called. Similarly, when transitioning back to an expanded interface, the value is true until the transition finishes.

See Also

Getting the Split View Configuration

var preferredPrimaryColumnWidthFraction: CGFloat

The relative width of the primary view controller’s content.

var primaryColumnWidth: CGFloat

The width (in points) of the primary view controller’s content.

var minimumPrimaryColumnWidth: CGFloat

The minimum width (in points) required for the primary view controller’s content.

var maximumPrimaryColumnWidth: CGFloat

The maximum width (in points) allowed for the primary view controller’s content.