Giter Club home page Giter Club logo

jldrawercontroller's Introduction

JLDrawerController v1.0.2

Install

Copy below files into your project.

JLDrawerController.h
JLDrawerController.m

Sample Project

You can find a sample project in the repository.

Usage

  1. import header file #import "JLDrawerController.h"
  2. set property @property (strong, nonatomic) JLDrawerController *drawerController;
  3. create instance like below
self.drawerController = [[JLDrawerController alloc] initWithParentViewController:self
                                                             childViewController:vc
                                                                      swipeView:self.topSwipeView
                                                                revealDirection:JLDrawerRevealDirectionTopToBottom
                                                              allowSwipeToClose:YES];
  • Parent View Controller : base view controller
  • Child View Controller : a view controller which will appear or disappear when user swipe.
  • Swipe View : a view which is on base view controller to detect pan gesture.
  • Reveal Direction : Bottom to Top, Top to Bottom, Left to Right, Right to Left
  • Allow Swipe to Close : if NO, users cannot close the child view controller by swipe.

Also, you can manually open or close the child view controller by calling below methods

- (void)open;
- (void)openAnimated:(BOOL)animated;
- (void)openAnimated:(BOOL)animated completion:(void(^)(void))completion;
- (void)close;
- (void)closeAnimated:(BOOL)animated;
- (void)closeAnimated:(BOOL)animated completion:(void(^)(void))completion;

It is possible to receive the event about the child view controller changes.

self.myDrawerController.eventHandler = ^(JLDrawerEvent event) {
switch (event) {
    case JLDrawerEventViewDidAppear:
        NSLog(@"TOP: JLDrawerEventViewDidAppear");
        break;
    case JLDrawerEventViewDidDisappear:
        NSLog(@"TOP: JLDrawerEventViewDidDisappear");
        break;
    default:
        break;
    }
};

Demo

Issues

Currently, it is NOT support rotation. You should not change the device orientation.

License

Licensed under the MIT license. You can use the code in your commercial and non-commercial projects.

jldrawercontroller's People

Contributors

buhikon avatar

Stargazers

 avatar

Watchers

 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.