Latest 0.2.3
Homepage https://github.com/HongliYu/DPSlideMenuKit-Swift
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit, Foundation, QuartzCore
Authors

DPSlideMenuKit-Swift

Slide menu kit with left and right pages. Just like Slack!

Cocoapods
Pod License
[Swift-3.1]()
Carthage Compatible

alt text

Usage

    // 1. Embed the drawer controller in storyboard, that means add the drawer controller as the child controller of current view controller
    // 2. add this func for embed segur id
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
      if segue.identifier == "Main_Drawer",
      segue.destination is DPDrawerViewController {
        DPSlideMenuManager.shared.setDrawer(drawer: segue.destination as? DPDrawerViewController)
      }
    }

alt text

    //  3. If not embed in storyboard? add it manually in code
    //  let drawer: DPDrawerViewController? = self.storyboard?.instantiateViewController(withIdentifier: "DPDrawerViewController") as? DPDrawerViewController
    //  self.addChildViewController(drawer!)
    //  self.view.addSubview(drawer!.view)
    //  DPSlideMenuManager.shared.setDrawer(drawer: drawer)
    // 4. Add view controllers in the left side, which are configured in the storyboard
    let leftMenuViewControllerNameArray: [String] = ["DPTeamViewController",
                                                     "DPChannelListViewController",
                                                     "DPMessageListViewController"]
    let leftMenuViewControllers: [DPBaseEmbedViewController] = UIViewController.generateViewControllersFrom(viewControllerNameArray: leftMenuViewControllerNameArray, storyboardName: "Main", bundle: nil) as! [DPBaseEmbedViewController]

    //  5. If not from story board, mark the storyboardName is nil, and the related view controller will be generated without story board
    //  let leftMenuViewControllerNameArrayFromCode: [String] = ["DPTestViewController"]
    //  let leftMenuViewControllersFromCode: [DPBaseEmbedViewController] = UIViewController.generateViewControllersFrom(viewControllerNameArray: leftMenuViewControllerNameArrayFromCode, storyboardName: nil, bundle: nil) as! [DPBaseEmbedViewController]
    //  leftMenuViewControllers.append(contentsOf: leftMenuViewControllersFromCode)

    // 6. So does the right side
    let rightMenuViewControllerNameArray: [String] = ["DPSettingsViewController"]
    let rightMenuViewControllers: [DPBaseEmbedViewController] = UIViewController.generateViewControllersFrom(viewControllerNameArray: rightMenuViewControllerNameArray, storyboardName: "Main", bundle: nil) as! [DPBaseEmbedViewController]

    // 7. Add the first center view controller
    let homeViewController: DPHomeViewController? = self.storyboard?.instantiateViewController(withIdentifier: "DPHomeViewController") as? DPHomeViewController

    // 8. Setup left, right, center, become one
    DPSlideMenuManager.shared.setup(leftContentEmbedViewControllers: leftMenuViewControllers,
                                    rightContentEmbedViewControllers: rightMenuViewControllers,
                                    centerContentViewController: homeViewController)

Latest podspec

{
    "name": "DPSlideMenuKit",
    "version": "0.2.3",
    "summary": "slide menu",
    "description": "Slide menu kit with left and right pages. Just like Slack!",
    "homepage": "https://github.com/HongliYu/DPSlideMenuKit-Swift",
    "license": "MIT",
    "authors": {
        "HongliYu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/HongliYu/DPSlideMenuKit-Swift.git",
        "tag": "0.2.3"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "DPSlideMenuKit/",
    "frameworks": [
        "UIKit",
        "Foundation",
        "QuartzCore"
    ],
    "module_name": "DPSlideMenuKit",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This