UIActionSheet checkmark
Asked Answered
E

2

3

I need to mark selected button in UIActionSheet.

How can I add checkmark in UIActionSheet button?

Is there some way specific for UIActionSheet, without standard adding image inside button.

Evensong answered 18/11, 2014 at 14:33 Comment(1)
Can't be done with UIActionSheet. Find a 3rd party replacement.Upbraiding
W
5
otherButtonTitles:@"√ 1", @"  2", 
Wroughtup answered 21/11, 2014 at 8:21 Comment(0)
A
1

Starting from iOS 8.0 you can use UIAlertController. In UIAlertController, each button item is know as UIAlertAction which add accordingly. UIAlertAction contains a runtime property called image which you can set as per your need.

UIAlertActioin *action1 = [UIAlertAction actionWithTitle:@"1" style: UIAlertActionStyleDefault handler:(void (^)(UIAlertAction *action)) {
    [action setValue:[UIImage imageNamed:@"your-image-name"] forKey:@"_image"];
}];
Alisonalissa answered 13/1, 2016 at 7:48 Comment(1)
Xcode 7.2.1 won't compile it because UIAlertAction has no method setImage:Beeson

© 2022 - 2024 — McMap. All rights reserved.