UASAdView.m 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // UASAdView.m
  3. // shiku_im
  4. //
  5. // Created by ime on 2018/8/13.
  6. //
  7. #import "UASAdView.h"
  8. #import "UASLoadVC.h"
  9. static UASAdView *adView = nil;
  10. @implementation UASAdView
  11. +(instancetype)startLoad{
  12. adView = [[UASAdView alloc]initWithFrame:[UIScreen mainScreen].bounds];
  13. UASLoadVC *loadVC = [UASLoadVC new];
  14. loadVC.aniCompleted = ^{
  15. [adView loadComplete];
  16. };
  17. adView.rootViewController = loadVC;
  18. [adView makeKeyAndVisible];
  19. return adView;
  20. }
  21. -(void)loadComplete{
  22. [UIView animateKeyframesWithDuration:0.6f delay:0.0f options:0 animations:^{
  23. self.transform = CGAffineTransformMakeScale(1.2f, 1.2f);
  24. self.alpha = 0;
  25. } completion:^(BOOL finished) {
  26. if(self.loadCompleted) {
  27. self.loadCompleted();
  28. }
  29. [self resignKeyWindow];
  30. adView = nil;
  31. }];
  32. }
  33. -(void)dealloc{
  34. }
  35. @end