Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
  2.  
  3. let mySelectedCell: UITableViewCell = tableView.cellForRowAtIndexPath(indexPath)!
  4. mySelectedCell.accessoryType = UITableViewCellAccessoryType.Checkmark
  5. mySelectedCell.tintColor = UIColor.blackColor()
  6.  
  7.  
  8. }
  9.  
  10. if (mySelectedCell.accessoryType = UITableViewCellAccessoryType.Checkmark) {
  11. mySelectedCell.accessoryType = UITableViewCellAccessoryType.None
  12. }
  13. else {
  14. mySelectedCell.accessoryType = UITableViewCellAccessoryType.Checkmark
  15. }
  16.  
  17. if (!myValue[indexPath.row].value) { // if the BOOL is NO
  18. mySelectedCell.accessoryType = UITableViewCellAccessoryType.None
  19. }
  20. else {
  21. mySelectedCell.accessoryType = UITableViewCellAccessoryType.Checkmark
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement