仿微信的一个向上弹出的选择框。因为效果很像UIActionSheet
,姑且命名为ZCActionSheet
吧。
无需初始化,直接调用showWithItemBlock
类方法,使用addItemWithLabelText: shouldDismiss:
方法添加按钮即可
[ZCActionSheet showWithItemBlock:^(id<ZCActionSheetItemsProtocol> items) {
[items addItemWithLabelText:@"退出后不回删除任何历史数据,下次登录依然可以使用本帐号" style:ZCActionSheetItemStyleDescription shouldDismiss:YES];
[items addItemWithLabelText:@"退出登录" style:ZCActionSheetItemStyleDestructive shouldDismiss:YES];
} selectedBlock:^(NSInteger indexPath) {
NSLog(@"%ld", indexPath);
}];
-
ZCActionSheetStyle - more Extension
ZCActionSheet is available under the MIT license. See the LICENSE file for more info.