Latest 0.5.1
Homepage https://github.com/db42/SidePanel
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform
Carthage compatible

SidePanel

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate SidePanel into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'SidePanel'

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SidePanel into your Xcode project using Carthage, specify it in your Cartfile:

github "fulldecent/SidePanel" ~> 0.1

Run carthage update to build the framework and drag the built SidePanel.framework into your Xcode project.

Usage

//Override SidePanelController to provide a custom hamburger menu icon
class MySidePanelController: SidePanelController {
  override func leftButton() -> UIButton {
    let frame = CGRectMake(0, 0, 20, 20)
    let button = UIButton(frame: frame)
    button.setImage(UIImage(named: "menu"), forState: .Normal)
    return button
  }
}

//Initialise SidePanelController - AppDelegate.swift
var sidePanelController: SidePanelController?
var mainVC1: UINavigationController?
var mainVC2: UINavigationController?

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  ....
  let mainVC1 = MainViewController()
  let sc = SideController()
  let sidePanelController = MySidePanelController(sideController: sc)
  sidePanelController.selectedViewController = mainVC1

  self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
  self.window?.rootViewController = svc
  self.window?.makeKeyAndVisible()
  self.sidePanelController = sidePanelController
  ....
}

//Handle navigation from SideController - SideViewController.swift
class SideViewController: UITableViewController {
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    if let appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate {
      let vc = indexPath.row == 0 ? appDelegate.mainVC1 : appDelegate.mainVC2
      appDelegate.sidePanelController?.selectedViewController = vc
    }
  }
}

Author

Dushyant Bansal, [email protected]

License

SidePanel is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SidePanel",
    "version": "0.5.1",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "Google styled sidepanel written in swift",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/db42/SidePanel",
    "authors": {
        "Dushyant Bansal": "[email protected]"
    },
    "source": {
        "git": "https://github.com/db42/SidePanel.git",
        "tag": "0.5.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Source/*.swift",
    "resource_bundles": {
        "SidePanel": [
            "Resources/**/*.{png}"
        ]
    },
    "pushed_with_swift_version": "2.3"
}

Pin It on Pinterest

Share This