1、demo包含简单的类文件:
2、使用方法和iOS原生的UIActionSheet基本一样:
// 有标题(防微信)
- (IBAction)showActionSheet:(id)sender {
TLDActionSheet *sheetView = [[TLDActionSheet alloc] initWithTitle:@"标题" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"注意!" otherButtonTitles:@[@"投诉",@"保存图片",@"发送给朋友"]];
[sheetView setTitleColor:[UIColor redColor] WithIndex:0];
[sheetView setTitleColor:[UIColor greenColor] WithIndex:2];
[sheetView setCancelTitleColor:[UIColor yellowColor]];
[sheetView show];
}
#pragma mark TLDActionSheetDelegate
-(void)actionSheet:(TLDActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
NSLog(@"buttonIndex:%ld",buttonIndex);
}