diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index 6a156e98f4..f36aceb25c 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -300,7 +300,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) _contentsScaleForDisplay = ASScreenScale(); _displaySentinel = [[ASSentinel alloc] init]; - _style = [[[[self class] styleClass] alloc] init]; + _style = [[ASLayoutableStyle alloc] init]; _preferredFrameSize = CGSizeZero; _environmentState = ASEnvironmentStateMakeDefault(); @@ -723,11 +723,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) #pragma mark - Style -+ (Class)styleClass -{ - return [ASLayoutableStyle class]; -} - - (ASLayoutableStyle *)style { ASDN::MutexLocker l(__instanceLock__); diff --git a/AsyncDisplayKit/Layout/ASLayoutSpec.mm b/AsyncDisplayKit/Layout/ASLayoutSpec.mm index 45da2424aa..eed3598711 100644 --- a/AsyncDisplayKit/Layout/ASLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASLayoutSpec.mm @@ -59,7 +59,7 @@ typedef std::map, std::less> ASCh _isMutable = YES; _environmentState = ASEnvironmentStateMakeDefault(); - _style = [[[[self class] styleClass] alloc] init]; + _style = [[ASLayoutableStyle alloc] init]; return self; } @@ -76,11 +76,6 @@ typedef std::map, std::less> ASCh #pragma mark - Style -+ (Class)styleClass -{ - return [ASLayoutableStyle class]; -} - - (ASLayoutableStyle *)style { ASDN::MutexLocker l(__instanceLock__); diff --git a/AsyncDisplayKit/Layout/ASLayoutable.h b/AsyncDisplayKit/Layout/ASLayoutable.h index 15c41ec1c3..563fcfe762 100644 --- a/AsyncDisplayKit/Layout/ASLayoutable.h +++ b/AsyncDisplayKit/Layout/ASLayoutable.h @@ -69,16 +69,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, assign, readonly) ASLayoutableStyle *style; -/** -* @discussion This property contains the ASLayoutableStyle class object by default. Subclasses can use this property to -* return a different size class as needed. For example, if your layoutable would like extend the style object to support -* more properties you might want to set this property to a custom subclass of ASLayoutableStyle. -* -* This property is set only once early in the creation of the layoutable to create the corresponding style object. -*/ -@property (class, nonatomic, readonly) Class styleClass; - - #pragma mark - Calculate layout /**