6

In iOS Settings > Wi-Fi for example, the cell's checkmark is on the left (of the connected network), with the disclosure button on the right.

I need this. Is there a standard way in iOS 7 to get this?

iCode
  • 1,456
  • 1
  • 15
  • 26
meaning-matters
  • 21,929
  • 10
  • 82
  • 142
  • custom cell and creating that in code might be a solution. – Adrian P Feb 08 '14 at 17:01
  • @XCodeMonkey Any idea where I can get iOS 7's checkmark image? – meaning-matters Feb 08 '14 at 17:07
  • here is a translucent background image link but it is in black. http://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&docid=heBUi9GW_WD8nM&tbnid=qrmJngV8JVYCDM:&ved=0CAMQjhw&url=http%3A%2F%2Ficons8.com%2F2014%2F01%2F31%2Fios-7-icons-ok-cancel-close-redo-undo%2F&ei=smX2Uo_mE8K-kQf6soDYBg&bvm=bv.60983673,d.aWc&psig=AFQjCNGErQbrVTFTVId83jcaceq0eULarQ&ust=1391965964104752 – Adrian P Feb 08 '14 at 17:14
  • @XCodeMonkey That's a differently shaped checkmark. – meaning-matters Feb 08 '14 at 17:22

4 Answers4

4

Without using a custom cell, you may prefer UITableViewCellStyleDefault styled cell. It has an optional imageView, use checkmark as an image.

Or, you can use unicode symbols for checkmarks. It is a pretty neat solution and greatly explained here.

Community
  • 1
  • 1
mkubilayk
  • 2,477
  • 3
  • 20
  • 27
  • 1
    I already found that unicode answer, and it's indeed neat (I saved the link). But unicode does not have the standard/blue iOS checkmark. – meaning-matters Feb 08 '14 at 17:06
2

There is no standard way to put an accessory on the left, it seems that they just use cell's imageView for the checkmark and built-in detail disclosure indicator on the right.

maxkonovalov
  • 3,651
  • 34
  • 36
2

This is not exact solution but something close what iOS is doing in their WiFi listing, using only unicode character for checkmark and attributed string to set color to checkmark.

NSString *strCellText = @"This row is selected";
NSString *strCheckMarkUnicode = @"\u2713";
NSString *strFinalText = [NSString stringWithFormat:@"%@ %@",strCheckMarkUnicode,strCellText];

NSMutableAttributedString *strAttributedText = [[NSMutableAttributedString alloc]initWithString:strFinalText];
NSRange range=[strFinalText rangeOfString:strCheckMarkUnicode];

[strAttributedText addAttribute:NSForegroundColorAttributeName
                          value:[UIColor blueColor]
                          range:range];

_cellOne.textLabel.attributedText = strAttributedText;

enter image description here

Aditya Deshmane
  • 4,676
  • 2
  • 29
  • 35
0

In Swift 4 and later, place this guy in your viewDidLoad()

tableView.allowsMultipleSelectionDuringEditing = true

That's it!

Marquis103
  • 395
  • 3
  • 8