IHRoomLightHistoryManager.swift 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // IHRoomLightHistoryManager.swift
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2019/12/16.
  6. // Copyright © 2019 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. let kNotifactionIHRoomLightHistoryManagerSensorHistory = "kNotifactionIHRoomLightHistoryManagerSensorHistory"
  10. class IHRoomLightHistoryManager: NSObject ,IHViewManagerProtocolDelegate{
  11. lazy var mainView: IHRoomHistoryView = {
  12. let mainView = IHRoomHistoryView()
  13. return mainView
  14. }()
  15. // private var vc = UIViewController()
  16. private weak var vc : UIViewController?
  17. func bindController(_ vc: UIViewController) {
  18. self.vc = vc
  19. let hisvc = self.vc as! IHRoomLightHistoryListVCtr
  20. self.mainView.unit = hisvc.unit
  21. self.mainView.updatetimes = hisvc.updatetimes
  22. self.mainView.history = hisvc.history
  23. self.mainView.devType = hisvc.devType
  24. self.mainView.devID = hisvc.devId
  25. self.mainView.dateType = hisvc.date_type
  26. createUI()
  27. }
  28. deinit {
  29. NotificationCenter.default.post(name: NSNotification.Name(kNotifactionIHRoomLightHistoryManagerSensorHistory), object: nil)
  30. }
  31. func createUI() {
  32. mainView.frame = CGRect(x: 0, y: 0, width: KSCREENWIDTH, height: KSCREENHEIGHT - KNavBarHeight - 50)
  33. self.vc!.view.addSubview(mainView)
  34. }
  35. }