Giter VIP home page Giter VIP logo

mmsideslipdrawer's Introduction

MMSideslipDrawer

License MIT  CocoaPods  CocoaPods 

侧滑菜单,支持滑动和点击,类似滴滴出行(滴滴打车)侧滑栏。

MMSideslipDrawer

安装 [CocoaPods]

  1. pod "MMSideslipDrawer";
  2. pod install / pod update;
  3. #import <MMSideslipDrawer.h>;

使用说明

MMSideslipItem属性介绍:

@interface MMSideslipItem : NSObject

// 头像缩略图本地路径 [若为网络路径,可直接对portraitImageView赋值,具体见MMSideslipDrawer.h]
@property (nonatomic,copy) NSString *thumbnailPath;
// 用户名称
@property (nonatomic,copy) NSString *userName;
// 用户等级
@property (nonatomic,copy) NSString *userLevel;
// 等级图片名称
@property (nonatomic,copy) NSString *levelImageName;
// 列表项名称数组 
@property (nonatomic,copy) NSArray *textArray;
// 列表项图片名称数组 
@property (nonatomic,copy) NSArray *imageNameArray;

@end

创建侧滑抽屉:

MMSideslipItem *item = [[MMSideslipItem alloc] init];
item.thumbnailPath = [[NSBundle mainBundle] pathForResource:@"menu_head@2x" ofType:@"png"];
item.userName = @"LEA";
item.userLevel = @"普通会员";
item.levelImageName = @"menu_vip";
item.textArray = @[@"行程",@"钱包",@"客服",@"设置"];
item.imageNameArray = @[@"menu_0",@"menu_1",@"menu_2",@"menu_3"];

self.slipDrawer = [[MMSideslipDrawer alloc] initWithDelegate:self slipItem:item];

侧滑:

[self.slipDrawer openLeftDrawerSide];

关闭:

[self.slipDrawer colseLeftDrawerSide];

代理:

// 查看列表项信息
- (void)slipDrawer:(MMSideslipDrawer *)slipDrawer didSelectAtIndex:(NSInteger)index;
// 查看用户信息
- (void)didViewUserInformation:(MMSideslipDrawer *)slipDrawer;
// 查看用户等级信息
- (void)didViewUserLevelInformation:(MMSideslipDrawer *)slipDrawer;

后记

不定时更新,如有问题欢迎给我留言,我会及时回复。如果这个工具对你有一些帮助,请给我一个star,谢谢。

mmsideslipdrawer's People

Contributors

chaneylau avatar

Watchers

James Cloos 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.