MenuViewController
@available(iOS 9.0, *)
open class MenuViewController<MenuDataSource, CellConfigurator> : ViewController, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, TransitionProviding where MenuDataSource : MenuDataSourceProtocol, CellConfigurator : CellConfiguratorProtocol, MenuDataSource.Item == CellConfigurator.Item
A MenuViewController
displays a menu at the bottom of its view and the view of an arbitrary
contained UIViewController
above that menu.
-
The view controller whose view should be displayed above the menu.
Declaration
Swift
public let contentViewController: UIViewController
-
The
MenuDataSourceProvider
that provides the data source for the menu (an instance ofUICollectionView
).Declaration
Swift
public let menuDataSourceProvider: MenuDataSourceProvider<MenuDataSource, CellConfigurator>
-
When selecting an item in the menu, the item can either remain selected until manually deselected (
true
) or be immediately deselected automatically (false
). The default isfalse
.Declaration
Swift
open var keepsSelection: Bool
-
An object that acts as the delegate.
Declaration
Swift
open weak var delegate: MenuViewControllerDelegate?
-
The collection view which displays the menu.
Declaration
Swift
open private(set) lazy var collectionView: MenuCollectionView { get set }
-
The view above the menu, where the
contentViewController
‘s view is added to.Declaration
Swift
open private(set) lazy var workspaceView: UIView { get set }
-
The view that hosts the
collectionView
. It extends below the bottomsafeAreaLayoutGuide
if needed.Declaration
Swift
open private(set) lazy var accessoryView: UIView { get set }
-
The height of the menu. Default is
88
.Declaration
Swift
open var menuHeight: CGFloat { get set }
-
Whether the menu is currently hidden or not.
Declaration
Swift
open private(set) var isMenuHidden: Bool
-
Creates a new
MenuViewController
with the given content view controller and menu data source.Declaration
Swift
public required init( contentViewController: UIViewController, menuDataSourceProvider: MenuDataSourceProvider<MenuDataSource, CellConfigurator> )
Parameters
contentViewController
The content view controller to show above the menu.
menuDataSourceProvider
The menu data source for the collection view.
-
Shows the menu.
Declaration
Swift
open func showMenu(animated: Bool)
Parameters
animated
Whether this change should be animated or not.
-
Hides the menu.
Declaration
Swift
open func hideMenu(animated: Bool)
Parameters
animated
Whether this change should be animated or not.