Skip to content

An actionSheet like WeChat. 一个高仿的微信ActionSheet弹框

License

Notifications You must be signed in to change notification settings

louis-ly/LYActionSheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LYAcitionSheet (高仿微信ActionSheet)

一个高仿微信ActionSheet的弹框.

image

AutoLayout屏幕旋转适配

image

Podfile

CocoaPods is the recommended method to install MessageDisplayKit, just add the following line to Podfile

支持CocoaPods. 只要在Podfile文件中加入一行

pod 'LYActionSheet'

and run pod install, then you're all done!

接着在终端输入pod install即可

How to use

Easy to drop into your project.

该库很容易接入项目

1、import LYActionSheet header file.

1.导入头文件LYActionSheet.h

#import "LYActionSheet.h" 

2、Initialize LYActionSheet class. There have four methods to initialize.

2.本库提供了有四个初始化的方法

- (instancetype)initWithButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
- (instancetype)initWithCancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
- (instancetype)initWithCancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
- (instancetype)initWithTitle:(NSString *)title cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;

3、Show the actionSheet, block will be called when the user presses on button.

3.调用显示弹框. 用户点击选项按钮是block会调用.

- (void)showWithClickedButtonAtIndex:(void(^)(NSInteger buttonIndex, NSString *buttonTitle))clickedBlock;
- (void)showWithClickedButtonAtIndex:(void(^)(NSInteger buttonIndex, NSString *buttonTitle))clickedBlock cancel:(void(^)(NSString *buttonTitle))cancelBlock;

About

An actionSheet like WeChat. 一个高仿的微信ActionSheet弹框

Resources

License

Stars

Watchers

Forks

Packages

No packages published