UIActionSheet复选标记

我需要在UIActionSheet中标记选定的button。

如何在UIActionSheetbutton中添加选中标记?

是否有一些特定的UIActionSheet方法,没有标准的添加button内的图像。

otherButtonTitles:@"√ 1", @" 2", 

从iOS 8.0开始,您可以使用UIAlertController 。 在UIAlertController ,每个button项都被称为UIAlertAction ,并相应地添加。 UIAlertAction包含一个名为image的运行时属性,您可以根据需要进行设置。

 UIAlertActioin *action1 = [UIAlertAction actionWithTitle:@"1" style: UIAlertActionStyleDefault handler:(void (^)(UIAlertAction *action)) { [action setValue:[UIImage imageNamed:@"your-image-name"] forKey:@"_image"]; }];