Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TaskTableViewCell: UITableViewCell {
- @IBOutlet weak var title: UILabel!
- @IBOutlet weak var date: UILabel!
- @IBOutlet weak var checkBox: UIButton!
- override func awakeFromNib() {
- super.awakeFromNib()
- self.indentationWidth = 40
- // Initialization code
- }
- override func setSelected(_ selected: Bool, animated: Bool) {
- super.setSelected(selected, animated: animated)
- // Configure the view for the selected state
- }
- }
- override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
- {
- guard let cell = tableView.dequeueReusableCell(withIdentifier: "listItem", for: indexPath) as? TaskTableViewCell else {
- fatalError("The dequeued cell is not an instance of TaskTableViewCell.")
- }
- cell.checkBox?.addTarget(self, action: #selector(toggleCheckbox(_:)), for: .touchUpInside)
- let green = UIColor(red: 0.2, green: 0.8, blue: 0.2, alpha: 1)
- cell.checkBox?.setTitleColor(green, for: .normal)
- cell.indentationWidth = 4000000
- return cell
- }
- override func tableView(_ tableView: UITableView,
- indentationLevelForRowAt indexPath: IndexPath) -> Int{
- NSLog("Indenting")
- return indexPath.row + 5
- }
Add Comment
Please, Sign In to add comment