Latest 0.0.1
Homepage https://github.com/William-Weng/WWMenuView
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

一個自訂的側邊選單 (上傳至Cocoapods)

Swift 4.2 Version Platform License

一個自訂的側邊選單 (上傳至Cocoapods)

使用範例

IBOutlet


import UIKit
import WWMenuView

// MARK: - 主要的ViewController
class MainViewController: WWMainViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        initMenuContainerViews()
    }

    /// 初始化ContainerView
    private func initMenuContainerViews() {

        let containerViews = (main: UIView.init(frame: view.frame), menu: UIView.init(frame: view.frame))

        view.addSubview(containerViews.main)
        view.addSubview(containerViews.menu)

        (mainContainerView, menuContainerView) = (containerViews.main, containerViews.menu)
    }
}

// MARK: - 內容的ViewController
class Page1ViewController: WWPageViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    /// 顯示側邊選單
    @IBAction func showMenu(_ sender: UIButton) {
        menuStatus(.show)
    }

    /// 隱藏側邊選單
    @IBAction func hideMenu(_ sender: UIButton) {
        menuStatus(.hide)
    }
}

class Page2ViewController: WWPageViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    /// 顯示側邊選單
    @IBAction func showMenu(_ sender: UIButton) {
        menuStatus(.show)
    }

    /// 隱藏側邊選單
    @IBAction func hideMenu(_ sender: UIButton) {
        menuStatus(.hide)
    }
}

// MARK: - 選單的ViewController
class MenuViewController: WWMenuViewController {

    lazy var page1ViewController: Page1ViewController = {
        self.storyboard!.instantiateViewController(withIdentifier: "Page1") as! Page1ViewController
    }()

    lazy var page2ViewController: Page2ViewController = {
        self.storyboard!.instantiateViewController(withIdentifier: "Page2") as! Page2ViewController
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    /// 移動到所選的ViewController
    @IBAction func showPage1(_ sender: UIButton) {
        changePage(to: page1ViewController)
    }

    /// 移動到所選的ViewController
    @IBAction func showPage2(_ sender: UIButton) {
        changePage(to: page2ViewController)
    }
}

Latest podspec

{
    "name": "WWMenuView",
    "version": "0.0.1",
    "summary": "WWMenuView is a SideMenu. (u4e00u500bu5074u908au9078u55ae)",
    "homepage": "https://github.com/William-Weng/WWMenuView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u7fc1u79b9u658c(William.Weng)": "[email protected]"
    },
    "platforms": {
        "ios": "10.0"
    },
    "ios": {
        "vendored_frameworks": "WWMenuView.framework"
    },
    "source": {
        "git": "https://github.com/William-Weng/WWMenuView.git",
        "tag": "0.0.1"
    },
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This