Merge commit '131619de96190415aec89987d4493220c6d0305d'

# Conflicts:
#	Source/ASDisplayNode+Deprecated.h
#	Source/ASDisplayNode.mm
#	Source/ASDisplayNodeExtras.h
#	Source/ASImageNode+AnimatedImage.mm
#	Source/Private/ASSection.h
#	Source/Private/_ASHierarchyChangeSet.mm
This commit is contained in:
Peter
2017-12-25 01:44:19 +04:00
226 changed files with 5506 additions and 1942 deletions

View File

@@ -50,6 +50,7 @@
@property (nonatomic, assign) BOOL usesSynchronousDataLoading;
@property (nonatomic, assign) CGFloat leadingScreensForBatching;
@property (weak, nonatomic) id <ASCollectionViewLayoutInspecting> layoutInspector;
@property (nonatomic, assign) UIEdgeInsets contentInset;
@property (nonatomic, assign) CGPoint contentOffset;
@property (nonatomic, assign) BOOL animatesContentOffset;
@end
@@ -64,6 +65,7 @@
_allowsSelection = YES;
_allowsMultipleSelection = NO;
_inverted = NO;
_contentInset = UIEdgeInsetsZero;
_contentOffset = CGPointZero;
_animatesContentOffset = NO;
}
@@ -182,6 +184,7 @@
if (_pendingState) {
_ASCollectionPendingState *pendingState = _pendingState;
self.pendingState = nil;
view.asyncDelegate = pendingState.delegate;
view.asyncDataSource = pendingState.dataSource;
view.inverted = pendingState.inverted;
@@ -189,7 +192,7 @@
view.allowsMultipleSelection = pendingState.allowsMultipleSelection;
view.usesSynchronousDataLoading = pendingState.usesSynchronousDataLoading;
view.layoutInspector = pendingState.layoutInspector;
self.pendingState = nil;
view.contentInset = pendingState.contentInset;
if (pendingState.rangeMode != ASLayoutRangeModeUnspecified) {
[view.rangeController updateCurrentRangeWithMode:pendingState.rangeMode];
@@ -441,6 +444,25 @@
}
}
- (void)setContentInset:(UIEdgeInsets)contentInset
{
if ([self pendingState]) {
_pendingState.contentInset = contentInset;
} else {
ASDisplayNodeAssert([self isNodeLoaded], @"ASCollectionNode should be loaded if pendingState doesn't exist");
self.view.contentInset = contentInset;
}
}
- (UIEdgeInsets)contentInset
{
if ([self pendingState]) {
return _pendingState.contentInset;
} else {
return self.view.contentInset;
}
}
- (void)setContentOffset:(CGPoint)contentOffset
{
[self setContentOffset:contentOffset animated:NO];
@@ -452,6 +474,7 @@
_pendingState.contentOffset = contentOffset;
_pendingState.animatesContentOffset = animated;
} else {
ASDisplayNodeAssert([self isNodeLoaded], @"ASCollectionNode should be loaded if pendingState doesn't exist");
[self.view setContentOffset:contentOffset animated:animated];
}
}
@@ -754,13 +777,6 @@
[self reloadDataWithCompletion:nil];
}
- (void)reloadDataImmediately
{
ASDisplayNodeAssertMainThread();
[self reloadData];
[self waitUntilAllUpdatesAreProcessed];
}
- (void)relayoutItems
{
ASDisplayNodeAssertMainThread();
@@ -790,6 +806,13 @@
}
}
- (void)invalidateFlowLayoutDelegateMetrics {
ASDisplayNodeAssertMainThread();
if (self.nodeLoaded) {
[self.view invalidateFlowLayoutDelegateMetrics];
}
}
- (void)insertSections:(NSIndexSet *)sections
{
ASDisplayNodeAssertMainThread();