Nikola Nikolic
Nikola Nikolic

Reputation: 61

UIActionSheet checkmark

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.

Upvotes: 3

Views: 3136

Answers (2)

Burhanuddin Sunelwala
Burhanuddin Sunelwala

Reputation: 5343

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"];
}];

Upvotes: 1

Gank
Gank

Reputation: 4667

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

Upvotes: 5

Related Questions