EasySideMenuController 0.1.1

EasySideMenuController 0.1.1

Maintained by fummicc1.



  • By
  • fummicc1

EasySideMenuController

Overview

This library can easily display a screen like a side menu.

Demo

Demo

Requirement

Swift 5.0

Usage

  1. The parent ViewController inherits from EasySideMenuController instead of UIViewController. At this time, please be sure to write import EasySideMenuController.
import UIKit
import EasySideMenuController

class ViewController: EasySideMenuController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }
}
  1. To display SideMenu from the parent ViewController, call the SideMenuManager.shared.showSideMenu method. The following is a description of the arguments.
argument description
direction You can choose from 4 options: .bottom, .top, .left, and .right.
presenting Specify the parent ViewController. Basically there is no problem with self.
presented Specify an instance of ViewController that you want to display.
sideMenuSize Specify the display area of ​​ViewController instance specified by the above presented parameter.
  1. Make sure it works and works. You can display SideMenu in the above two steps.

This is an example of showing sideMenu at the left side.

import UIKit
import EasySideMenuController

class ViewController: EasySideMenuController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func didTapLeftSideMenuButton() {
        let modalVC = UIStoryboard(name: "Left", bundle: nil).instantiateInitialViewController() as! LeftModalViewController
        SideMenuManager.shared.showSideMenu(
            direction: .left,
            presenting: self,
            presented: modalVC,
            sideMenuSize: CGSize(width: 250, height: UIScreen.main.bounds.height)
        )
    }
}

Install

This library is compatible with Cocoapods only. Add EasySideMenuController to Podfile as follows and execute pod install.

target 'TARGET_NAME_OF_YOUR_APP' do
  use_frameworks!
  pod 'EasySideMenuController'
end

Contribution

If you find problems, improvements, or features that you want to add, please create an issue or pull request! waiting!

Licence

MIT

Author

<<<<<<< HEAD fummicc1

Stashed changes ======= fummicc1 395f863be70b82824f50f16e2de8d7cbb321aee0