mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-11 00:40:25 +00:00
Prevent calling unsupported UICollectionViewDelegate methods (supplementary view appearance)
This commit is contained in:
parent
0636ec44ed
commit
df9f433353
@ -63,13 +63,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
//- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
|
||||
//{
|
||||
// _viewControllerNode.frame = (CGRect){{0,0}, constrainedSize.max};
|
||||
// NSLog(@"%f %f", constrainedSize.max.width, constrainedSize.max.height);
|
||||
// return [super layoutSpecThatFits:constrainedSize];
|
||||
//}
|
||||
|
||||
- (void)layout
|
||||
{
|
||||
[super layout];
|
||||
|
||||
@ -944,6 +944,16 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
ASDisplayNodeAssert(![self.asyncDataSource respondsToSelector:_cmd], @"%@ is not supported by ASCollectionView - please remove or disable this data source method.", NSStringFromSelector(_cmd));
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView willDisplaySupplementaryView:(UICollectionReusableView *)view forElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
ASDisplayNodeAssert(![self.asyncDataSource respondsToSelector:_cmd], @"%@ is not supported by ASCollectionView - please remove or disable this delegate method.", NSStringFromSelector(_cmd));
|
||||
}
|
||||
|
||||
- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingSupplementaryView:(UICollectionReusableView *)view forElementOfKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
ASDisplayNodeAssert(![self.asyncDataSource respondsToSelector:_cmd], @"%@ is not supported by ASCollectionView - please remove or disable this delegate method.", NSStringFromSelector(_cmd));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
@ -58,7 +58,9 @@
|
||||
|
||||
// intercepted due to not being supported by ASCollectionView (prevent bugs caused by usage)
|
||||
selector == @selector(collectionView:canMoveItemAtIndexPath:) ||
|
||||
selector == @selector(collectionView:moveItemAtIndexPath:toIndexPath:)
|
||||
selector == @selector(collectionView:moveItemAtIndexPath:toIndexPath:) ||
|
||||
selector == @selector(collectionView:willDisplaySupplementaryView:forElementKind:atIndexPath:) ||
|
||||
selector == @selector(collectionView:didEndDisplayingSupplementaryView:forElementOfKind:atIndexPath:)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ static NSUInteger kNumberOfImages = 14;
|
||||
|
||||
_layoutInspector = [[MosaicCollectionViewLayoutInspector alloc] init];
|
||||
|
||||
_collectionView = [[ASCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout asyncDataFetching:YES];
|
||||
_collectionView = [[ASCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.asyncDataSource = self;
|
||||
_collectionView.asyncDelegate = self;
|
||||
_collectionView.layoutInspector = _layoutInspector;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user