CFFolderTableViewCell.swift 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // CFFolderTableViewCell.swift
  3. // O2Platform
  4. //
  5. // Created by FancyLou on 2019/10/17.
  6. // Copyright © 2019 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. import CocoaLumberjack
  10. class CFFolderTableViewCell: UITableViewCell {
  11. @IBOutlet weak var checkBoxButton: UIButton!
  12. @IBOutlet weak var timeLabel: UILabel!
  13. @IBOutlet weak var folderNameLabel: UILabel!
  14. //点击checkbox
  15. @IBAction func clickCheckAction(_ sender: UIButton) {
  16. DDLogDebug("点击。。。。。。。。CFFolderTableViewCell")
  17. if self.showCheckBox {
  18. if self.folder != nil {
  19. DDLogDebug("enter click folder")
  20. self.clickdelegate?.clickFolder(self.folder!)
  21. }
  22. }
  23. }
  24. var folder: OOFolder?
  25. var clickdelegate: CloudFileCheckClickDelegate?
  26. var showCheckBox = true
  27. override func awakeFromNib() {
  28. super.awakeFromNib()
  29. }
  30. override func setSelected(_ selected: Bool, animated: Bool) {
  31. super.setSelected(selected, animated: animated)
  32. }
  33. //添加数据
  34. func setData(folder: OOFolder, checked: Bool, isShowCheck: Bool = true) {
  35. self.folder = folder
  36. self.folderNameLabel.text = folder.name ?? ""
  37. self.timeLabel.text = folder.updateTime ?? ""
  38. self.showCheckBox = isShowCheck
  39. if self.showCheckBox {
  40. self.checkBoxButton.isHidden = false
  41. if checked {
  42. self.checkBoxButton.setImage(UIImage(named: "icon__ok2_click"), for: .normal)
  43. }else {
  44. self.checkBoxButton.setImage(UIImage(named: "icon_circle"), for: .normal)
  45. }
  46. }else {
  47. self.checkBoxButton.isHidden = true
  48. }
  49. }
  50. }