IHGatewayManager.swift 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // IHGatewayManager.swift
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2020/8/20.
  6. // Copyright © 2020 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. class IHGatewayManager: NSObject {
  10. private weak var vc : IHGatewayCtr?
  11. private lazy var mainView : IHGatewayView = {
  12. let mainView = IHGatewayView.init(frame: CGRect.init(x: 0, y: 0, width: KSCREENWIDTH, height: self.vc!.viewH! - KTabbarHeight))
  13. mainView.delete = self
  14. return mainView
  15. }()
  16. func bindController(_ vc : IHGatewayCtr) {
  17. self.vc = vc
  18. self.vc?.view.addSubview(mainView)
  19. mainView.gatewayList = vc.gatewayList
  20. }
  21. }
  22. //extension IHGatewayManager : UITableViewDelegate,UITableViewDataSource{
  23. // func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  24. // return self.vc?.gatewayList?.count ?? 0
  25. // }
  26. //
  27. // func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  28. // let gatewayCell = "gatewayCell"
  29. // var cell = tableView.dequeueReusableCell(withIdentifier: gatewayCell)
  30. // if cell == nil {
  31. // cell = UITableViewCell.init(style: .default, reuseIdentifier: gatewayCell)
  32. // }
  33. // cell?.textLabel?.text = "\(indexPath.row)"
  34. // return cell!
  35. // }
  36. //}
  37. extension IHGatewayManager : IHGatewayViewDelete{
  38. func gatewaySelected(gateway: gatewayInfor) {
  39. self.vc?.bottomView!.isHidden = true
  40. let gatewayVC = IHConfigGatawayDetailCtr()
  41. gatewayVC.gateway = gateway
  42. self.vc?.navigationController?.pushViewController(gatewayVC, animated: true)
  43. }
  44. }