ContainerController

@objcMembers
public class ContainerController : UIViewController

The ContainerController view consists of a tab bar at the bottom and a controller above it. Each tab is represented by a ContainerMode with an associated controller and title for the tab. The tab bar can be customized by initializing this controller with the modes of your choosing.

If you initialize a ContainerController with only one mode, the tab bar will be automatically hidden.

Creating a ContainerController

  • Creates a ContainerController with the modes [.library, .photo, .video] and an initialMode of .photo. For additional information see init(modes:initialMode:restoresPreviousMode:).

    Declaration

    Swift

    public convenience init()
  • Creates a ContainerController with the only one mode. When initialized with only one mode, the container will not display a tab bar for switching between modes. For additional information see init(modes:initialMode:restoresPreviousMode:).

    Declaration

    Swift

    public convenience init(mode: ContainerMode)

    Parameters

    mode

    The mode to initialize this container with.

  • Creates a ContainerController with multiple modes. The first mode will be the initialMode. For additional information see init(modes:initialMode:restoresPreviousMode:).

    Declaration

    Swift

    public convenience init(modes: [ContainerMode])

    Parameters

    modes

    The modes to initialize this container with. You must provide at least one mode.

  • Creates a ContainerController with multiple modes. The modes you provide here will be represented in the containers tab bar in their respective order. If you provide only one mode the container will not display a tab bar for switching between modes.

    Declaration

    Swift

    public init(modes: [ContainerMode], initialMode: ContainerMode, restoresPreviousMode: Bool = true)

    Parameters

    modes

    The modes to initialize this container with. You must provide at least one mode.

    initialMode

    The mode that will first be visible when the controller appears. This mode must also be included the modes array parameter. If restoresPreviousMode is true, the initialMode will only be honored the first time the controller opens.

    restoresPreviousMode

    When true, the container will set the initialMode to the mode the user last had open.

Properties

  • The modes that the ContainerController was initialized with.

    Declaration

    Swift

    public private(set) var modes: [ContainerMode] { get }
  • The mode that is currently visible.

    Declaration

    Swift

    public private(set) var currentMode: ContainerMode { get }

Handling Controller Events

Child Controllers