Latest 0.3.1
Homepage https://github.com/HongliYu/DPSlideMenuKit-Swift
License MIT
Platforms ios 10.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-4.0]()
Carthage Compatible

alt text

Usage

  // 1. If embed in storyboard
  override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if let destination = segue.destination as? DPDrawerViewController,
      segue.identifier == "Main_Drawer" {
      DPSlideMenuManager.shared.setDrawer(drawer: destination)
    }
  }

alt text

    // 2. If not embed in storyboard, set drawer manually
    //    let drawer = DPDrawerViewController()
    //    addChild(drawer)
    //    view.addSubview(drawer.view)
    //    DPSlideMenuManager.shared.setDrawer(drawer: drawer)

    // 3. Add view controllers in the left & right side, and they must be inherited from DPBaseEmbedViewController
    let leftMenuVCTypes = [DPTeamViewController.self,
                           DPChannelListViewController.self,
                           DPMessageListViewController.self]
    let leftMenuViewControllers = UIViewController.baseEmbedControllers(leftMenuVCTypes,
                                                                        storyboard: "Pages")

    let rightMenuVCTypes = [DPSettingsViewController.self]
    let rightMenuViewControllers = UIViewController.baseEmbedControllers(rightMenuVCTypes,
                                                                         storyboard: "Pages")

    // 4. If the viewcontroller is not generated from storyboard, set the storyboard param to nil,
    //    let leftMenuVCTypes = [DPTestViewController.self]
    //    let leftMenuViewControllers = UIViewController.baseEmbedControllers(leftMenuVCTypes,
    //                                                                        storyboard: nil)

    // 5. Center viewcontroller must be inherited from DPCenterContentViewController, and can not be nil
    guard let homeViewController = instantiateVC(DPHomeViewController.self) else { return }

    // 6. Combine center, left, right, together. Meanwhile, left or right can be nil
    DPSlideMenuManager.shared.setup(homeViewController,
                                    leftContentEmbedViewControllers: leftMenuViewControllers,
                                    rightContentEmbedViewControllers: rightMenuViewControllers)

Latest podspec

{
    "name": "DPSlideMenuKit",
    "version": "0.3.1",
    "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.3.1"
    },
    "platforms": {
        "ios": "10.0"
    },
    "requires_arc": true,
    "source_files": [
        "DPSlideMenuKitDemo/DPSlideMenuKit/",
        "DPSlideMenuKitDemo/DPSlideMenuKit/Base/",
        "DPSlideMenuKitDemo/DPSlideMenuKit/Left",
        "DPSlideMenuKitDemo/DPSlideMenuKit/Right"
    ],
    "frameworks": [
        "UIKit",
        "Foundation",
        "QuartzCore"
    ],
    "module_name": "DPSlideMenuKit",
    "swift_version": "4.2"
}

Pin It on Pinterest

Share This