Code Monkey home page Code Monkey logo

acnavbardrawer's Introduction

ACNavBarDrawer


导航栏抽屉视图

Installation

  • Drag ACNavBarDrawer.h & ACNavBarDrawer.m into your project.
  • Add QuartzCore framework to your project.
    #import "ACNavBarDrawer.h"

Usage

Initialization

//-- 先创建按钮信息 ------------------------------------------------------------------
// 小数组第一个为图片名、第二个为按钮名
NSArray *allItems = @[@[@"drawer_msg", @"button1"],
                      @[@"drawer_msg", @"button2"],
                      @[@"drawer_msg", @"button3"],
                      @[@"drawer_msg", @"button4"]];
                      
/** 初始化 */
_drawerView = [[ACNavBarDrawer alloc] initWithView:self.view andItemInfoArray:allItems];

Open & Close

// 打开抽屉
[_drawerView openNavBarDrawer];

// 收起抽屉
[_drawerView closeNavBarDrawer];

Delegate

// 实现 <ACNavBarDrawerDelegate> 协议

// 设置代理对象
_drawerView.delegate = self;

// 抽屉上按钮事件的回调
-(void)didTapButtonAtIndex:(NSInteger)itemIndex
{    
    NSLog(@"Button %d is clicked.", (itemIndex + 1));

    switch (itemIndex)
    {
        case 0:
        {
            
        }
            break;
            
        // ... 此处省略

        default:
            break;
    }
}

// 可选回调 抽屉视图将要关闭时 的处理
-(void)drawerWillClose
{

}

Requirements

  • ARC
  • iOS 6/7

LICENSE

MIT

acnavbardrawer's People

Contributors

co42de 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.