KASideMenu 1.1.1

KASideMenu 1.1.1

Maintained by ZhihuaZhang.



  • By
  • ZhihuaZhang

KASideMenu

CI Status Version License Platform

KASideMenu is a simple and easy to use side menu control written in Swift.
Check out the example project to see it in action!

Screenshot

Example

See the contained example to know how KASideMenu can easily be integrated in your project.

Build the example from the Example directory.

Requirements

  • XCode 10.
  • iOS 9.0+

Installation

KASideMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'KASideMenu'

Easy to use

Storyboards Example

  1. Create a subclass of KASideMenu. In this example we call it MySideMenu.
  2. In the Storyboard, add a UIViewController and set the root view's owner as MySideMenu.
  3. Add more view controllers to your Storyboard, and give them Storyboard ID with "LeftMenuViewController", "RightMenuViewController" and "CenterViewController".
  4. Add a method awakeFromNib to MySideMenu.swift with the following code:
    override func awakeFromNib() {
        leftMenuViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "LeftMenuViewController")
        rightMenuViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "RightMenuViewController")
        centerViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "CenterViewController")
        
        super.awakeFromNib()
    }

Present the menu view controller:

sideMenu?.showLeft()

or

sideMenu?.showRight()

Close the menu controller:

sideMenu?.closeMenu()

Author

ZhihuaZhang, [email protected]

License

KASideMenu is available under the MIT license. See the LICENSE file for more info.