mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-27 10:32:37 +00:00
Merge pull request #598 from nguyenhuy/wrong_implementsInsetSection
Fix _implementsInsetSection of ASCollectionView being check before the asyncDelegate is set
This commit is contained in:
commit
8da9ddd884
@ -166,8 +166,6 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
_performingBatchUpdates = NO;
|
_performingBatchUpdates = NO;
|
||||||
_batchUpdateBlocks = [NSMutableArray array];
|
_batchUpdateBlocks = [NSMutableArray array];
|
||||||
|
|
||||||
_implementsInsetSection = ([_asyncDelegate respondsToSelector:@selector(collectionView:layout:insetForSectionAtIndex:)] ? 1 : 0);
|
|
||||||
|
|
||||||
[self registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"_ASCollectionViewCell"];
|
[self registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"_ASCollectionViewCell"];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@ -244,10 +242,12 @@ static BOOL _isInterceptedSelector(SEL sel)
|
|||||||
super.delegate = nil;
|
super.delegate = nil;
|
||||||
_asyncDelegate = nil;
|
_asyncDelegate = nil;
|
||||||
_proxyDelegate = nil;
|
_proxyDelegate = nil;
|
||||||
|
_implementsInsetSection = NO;
|
||||||
} else {
|
} else {
|
||||||
_asyncDelegate = asyncDelegate;
|
_asyncDelegate = asyncDelegate;
|
||||||
_proxyDelegate = [[_ASCollectionViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
|
_proxyDelegate = [[_ASCollectionViewProxy alloc] initWithTarget:_asyncDelegate interceptor:self];
|
||||||
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
super.delegate = (id<UICollectionViewDelegate>)_proxyDelegate;
|
||||||
|
_implementsInsetSection = ([_asyncDelegate respondsToSelector:@selector(collectionView:layout:insetForSectionAtIndex:)] ? 1 : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user