mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 03:09:56 +00:00
Make data locking API optional
This commit is contained in:
parent
69dbbae91c
commit
6588e7b665
@ -143,8 +143,10 @@
|
||||
*/
|
||||
- (ASCellNode *)collectionView:(ASCollectionView *)collectionView nodeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* Indicator to lock the data source for data fetching in asyn mode.
|
||||
* Indicator to lock the data source for data fetching in async mode.
|
||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
||||
* due to the data access in async mode.
|
||||
*
|
||||
@ -153,7 +155,7 @@
|
||||
- (void)collectionViewLockDataSource:(ASCollectionView *)collectionView;
|
||||
|
||||
/**
|
||||
* Indicator to unlock the data source for data fetching in asyn mode.
|
||||
* Indicator to unlock the data source for data fetching in async mode.
|
||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
||||
* due to the data access in async mode.
|
||||
*
|
||||
|
||||
@ -459,7 +459,7 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
|
||||
- (void)dataControllerUnlockDataSource
|
||||
{
|
||||
ASDisplayNodeAssert(self.asyncDataSourceLocked, @"The data source has alredy been unlocked !");
|
||||
ASDisplayNodeAssert(self.asyncDataSourceLocked, @"The data source has already been unlocked");
|
||||
|
||||
self.asyncDataSourceLocked = NO;
|
||||
if ([_asyncDataSource respondsToSelector:@selector(collectionViewUnlockDataSource:)]) {
|
||||
|
||||
@ -145,8 +145,10 @@
|
||||
*/
|
||||
- (ASCellNode *)tableView:(ASTableView *)tableView nodeForRowAtIndexPath:(NSIndexPath *)indexPath;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* Indicator to lock the data source for data fetching in asyn mode.
|
||||
* Indicator to lock the data source for data fetching in async mode.
|
||||
* We should not update the data source until the data source has been unlocked. Otherwise, it will incur data inconsistence or exception
|
||||
* due to the data access in async mode.
|
||||
*
|
||||
|
||||
@ -498,7 +498,7 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
|
||||
- (void)dataControllerLockDataSource
|
||||
{
|
||||
ASDisplayNodeAssert(!self.asyncDataSourceLocked, @"The data source has already been locked !");
|
||||
ASDisplayNodeAssert(!self.asyncDataSourceLocked, @"The data source has already been locked");
|
||||
|
||||
self.asyncDataSourceLocked = YES;
|
||||
|
||||
@ -509,7 +509,7 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
|
||||
- (void)dataControllerUnlockDataSource
|
||||
{
|
||||
ASDisplayNodeAssert(self.asyncDataSourceLocked, @"The data source has already been unlocked !");
|
||||
ASDisplayNodeAssert(self.asyncDataSourceLocked, @"The data source has already been unlocked");
|
||||
|
||||
self.asyncDataSourceLocked = NO;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user