Guest User

Untitled

a guest
Jan 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. class TaskTableViewCell: UITableViewCell {
  2. @IBOutlet weak var title: UILabel!
  3. @IBOutlet weak var date: UILabel!
  4. @IBOutlet weak var checkBox: UIButton!
  5. override func awakeFromNib() {
  6. super.awakeFromNib()
  7. self.indentationWidth = 40
  8. // Initialization code
  9. }
  10.  
  11. override func setSelected(_ selected: Bool, animated: Bool) {
  12. super.setSelected(selected, animated: animated)
  13.  
  14. // Configure the view for the selected state
  15. }
  16.  
  17. }
  18.  
  19. override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
  20. {
  21. guard let cell = tableView.dequeueReusableCell(withIdentifier: "listItem", for: indexPath) as? TaskTableViewCell else {
  22. fatalError("The dequeued cell is not an instance of TaskTableViewCell.")
  23. }
  24. cell.checkBox?.addTarget(self, action: #selector(toggleCheckbox(_:)), for: .touchUpInside)
  25. let green = UIColor(red: 0.2, green: 0.8, blue: 0.2, alpha: 1)
  26. cell.checkBox?.setTitleColor(green, for: .normal)
  27. cell.indentationWidth = 4000000
  28.  
  29. return cell
  30. }
  31.  
  32. override func tableView(_ tableView: UITableView,
  33. indentationLevelForRowAt indexPath: IndexPath) -> Int{
  34. NSLog("Indenting")
  35. return indexPath.row + 5
  36. }
Add Comment
Please, Sign In to add comment