Latest 1.2.1
Homepage https://github.com/VladimirDinic/WDSideMenu
License MIT
Platforms ios 10.0
Authors

CocoaPods Compatible
License
Platform

Features:

  • 6 types of side menu:
    • Left menu sticked to main view
      GitHub Logo
    • Left menu above main view
      GitHub Logo
    • Left menu below main view
      GitHub Logo
    • Right menu sticked to main view
      GitHub Logo
    • Right menu above main view
      GitHub Logo
    • Right menu below main view
      GitHub Logo
  • You can set make your central (main) content resizable (you can define scale parameter)
    GitHub Logo
  • Two ways to show / hide side menu:
    • Pan gesture
    • Embedded method
  • Other customizable parameters:
    • In order to define main view or side view, you just have to create appropriate UIViewControllers, set up their layouts, and use them as parameters for setting up side menu.
    • Side menu width
    • Shadow on / off
  • Delegate methods which will be called when side menu did show or did hide

Installation:

Manual:

Download this project and add WDViewController.swift file to your project

CocoaPods:

target '<TargetName>' do
    use_frameworks!
    pod 'WDSideMenu', ' ~> 1.2.1'
end

Usage

  1. After including WDViewController.swift file in your project (via CocoaPods or manual), create a UIViewController which will subclass WDViewController, and this UIViewController will be holder for your main content and side menu.
  2. Define UIViewControllers which will be used as main content or side view.
  3. Implement WDSideMenuDelegate in your ViewControllers if you want to use sideViewDidShow() and sideViewDidHide() delegate methods
  4. Override setupParameters() method and define parameters if you don’t like default settings (side menu width, main content scale factor,…)

Example of usage

import UIKit

class MyHomeViewController: WDViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    override func setupParameters() {
        sideMenuType = .LeftMenuBelowMainView
        resizeMainContentView = true
        sizeMenuWidth = UIScreen.main.bounds.size.width * 0.7
        scaleFactor = 0.2
    }

    override func getMainViewController() -> UIViewController? {
        let navigation:MyNavigationController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "NavigationController") as! MyNavigationController
        self.mainContentDelegate = navigation
        return navigation
    }

    override func getSideMenuViewController() -> UIViewController? {
        let sideMenuViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SideViewController") as! SideViewController
        self.sideMenuDelegate = sideMenuViewController
        return sideMenuViewController
    }
}

Note:

Documentation is still in preparation and the code will be updated regularly

If you find any bug, please report it, and I will try to fix it ASAP.

Latest podspec

{
    "name": "WDSideMenu",
    "platforms": {
        "ios": "10.0"
    },
    "version": "1.2.1",
    "summary": "WDSideMenu is a simple, powerful, customizable side menu for iOS apps.",
    "description": "This fantastic library enables you to create powerful side menu for iOS apps with easy!",
    "homepage": "https://github.com/VladimirDinic/WDSideMenu",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Vladimir Dinic": "[email protected]"
    },
    "source": {
        "git": "https://github.com/VladimirDinic/WDSideMenu.git",
        "tag": "1.2.1"
    },
    "source_files": "WDSideMenu/WDSideMenu/WDViewController/*"
}

Pin It on Pinterest

Share This