如何添加在UIActionsheet的button,我可以在iphone中创build刻度标签的复选标记?

我想弄清楚如何添加一个复选标记到UIActionSheet中的button的右侧。 在UIActionSheet的button中添加此复选标记是否有安全的方法? 有没有更简单的方法来添加复选标记在UIActionsheet的button,而不使用私人API?

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

  UIAlertAction *SwipeView =[UIAlertAction actionWithTitle:@"Swipe View" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { }]; [SwipeView setValue:[UIImage imageNamed:@"tick_mark" ] forKey:@"_image"];