// // IHGatewayManager.swift // Inhealth // // Created by weclouds on 2020/8/20. // Copyright © 2020 weclouds. All rights reserved. // import UIKit class IHGatewayManager: NSObject { private weak var vc : IHGatewayCtr? private lazy var mainView : IHGatewayView = { let mainView = IHGatewayView.init(frame: CGRect.init(x: 0, y: 0, width: KSCREENWIDTH, height: self.vc!.viewH! - KTabbarHeight)) mainView.delete = self return mainView }() func bindController(_ vc : IHGatewayCtr) { self.vc = vc self.vc?.view.addSubview(mainView) mainView.gatewayList = vc.gatewayList } } //extension IHGatewayManager : UITableViewDelegate,UITableViewDataSource{ // func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // return self.vc?.gatewayList?.count ?? 0 // } // // func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { // let gatewayCell = "gatewayCell" // var cell = tableView.dequeueReusableCell(withIdentifier: gatewayCell) // if cell == nil { // cell = UITableViewCell.init(style: .default, reuseIdentifier: gatewayCell) // } // cell?.textLabel?.text = "\(indexPath.row)" // return cell! // } //} extension IHGatewayManager : IHGatewayViewDelete{ func gatewaySelected(gateway: gatewayInfor) { self.vc?.bottomView!.isHidden = true let gatewayVC = IHConfigGatawayDetailCtr() gatewayVC.gateway = gateway self.vc?.navigationController?.pushViewController(gatewayVC, animated: true) } }