[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:
appleguy
2016-12-12 19:42:41 -08:00
committed by GitHub
parent ad37ecfa74
commit eeb977e145
25 changed files with 74 additions and 54 deletions

View File

@@ -20,7 +20,6 @@
#import "ASLayoutElement.h"
#import "ASLayoutTransition.h"
#import "ASEnvironment.h"
#import "ASObjectDescriptionHelpers.h"
#import "ASWeakSet.h"
#import "ASDisplayNode+Beta.h"
@@ -57,13 +56,11 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo
#define TIME_DISPLAYNODE_OPS 0 // If you're using this information frequently, try: (DEBUG || PROFILE)
@interface ASDisplayNode () <ASDescriptionProvider, ASDebugDescriptionProvider>
@interface ASDisplayNode ()
{
@package
_ASPendingState *_pendingViewState;
// Protects access to _view, _layer, _pendingViewState, _subnodes, _supernode, and other properties which are accessed from multiple threads.
ASDN::RecursiveMutex __instanceLock__;
UIView *_view;
CALayer *_layer;
@@ -197,10 +194,6 @@ FOUNDATION_EXPORT NSString * const ASRenderingEngineDidDisplayNodesScheduledBefo
/// Bitmask to check which methods an object overrides.
@property (nonatomic, assign, readonly) ASDisplayNodeMethodOverrides methodOverrides;
/// Thread safe way to access the bounds of the node
@property (nonatomic, assign) CGRect threadSafeBounds;
// Swizzle to extend the builtin functionality with custom logic
- (BOOL)__shouldLoadViewOrLayer;