MaterialSideMenu
If you found MaterialSideMenu helpful and you liked it, give it a ★ at the top right of this page.
Overview
MaterialSideMenu is a simple Google Material Design-style side menu for iOS
Preview
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
- Xcode 10.
- Swift 5.
- iOS 11 or higher.
Installation
CocoaPods
MaterialSideMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MaterialSideMenu'
After that, run the following command:
$ pod install
Manual
Copy MaterialSideMenuViewController.swift
into your project and build
Usage
From code
First:
import MaterialSideMenu
Declare the menu and initialize it with a home controller (the bottom view) and the controller to be used as a side menu:
let sideMenuViewController = MaterialSideMenuViewController(homeViewController: homeViewController, mainMenuViewController: mainMenuController)
The menu is a UIViewController
which can be added either as the rootViewController
or pushed. It has its own navigationController
on which it pushes the new controllers.
Push new view controllers on its stack:
sideMenuViewController.pushViewController(newController, animated: false)
This will dismiss all view controllers alread on the stack, except the homeViewController
and add the new controller on top.
Go home:
sideMenuViewController.goHome()
Dismisses all view controllers and leaves the home view controller on the stack.
Known Issues
None, yet. Please report the issues you find some
License
MaterialSideMenu is available under the MIT license. See the LICENSE file for more info.