mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[Layout] Rename ASLayoutable to ASLayoutElement (#2290)
* [Layout API] Rename ASLayoutable to ASLayoutElement * arg * fix wrapperWithLayoutElement * [Layout API] Rename ASLayoutable to ASLayoutElement * arg * address Michael's comments * Remove ASLayoutValidation files that were deleted on master since this diff was created.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASLayoutable.h>
|
||||
#import <AsyncDisplayKit/ASLayoutElement.h>
|
||||
#import <AsyncDisplayKit/ASAsciiArtBoxCreator.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* A layout spec is an immutable object that describes a layout, loosely inspired by React.
|
||||
*/
|
||||
@interface ASLayoutSpec : NSObject <ASLayoutable>
|
||||
@interface ASLayoutSpec : NSObject <ASLayoutElement>
|
||||
|
||||
/**
|
||||
* Creation of a layout spec should only happen by a user in layoutSpecThatFits:. During that method, a
|
||||
@@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* Parent of the layout spec
|
||||
*/
|
||||
@property (nullable, nonatomic, weak) id<ASLayoutable> parent;
|
||||
@property (nullable, nonatomic, weak) id<ASLayoutElement> parent;
|
||||
|
||||
/**
|
||||
* Adds a child to this layout spec using a default identifier.
|
||||
@@ -45,12 +45,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* setChild:forIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild
|
||||
* property that behind the scenes is calling setChild:forIdentifier:.
|
||||
*/
|
||||
@property (nullable, strong, nonatomic) id<ASLayoutable> child;
|
||||
@property (nullable, strong, nonatomic) id<ASLayoutElement> child;
|
||||
|
||||
/**
|
||||
* Adds childen to this layout spec.
|
||||
*
|
||||
* @param children An array of ASLayoutable children to be added.
|
||||
* @param children An array of ASLayoutElement children to be added.
|
||||
*
|
||||
* @discussion Every ASLayoutSpec must act on at least one child. The ASLayoutSpec base class takes the
|
||||
* reponsibility of holding on to the spec children. Some layout specs, like ASStackLayoutSpec,
|
||||
@@ -58,24 +58,24 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* For good measure, in these layout specs it probably makes sense to define
|
||||
* setChild: and setChild:forIdentifier: methods to do something appropriate or to assert.
|
||||
*/
|
||||
@property (nullable, strong, nonatomic) NSArray<id<ASLayoutable>> *children;
|
||||
@property (nullable, strong, nonatomic) NSArray<id<ASLayoutElement>> *children;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* An ASLayoutSpec subclass that can wrap a ASLayoutable and calculates the layout of the child.
|
||||
* An ASLayoutSpec subclass that can wrap a ASLayoutElement and calculates the layout of the child.
|
||||
*/
|
||||
@interface ASWrapperLayoutSpec : ASLayoutSpec
|
||||
|
||||
/*
|
||||
* Returns an ASWrapperLayoutSpec object with the given layoutable as child
|
||||
* Returns an ASWrapperLayoutSpec object with the given layoutElement as child
|
||||
*/
|
||||
+ (instancetype)wrapperWithLayoutable:(id<ASLayoutable>)layoutable;
|
||||
+ (instancetype)wrapperWithLayoutElement:(id<ASLayoutElement>)layoutElement;
|
||||
|
||||
/*
|
||||
* Returns an ASWrapperLayoutSpec object initialized with the given layoutable as child
|
||||
* Returns an ASWrapperLayoutSpec object initialized with the given layoutElement as child
|
||||
*/
|
||||
- (instancetype)initWithLayoutable:(id<ASLayoutable>)layoutable NS_DESIGNATED_INITIALIZER;;
|
||||
- (instancetype)initWithLayoutElement:(id<ASLayoutElement>)layoutElement NS_DESIGNATED_INITIALIZER;;
|
||||
|
||||
/*
|
||||
* Init not available for ASWrapperLayoutSpec
|
||||
@@ -84,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@end
|
||||
|
||||
@interface ASLayoutSpec (Debugging) <ASLayoutableAsciiArtProtocol>
|
||||
@interface ASLayoutSpec (Debugging) <ASLayoutElementAsciiArtProtocol>
|
||||
/**
|
||||
* Used by other layout specs to create ascii art debug strings
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user