LoadingPlugin.swift 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // LoadingPlugin.swift
  3. // SwiftBilibili
  4. //
  5. // Created by 罗文 on 2021/1/15.
  6. // Copyright © 2021年 罗文. All rights reserved.
  7. //
  8. import Moya
  9. //import Result
  10. class LoadingPlugin : PluginType {
  11. func willSend(_ request: RequestType, target: TargetType) {
  12. // if target is LoginAPI {
  13. // let api = target as! LoginAPI
  14. // if api.isShowLoading {
  15. // guard let curController = UIViewController.topMost else { return }
  16. //// curController.showLoadingAnimation(superView: curController.view)
  17. // QMUITips.showLoading(in: curController.view)
  18. // }
  19. // }
  20. }
  21. func didReceive(_ result: Result<Response, MoyaError>, target: TargetType) {
  22. // if target is LoginAPI {
  23. // let api = target as! LoginAPI
  24. // if api.isShowLoading {
  25. // guard let curController = UIViewController.topMost else { return }
  26. //// curController.hideLoadingAnimation(superView: curController.view)
  27. // QMUITips.hideAllTips()
  28. // }
  29. // }
  30. }
  31. }