mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-14 02:10:15 +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;
|
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
|
- (void)layout
|
||||||
{
|
{
|
||||||
[super 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));
|
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
|
#endif
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -58,7 +58,9 @@
|
|||||||
|
|
||||||
// intercepted due to not being supported by ASCollectionView (prevent bugs caused by usage)
|
// intercepted due to not being supported by ASCollectionView (prevent bugs caused by usage)
|
||||||
selector == @selector(collectionView:canMoveItemAtIndexPath:) ||
|
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];
|
_layoutInspector = [[MosaicCollectionViewLayoutInspector alloc] init];
|
||||||
|
|
||||||
_collectionView = [[ASCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout asyncDataFetching:YES];
|
_collectionView = [[ASCollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||||
_collectionView.asyncDataSource = self;
|
_collectionView.asyncDataSource = self;
|
||||||
_collectionView.asyncDelegate = self;
|
_collectionView.asyncDelegate = self;
|
||||||
_collectionView.layoutInspector = _layoutInspector;
|
_collectionView.layoutInspector = _layoutInspector;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user