This commit is contained in:
Yao
2024-12-20 17:49:45 +08:00
parent 86b0363ce1
commit 654d456c7d
7011 changed files with 1705926 additions and 7 deletions

View File

@@ -0,0 +1,45 @@
//
// UICollectionViewLayout+MJRefresh.m
//
// Footer , bug.
// iOS 14 .
// Reference: https://github.com/CoderMJLee/MJRefresh/issues/1552
//
// Created by jiasong on 2021/11/15.
// Copyright © 2021 . All rights reserved.
//
#import "UICollectionViewLayout+MJRefresh.h"
#import "MJRefreshConst.h"
#import "MJRefreshFooter.h"
#import "UIScrollView+MJRefresh.h"
@implementation UICollectionViewLayout (MJRefresh)
+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
MJRefreshExchangeImplementations(self.class, @selector(finalizeCollectionViewUpdates),
self.class, @selector(mj_finalizeCollectionViewUpdates));
});
}
- (void)mj_finalizeCollectionViewUpdates {
[self mj_finalizeCollectionViewUpdates];
__kindof MJRefreshFooter *footer = self.collectionView.mj_footer;
CGSize newSize = self.collectionViewContentSize;
CGSize oldSize = self.collectionView.contentSize;
if (footer != nil && !CGSizeEqualToSize(newSize, oldSize)) {
NSDictionary *changed = @{
NSKeyValueChangeNewKey: [NSValue valueWithCGSize:newSize],
NSKeyValueChangeOldKey: [NSValue valueWithCGSize:oldSize],
};
[CATransaction begin];
[CATransaction setDisableActions:YES];
[footer scrollViewContentSizeDidChange:changed];
[CATransaction commit];
}
}
@end