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.
-
Creates a
ContainerController
with the modes[.library, .photo, .video]
and an initialMode of.photo
. For additional information seeinit(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 seeinit(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 seeinit(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.
-
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 }
-
Set this delegate in order to handle events that occur in this controller or any of its children controllers.
Default value:
nil
Declaration
Swift
public weak var delegate: ContainerControllerDelegate?
-
Whenever the
LibraryController
orCameraController
pushes a newEditController
onto the navigation stack it will always set its delegate to whatever the value of this variable is. You should set this so you can respond to user interaction in theEditController
.Default value:
nil
Declaration
Swift
public weak var editControllerDelegate: EditControllerDelegate?
-
The instance of the
CameraController
that will be displayed for either the .photo or .video modes.Declaration
Swift
public var cameraController: CameraController { get }
-
The instance of the
LibraryController
that will be displayed for the .library mode.Declaration
Swift
public var libraryController: LibraryController { get }