猎豆优选

LoadingView.m 924B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // LoadingView.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/11/1.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "LoadingView.h"
  9. #import "ActivityIndicatorView.h"
  10. @implementation LoadingView
  11. + (void)show {
  12. ActivityIndicatorView *indicatorView = [ActivityIndicatorView shareIndicatorView];
  13. [indicatorView startAnimating];
  14. UIWindow *window = [UIApplication sharedApplication].keyWindow;
  15. [window addSubview:indicatorView];
  16. indicatorView.center = window.center;
  17. }
  18. + (void)showInView:(UIView *)superView {
  19. ActivityIndicatorView *indicatorView = [ActivityIndicatorView shareIndicatorView];
  20. [indicatorView startAnimating];
  21. [superView addSubview:indicatorView];
  22. indicatorView.center = superView.center;
  23. }
  24. + (void)dismiss {
  25. ActivityIndicatorView *indicatorView = [ActivityIndicatorView shareIndicatorView];
  26. [indicatorView removeFromSuperview];
  27. }
  28. @end