Skip to content

Commit 7ce762d

Browse files
committed
[Demo]Fix keyWindow deprecated in iOS 13
1 parent 877ad81 commit 7ce762d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

MJRefreshExample/Classes/First/MJTempViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ - (void)viewDidLoad {
5353

5454
- (void)contorlSelect:(UISegmentedControl *)control
5555
{
56-
UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
56+
UIWindow *keyWindow = [UIApplication sharedApplication].windows.firstObject;
5757
keyWindow.rootViewController = [keyWindow.rootViewController.storyboard instantiateViewControllerWithIdentifier:[NSString stringWithFormat:@"%zd", control.selectedSegmentIndex]];
5858

5959
if (control.selectedSegmentIndex == 0) {

MJRefreshExample/Classes/Second/MJCollectionViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ - (void)example21
4444
[weakSelf.collectionView.mj_header endRefreshing];
4545
});
4646
}];
47+
self.collectionView.mj_header.isCollectionViewAnimationBug = YES;
4748
[self.collectionView.mj_header beginRefreshing];
4849

4950
// 上拉刷新

0 commit comments

Comments
 (0)