PersonPickerTableViewCell.swift 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // PersonPickerTableViewCell.swift
  3. // O2Platform
  4. //
  5. // Created by FancyLou on 2019/8/15.
  6. // Copyright © 2019 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class PersonPickerTableViewCell: UITableViewCell {
  10. lazy public var trueImage: UIImage = {
  11. return UIImage(named: "selected")!
  12. }()
  13. lazy public var falseImage: UIImage = {
  14. return UIImage(named: "unselected")!
  15. }()
  16. @IBOutlet weak var personIconImageView: UIImageView!
  17. @IBOutlet weak var checkImageView: UIImageView!
  18. @IBOutlet weak var personNameLabel: UILabel!
  19. override func awakeFromNib() {
  20. super.awakeFromNib()
  21. // Initialization code
  22. self.checkImageView.image = falseImage
  23. }
  24. override func setSelected(_ selected: Bool, animated: Bool) {
  25. super.setSelected(selected, animated: animated)
  26. // Configure the view for the selected state
  27. }
  28. func loadPersonInfo(info: OOPersonModel, checked: Bool) {
  29. self.personNameLabel.text = info.name
  30. if checked {
  31. self.checkImageView.image = trueImage
  32. }else {
  33. self.checkImageView.image = falseImage
  34. }
  35. }
  36. }