仿微信ActionSheet
由于系统的ActionSheet比较难看,所有最近参考微信的ActionSheet造了一个轮子。使用方法简单。
效果演示
使用方法
//初始化
XRActionSheet *actionSheet = [XRActionSheet actionSheetWithCancelTitle:@"取消" alertTitle:@"这是提示文字" SubTitles:@"点赞",@"举报", nil];
//按钮的点击回调
[actionSheet setActionSheetDidItemClick:^(XRActionSheet actionSheet, NSIndexPath actionsheetIndexPath, NSString *title) {
NSLog(@"row:%ld title:%@",(long)actionsheetIndexPath.row,title);
}];
//取消按钮的事件回调
[actionSheet setActionSheetDismissItemClick:^(XRActionSheet actionSheet, NSIndexPath actionsheetIndexPath, NSString *title) {
NSLog(@"取消按钮点击");
}];
//调起action sheet
[actionSheet pop];
详细的源代码和demo可以看我的github
同时也欢迎大家关注我的微信公众号