MenuViewController
open class MenuViewController : CollectionViewController
A subclass of CollectionViewController
that shows a list of menu items with a log out button.
-
The log out button.
Declaration
Swift
@IBOutlet public var logOutButton: UIButton!
-
The menu collection controller
This casts the
collectionController
property to aMenuCollectionController
and returns it.Declaration
Swift
open var menuCollectionController: MenuCollectionController? { get }
-
Determines whether the collection has a log out button enabled.
Declaration
Swift
open var logoutButtonEnabled: Bool { get set }
-
Declaration
Swift
public convenience init(collectionController: CollectionController?)
-
Returns a newly initialized menu collection view controller with the specified items, selection and log out actions.
Declaration
Swift
public convenience init(items: [MenuItemCellPresentable], selection: ((MenuViewController?, MenuItemCellPresentable) -> Void)?, logOut: ((MenuViewController?) -> Void)?)
Parameters
items
An array of objects conforming to
MenuItemCellPresentable
.selection
The closure to be executed when a menu item is selected.
logOut
Return Value
The initialized collection view controller.
-
Configures the log out button.
This method either hides or displays the button depending on the value of the
logoutButtonEnabled
property.Declaration
Swift
open func setupLogoutButton()