NewMainItemTableViewCell.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // NewMainItemTableViewCell.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2017/3/12.
  6. // Copyright © 2017年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class NewMainItemTableViewCell: UITableViewCell {
  10. @IBOutlet weak var categoryNameLabel: UILabel!
  11. @IBOutlet weak var titleLabel: UILabel!
  12. @IBOutlet weak var timeLabel: UILabel!
  13. var model:NSObject! {
  14. didSet{
  15. if model.isKind(of: CMS_PublishInfo.self){
  16. let m = model as! CMS_PublishInfo
  17. self.categoryNameLabel.text = "【\(m.categoryName!)】"
  18. self.titleLabel.text = m.title
  19. self.timeLabel.text = m.publishTime?.split(" ")[0]
  20. }else if(model.isKind(of: TodoTask.self)){
  21. let m = model as! TodoTask
  22. self.categoryNameLabel.text = "【\(m.applicationName!)】"
  23. self.titleLabel.text = m.title
  24. self.timeLabel.text = m.updateTime?.split(" ")[0]
  25. }
  26. }
  27. }
  28. override func awakeFromNib() {
  29. super.awakeFromNib()
  30. // Initialization code
  31. }
  32. override func setSelected(_ selected: Bool, animated: Bool) {
  33. super.setSelected(selected, animated: animated)
  34. // Configure the view for the selected state
  35. }
  36. }