Latest 0.0.7
Homepage https://github.com/kaorimatz/KZSideDrawerController
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

KZSideDrawerController is a side drawer controller for iOS written in Swift.

KZSideDrawerControllerKZSideDrawerController

Usage

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

Creating a Side Drawer Controller

let sideDrawerController = KZSideDrawerController()
sideDrawerController.centerViewController = UIViewController()
sideDrawerController.leftViewController = UIViewController()
sideDrawerController.rightViewController = UIViewController()

Opening and Closing a Drawer

sideDrawerController.openDrawer(side: .Left, animated: true, completion: nil)
sideDrawerController.closeDrawer(side: .Right, animated: true, completion: nil)

Responding to Side Drawer Controller Events

extension ViewController: KZSideDrawerControllerDelegate {
    func sideDrawerController(sideDrawerController: KZSideDrawerController, willOpenViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
    func sideDrawerController(sideDrawerController: KZSideDrawerController, didOpenViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
    func sideDrawerController(sideDrawerController: KZSideDrawerController, willCloseViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
    func sideDrawerController(sideDrawerController: KZSideDrawerController, didCloseViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
}

Customization

  • leftDrawerWidth
    • The width of the left drawer. Defaults to 280.0.
  • rightDrawerWidth
    • The width of the right drawer. Defaults to 280.0.
  • shadowOpacity
    • The opacity of the drawer’s shadow. Defaults to 0.5.
  • shadowRadius
    • The blur radius of the drawer’s shadow. Defaults to 3.0.
  • shadowOffset
    • The offset of the drawer’s shadow. Defaults to (0.0, 0.0).
  • shadowColor
    • The color of the drawer’s shadow. Defaults to opaque black color.
  • dimmingColor
    • The color used to dim the center view while the drawer is open. Defaults to black color with alpha 0.3.

Requirements

  • iOS 7.0+
  • Xcode 7+

Installation

KZSideDrawerController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "KZSideDrawerController"

Author

Satoshi Matsumoto, [email protected]

License

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

Latest podspec

{
    "name": "KZSideDrawerController",
    "version": "0.0.7",
    "summary": "A side drawer controller for iOS written in Swift",
    "description": "KZSideDrawerController is a side drawer controller for iOS written in Swift.",
    "homepage": "https://github.com/kaorimatz/KZSideDrawerController",
    "screenshots": [
        "http://kaorimatz.github.io/KZSideDrawerController/screenshots/1.png",
        "http://kaorimatz.github.io/KZSideDrawerController/screenshots/2.png"
    ],
    "license": "MIT",
    "authors": {
        "Satoshi Matsumoto": "[email protected]"
    },
    "source": {
        "git": "https://github.com/kaorimatz/KZSideDrawerController.git",
        "tag": "0.0.7"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "KZSideDrawerController": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This