Introduce type property to replace layout id check

This commit is contained in:
Levi McCallum
2016-06-08 18:28:21 -07:00
parent a3e8f556a3
commit 7e8d519a9a
5 changed files with 36 additions and 6 deletions

View File

@@ -21,6 +21,11 @@
@class ASLayout;
@class ASLayoutSpec;
typedef NS_ENUM(NSUInteger, ASLayoutableType) {
ASLayoutableTypeLayoutSpec,
ASLayoutableTypeDisplayNode
};
NS_ASSUME_NONNULL_BEGIN
/**
@@ -41,6 +46,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
@protocol ASLayoutable <ASEnvironment, ASStackLayoutable, ASStaticLayoutable, ASLayoutablePrivate, ASLayoutableExtensibility>
@property (nonatomic, readonly) ASLayoutableType layoutableType;
/**
* @abstract Calculate a layout based on given size range.
*
@@ -50,7 +57,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize;
#pragma mark - Layout options from the Layoutable Protocols
#pragma mark - ASStackLayoutable