Ver código fonte

[Demo]Fix `keyWindow` deprecated in iOS 13

Frank 4 anos atrás
pai
commit
7ce762d7a5

+ 1 - 1
MJRefreshExample/Classes/First/MJTempViewController.m

@@ -53,7 +53,7 @@ - (void)viewDidLoad {
 
 - (void)contorlSelect:(UISegmentedControl *)control
 {
-    UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
+    UIWindow *keyWindow = [UIApplication sharedApplication].windows.firstObject;
     keyWindow.rootViewController = [keyWindow.rootViewController.storyboard instantiateViewControllerWithIdentifier:[NSString stringWithFormat:@"%zd", control.selectedSegmentIndex]];
     
     if (control.selectedSegmentIndex == 0) {

+ 1 - 0
MJRefreshExample/Classes/Second/MJCollectionViewController.m

@@ -44,6 +44,7 @@ - (void)example21
             [weakSelf.collectionView.mj_header endRefreshing];
         });
     }];
+    self.collectionView.mj_header.isCollectionViewAnimationBug = YES;
     [self.collectionView.mj_header beginRefreshing];
 
     // 上拉刷新