// // IHRoomLightHistoryManager.swift // Inhealth // // Created by weclouds on 2019/12/16. // Copyright © 2019 weclouds. All rights reserved. // import UIKit let kNotifactionIHRoomLightHistoryManagerSensorHistory = "kNotifactionIHRoomLightHistoryManagerSensorHistory" class IHRoomLightHistoryManager: NSObject ,IHViewManagerProtocolDelegate{ lazy var mainView: IHRoomHistoryView = { let mainView = IHRoomHistoryView() return mainView }() // private var vc = UIViewController() private weak var vc : UIViewController? func bindController(_ vc: UIViewController) { self.vc = vc let hisvc = self.vc as! IHRoomLightHistoryListVCtr self.mainView.unit = hisvc.unit self.mainView.updatetimes = hisvc.updatetimes self.mainView.history = hisvc.history self.mainView.devType = hisvc.devType self.mainView.devID = hisvc.devId self.mainView.dateType = hisvc.date_type createUI() } deinit { NotificationCenter.default.post(name: NSNotification.Name(kNotifactionIHRoomLightHistoryManagerSensorHistory), object: nil) } func createUI() { mainView.frame = CGRect(x: 0, y: 0, width: KSCREENWIDTH, height: KSCREENHEIGHT - KNavBarHeight - 50) self.vc!.view.addSubview(mainView) } }