Skip to content

xuhonggui/HGActionSheet

Repository files navigation

HGActionSheet

弹出菜单

How to Use

使用CocoaPods

pod 'HGActionSheet'

手动导入

将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];

License

MIT