pub struct SplitViewController<Sidebar, Content, Details> {
    pub objc: ShareId<Object>,
    pub sidebar: SplitViewItem<Sidebar>,
    pub content: SplitViewItem<Content>,
    pub details: Option<SplitViewItem<Details>>,
}
Expand description

A SplitViewController manages two or more view controllers in a split-pane view.

You typically use this controller as a content view controller for a Window. With it, you can build interfaces like those found in Mail.app or Xcode. Dividers can be configured to save their positions so that users can adjust them as they please.

Note that the third pane is optional; you can opt to leave it None, in which case there’s no allocation there, or you can set a placeholder and use it as a details pane.

A note on property names: the Cocoa(Touch) controllers tend to view these as:

|sidebar|details|content|

This pattern fits things such as a the aforementioned apps (e.g, Mail). Cacao takes the position that most apps really end up doing the following, though:

|sidebar|content|details|

where details may or may not be visible (e.g, chat applications often work this way).

Fields

objc: ShareId<Object>

A reference to the underlying Objective-C split view controller.

sidebar: SplitViewItem<Sidebar>

A reference to the sidebar SplitViewItem.

content: SplitViewItem<Content>

A reference to the content SplitViewItem.

details: Option<SplitViewItem<Details>>

An optional reference to the details SplitViewItem, if set.

Implementations

Creates and returns a new SplitViewController.

Toggles the sidebar, if it exists, with an animation. If there’s no sidebar in this split view (which is highly unlikely, unless you went out of your way to duck this) then it will do nothing.

Sets the autosave name for the underlying SplitView.

Setting this name causes the system to persist separator locations to a defaults database, and the position(s) will be restored upon the user reopening the application.

Trait Implementations

Returns the underlying Objective-C object.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.