UIActionSheet Template

I need to mark the selected button in the UIActionSheet file.

How to add a checkmark in a UIActionSheet button?

Is there any way specific to UIActionSheet without the standard addition of an image inside a button.

+3
source share
2 answers
otherButtonTitles:@"√ 1", @" 2", 
+5
source

Starting with iOS 8.0, you can use the UIAlertController . In the UIAlertController each button element is known as a UIAlertAction , which is appended accordingly. UIAlertAction contains a UIAlertAction property called an image, which you can set to suit your needs.

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

Source: https://habr.com/ru/post/1012407/


All Articles