mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own. (#2754)
* [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own. This also moves the @package definition of the instance variable to +FrameworkPrivate instead of Internal.h, because Internal.h should ideally not be used outside of the ASDisplayNode file setup. This has greatly reduced the number of imports of Internal.h. * [ASDisplayNode] Add ASDisplayNode+FrameworkSubclasses.h to share __instanceLock__ definition.
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
#import "ASCollectionInternal.h"
|
||||
#import "ASCollectionViewLayoutFacilitatorProtocol.h"
|
||||
#import "ASCollectionNode.h"
|
||||
#import "ASDisplayNodeInternal.h"
|
||||
#import "ASDisplayNode+Subclasses.h"
|
||||
#import "ASDisplayNode+FrameworkPrivate.h"
|
||||
#import "ASEnvironmentInternal.h"
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASCellNode+Internal.h"
|
||||
@@ -228,7 +228,7 @@
|
||||
// and asserting here isn't an option – it is a common pattern for users to clear
|
||||
// the delegate/dataSource in dealloc, which may be running on a background thread.
|
||||
// It is important that we avoid retaining self in this block, so that this method is dealloc-safe.
|
||||
ASCollectionView *view = (ASCollectionView *)_view;
|
||||
ASCollectionView *view = self.view;
|
||||
ASPerformBlockOnMainThread(^{
|
||||
view.asyncDelegate = delegate;
|
||||
});
|
||||
@@ -254,7 +254,7 @@
|
||||
// and asserting here isn't an option – it is a common pattern for users to clear
|
||||
// the delegate/dataSource in dealloc, which may be running on a background thread.
|
||||
// It is important that we avoid retaining self in this block, so that this method is dealloc-safe.
|
||||
ASCollectionView *view = (ASCollectionView *)_view;
|
||||
ASCollectionView *view = self.view;
|
||||
ASPerformBlockOnMainThread(^{
|
||||
view.asyncDataSource = dataSource;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user