// // IHActivityHistoryManager.swift // Inhealth // // Created by weclouds on 2019/12/19. // Copyright © 2019 weclouds. All rights reserved. // import UIKit class IHActivityHistoryManager: NSObject,IHViewManagerProtocolDelegate{ private var page = 1 lazy var mainView: IHActivityHistoryView = { let mainView = IHActivityHistoryView() mainView.delegate = self return mainView }() private weak var vc : UIViewController? func bindController(_ vc: UIViewController) { self.vc = vc createUI() IHActivityService.share.getLoglist(1, requestSuccess: { (issuccess, msg) in if issuccess == false{ //发送错误信息 } }) { //发送错误信息 } } func createUI() { self.vc?.navigationBarTitle = "操作日志" mainView.frame = CGRect(x: 0, y: 0, width: KSCREENWIDTH, height: KSCREENHEIGHT - KNavBarHeight ) self.vc?.view.addSubview(mainView) } } extension IHActivityHistoryManager:IHActivityHistoryViewDelegate { func tableViewEsAddPullToRefresh() { page = 1 IHActivityService.share.getLoglist(page, requestSuccess: { (issuccess, msg) in self.mainView.endRefresh() if issuccess == false{ //发送错误信息 } }) { //发送错误信息 self.mainView.endRefresh() } } func tableViewEsAddInfiniteScrolling() { page += 1 IHActivityService.share.getLoglist(page, requestSuccess: { (issuccess, msg) in self.mainView.endRefresh() if issuccess == false{ //发送错误信息 } }) { //发送错误信息 self.mainView.endRefresh() } } }