LoadingPlugin.swift 996 B

12345678910111213141516171819202122232425262728293031323334
  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 HomeAPI {
  13. // let api = target as! HomeAPI
  14. // if api.isShowLoading {
  15. // guard let curController = UIViewController.topMost else { return }
  16. // curController.showLoadingAnimation(superView: curController.view)
  17. // }
  18. // }
  19. }
  20. func didReceive(_ result: Result<Response, MoyaError>, target: TargetType) {
  21. // if target is HomeAPI {
  22. // let api = target as! HomeAPI
  23. // if api.isShowLoading {
  24. // guard let curController = UIViewController.topMost else { return }
  25. // curController.hideLoadingAnimation(superView: curController.view)
  26. // }
  27. // }
  28. }
  29. }