Coder Social home page Coder Social logo

vkey24 / kgfloatingdrawer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kylegoddard/kgfloatingdrawer

0.0 2.0 0.0 8.23 MB

A floating navigation drawer with an interesting animated presentation written in Swift.

License: MIT License

Swift 87.18% Ruby 1.41% C 0.71% C++ 1.46% Objective-C 0.95% Shell 8.29%

kgfloatingdrawer's Introduction

KGFloatingDrawer

KGFloatingDrawer is a reimplementation of JVillella/JVFloatingDrawer in Swift. A floating drawer style navigation. KGFloatingDrawer provides a unique twist on the nav drawer pattern.

#Usage

func prepareDrawerViewController() -> KGDrawerViewController {
    let drawerViewController = KGDrawerViewController()

    drawerViewController.centerViewController = drawerSettingsViewController()
    drawerViewController.leftViewController = leftViewController()
    drawerViewController.rightViewController = rightViewController()
    drawerViewController.backgroundImage = UIImage(named: "sky3")

    _drawerViewController = drawerViewController

    return drawerViewController
}

#Installation

KGFloatingDrawer can be installed as a CocoaPod. To install it, simply add the following line to your Podfile:

pod 'KGFloatingDrawer', '~> 0.1.3'

###Important Note

KGFloatingDrawer requires Swift 1.2, XCode 6.3 and CocoaPods 0.36.0

#How it Works

###KGDrawerViewController

The KGDrawerViewController maintains references to center, left and optionally right view controllers. The centerViewController, leftViewController and rightViewController properties can all be reassigned in order to replace them.

###Opening & Closing Drawers

KGDrawerViewController has three functions used to open and close the nav drawer.

func openDrawer(side: KGDrawerSide, animated:Bool, complete: (finished: Bool) -> Void) {}

func closeDrawer(side: KGDrawerSide, animated: Bool, complete: (finished: Bool) -> Void) {}

func toggleDrawer(side: KGDrawerSide, animated: Bool, complete: (finished: Bool) -> Void) {}

###Drawer Width

The leftDrawerWidth and rightDrawerWidth are used to set the width of the drawer once it has been opened. Note that this is not the edge size of the centerViewController. The default value for this is 280 points.

###Background Image

The background image displayed when the drawer is open is set via the backgroundImage property.

###Animator

KGFloatingDrawer comes with a spring animator with the configurable properties: animationDelay, animationDuration, initialSpringVelocity, and springDamping

But JVillella/JVFloatingDrawer has custom animators!?

I know! The ability to set a custom animator is coming soon.

#Author

Kyle Goddard

JVillella/JVFloatingDrawer was authored by Julian Villella

#License

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

kgfloatingdrawer's People

Contributors

kylegoddard avatar

Watchers

James Cloos avatar 江枫 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.