Latest 0.0.8
Homepage https://github.com/cozzin/SHSideMenu
License MIT
Platforms ios 10.0
Dependencies SnapKit, RxSwift
Frameworks UIKit
Authors

Simple side menu view controller 🍔

At a Glance

import SHSideMenu

let sideMenuViewController = SideMenuViewController(left: ExampleMenuViewController())

class ExampleMenuViewController: UIViewController, ContentViewChangable {
    viewTransition.onNext(UIViewController())
}

class ExampleContentViewController: UIViewController, SideMenuUsable {
    sideMenuAction.onNext(.open)
}

Installation

pod 'SHSideMenu', '~> 0.0.7'

Getting Started

// 1. Create SideMenuViewController
let sideMenuViewController = SideMenuViewController(left: ExampleMenuViewController())

// 2. ContentViewChangable
class ExampleMenuViewController: UIViewController, ContentViewChangable {

   var viewTransition: BehaviorSubject<UIViewController> = BehaviorSubject<UIViewController>(value: UINavigationController(rootViewController: ExampleContentViewController(backgroundColor: .blue))) // set first view controller

   func change(row: Int) {
        switch row {
        case 0:
            viewTransition.onNext(UINavigationController(rootViewController: ExampleContentViewController(backgroundColor: .blue)))
        case 1:
            viewTransition.onNext(UINavigationController(rootViewController: ExampleContentViewController(backgroundColor: .green)))
        case 2:
            viewTransition.onNext(UINavigationController(rootViewController: ExampleContentViewController(backgroundColor: .yellow)))
        case 3:
            viewTransition.onNext(UINavigationController(rootViewController: ExampleContentViewController(backgroundColor: .red)))
        default:
            break
        }
   }
}

// 3. SideMenuUsable
class ExampleContentViewController: UIViewController, SideMenuUsable {

    var sideMenuAction: PublishSubject<SideMenuAction> = PublishSubject<SideMenuAction>()

    func open() {
        sideMenuAction.onNext(.open)
    }

    func close() {
        sideMenuAction.onNext(.close)
    }
}

Screenshots

SHSideMenu

Latest podspec

{
    "name": "SHSideMenu",
    "version": "0.0.8",
    "summary": "Simple side menu view controller ud83cudf54",
    "description": "Simple side menu view controller for ios ud83cudf54",
    "homepage": "https://github.com/cozzin/SHSideMenu",
    "license": "MIT",
    "authors": {
        "cozzin": "[email protected]"
    },
    "social_media_url": "https://www.facebook.com/hseongho",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/cozzin/SHSideMenu.git",
        "tag": "0.0.8"
    },
    "source_files": "Source/*.{swift,h}",
    "frameworks": "UIKit",
    "dependencies": {
        "SnapKit": [
            "~> 4.0.0"
        ],
        "RxSwift": [
            "~> 4.1"
        ]
    },
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This