这个库类似于表视图到ActionSheet的扩展。
您有两种方法在自己的项目中使用这个库
将KkListActionSheet目录复制到您的项目中
使用CocoaPods编写Podfile进行安装
pratform :ios
pod 'KkListActionSheet'
KkListActionSheet使用简单的方法。导入头文件,它定义一个代理(包含数据源),客户端实现。KkListActionSheetDelegate类似于组合的UITableViewDelegate和UITableViewDataSource。
+ (instancetype) createInit:(UIViewController *) parent;
或
+ (instancetype) createInit:(UIViewController *) parent style:(int) styleIdx;
横屏时的样式模式
横屏时的样式模式
[kkListActionSheet showHide]
- (void) setHiddenTitle;
- (void) setTitle:(NSString *)title;
或
- (void) setAttrTitle:(NSAttributedString *)attrTitle;
#import "kkListActionSheet.h"
@interface ExampleViewController ()
<KkListActionSheetDelegate>
@end
@implement ExampleViewController {
kkListActionSheet *kkListActionSheet;
}
-(void) viewDidLoad {
kkListActionSheet = [KkListActionSheet createInit:uiViewController];
kkListActionSheet.delegate = self;
}
-(IBAction)buttonPushed:(UIButton *)sender {
[kkListActionSheet showHide];
}
@end