Latest 0.0.8
Homepage https://github.com/andreybuksha/LMCSideMenu
License MIT
Platforms ios 10.0
Authors

Simple and lightweight side menu written in Swift

LMCSideMenu

Requirements

  • iOS 10 or higher version.
  • Xcode 10 or higher version.
  • Swift 4.2 or higher version.

Installation

Cocoapods

pod 'LMCSideMenu'

Usage

First, you need to comform your center view controller to protocol LMCSideMenuCenterControllerProtocol

class ViewController: UIViewController, LMCSideMenuCenterControllerProtocol {

    var interactor: MenuTransitionInteractor = MenuTransitionInteractor()

}

Next, setup menu with left and right menu view controllers

let storyboard = UIStoryboard(name: "Main", bundle: nil)

let leftMenuController = storyboard.instantiateViewController(withIdentifier: String(describing: LeftMenuController.self)) as! LeftMenuController
let rightMenuController = storyboard.instantiateViewController(withIdentifier: String(describing: RightMenuController.self)) as! RightMenuController

//Setup menu
setupMenu(leftMenu: leftMenuController, rightMenu: rightMenuController)

If you need to use screen edge gestures, you can enable them as following:

enableLeftMenuGesture()
enableRightMenuGesture()

If your app supports multiple orientations, add this code into your center view controller:

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
    super.viewWillTransition(to: size, with: coordinator)
    transitionMenu(to: size, coordinator: coordinator)
}

Customizing

If you need to customize the appearance properties of menu, such as menuWidth, gesture percent threshold or animationDuration, call these methods:

MenuHelper.set(menuWidth: newMenuWidth)
MenuHelper.set(percentThreshold: newPercentThreshold)
MenuHelper.set(animationDuration: newAnimationDuration)

Latest podspec

{
    "name": "LMCSideMenu",
    "version": "0.0.8",
    "summary": "Simple and lightweight side menu written in Swift",
    "description": "LMCSideMenu allows to create fully customizable side menu (left and right) with support of gestures",
    "homepage": "https://github.com/andreybuksha/LMCSideMenu",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Andrey": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.2",
    "source": {
        "git": "https://github.com/andreybuksha/LMCSideMenu.git",
        "tag": "0.0.8"
    },
    "source_files": [
        "LMCSideMenu",
        "LMCSideMenu/LMCSideMenu/**/*.{h,m,swift}"
    ],
    "module_name": "LMCSideMenu"
}

Pin It on Pinterest

Share This