将 HGActionSheet 文件夹中的所有源代码拖入项目中,导入头文件 import "HGActionSheet.h"
创建对象
NSArray *dataArray = @[@"空调维修", @"洗衣机维修", @"电视维修", @"电脑维修", @"热水器维修", @"抽油烟机维修", @"厕所疏通", @"房屋补漏", @"房屋翻新", @"其它"];
HGActionSheet *actionSheet = [HGActionSheet createWithTitle:@"服务类型" dataSource:dataArray];
设置选中的行
actionSheet.selectIndex = 0;
设置回调 block 或 delegate
actionSheet.finishSelectBlock = ^(NSInteger index) {
//do something ...
};
弹出
[actionSheet show];
MIT