IHSensorItemCell.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // IHSensorItemCell.swift
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2019/12/17.
  6. // Copyright © 2019 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. class IHSensorItemCell: UICollectionViewCell {
  10. var isAlarm:Bool? = false{
  11. didSet{
  12. if let isalarm = self.isAlarm {
  13. if isalarm == true {
  14. statusView.backgroundColor = UIColor(hexString: "#FF0C4D")
  15. }else{
  16. // #05CFAB
  17. statusView.backgroundColor = UIColor(hexString: "#573F95")
  18. }
  19. }
  20. }
  21. }
  22. var mTitle:String?{
  23. didSet{
  24. if self.mTitle == "Temperature"{
  25. aTitleLabel.text = "温度"
  26. }else if self.mTitle == "Humidity"{
  27. aTitleLabel.text = "湿度"
  28. }else {
  29. aTitleLabel.text = self.mTitle
  30. }
  31. }
  32. }
  33. var mValue :NSAttributedString?{
  34. didSet{
  35. //aVlaueLabel.text = self.mValue
  36. aVlaueLabel.attributedText = self.mValue
  37. }
  38. }
  39. @IBOutlet weak var aTitleLabel: UILabel!
  40. @IBOutlet weak var aVlaueLabel: UILabel!
  41. @IBOutlet weak var statusView: UIView!
  42. override func awakeFromNib() {
  43. super.awakeFromNib()
  44. // Initialization code
  45. }
  46. }