mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
adds convenience methods to return a vertical and horizontal stack spec
This commit is contained in:
@@ -57,4 +57,14 @@
|
||||
*/
|
||||
+ (instancetype)stackLayoutSpecWithDirection:(ASStackLayoutDirection)direction spacing:(CGFloat)spacing justifyContent:(ASStackLayoutJustifyContent)justifyContent alignItems:(ASStackLayoutAlignItems)alignItems children:(NSArray *)children;
|
||||
|
||||
/**
|
||||
* @return A stack layout spec with direction of ASStackLayoutDirectionVertical
|
||||
**/
|
||||
+ (instancetype)verticalStackLayoutSpec;
|
||||
|
||||
/**
|
||||
* @return A stack layout spec with direction of ASStackLayoutDirectionHorizontal
|
||||
**/
|
||||
+ (instancetype)horizontalStackLayoutSpec;
|
||||
|
||||
@end
|
||||
|
||||
@@ -38,6 +38,20 @@
|
||||
return [[self alloc] initWithDirection:direction spacing:spacing justifyContent:justifyContent alignItems:alignItems children:children];
|
||||
}
|
||||
|
||||
+ (instancetype)verticalStackLayoutSpec
|
||||
{
|
||||
ASStackLayoutSpec *stackLayoutSpec = [[self alloc] init];
|
||||
stackLayoutSpec.direction = ASStackLayoutDirectionVertical;
|
||||
return stackLayoutSpec;
|
||||
}
|
||||
|
||||
+ (instancetype)horizontalStackLayoutSpec
|
||||
{
|
||||
ASStackLayoutSpec *stackLayoutSpec = [[self alloc] init];
|
||||
stackLayoutSpec.direction = ASStackLayoutDirectionHorizontal;
|
||||
return stackLayoutSpec;
|
||||
}
|
||||
|
||||
- (instancetype)initWithDirection:(ASStackLayoutDirection)direction spacing:(CGFloat)spacing justifyContent:(ASStackLayoutJustifyContent)justifyContent alignItems:(ASStackLayoutAlignItems)alignItems children:(NSArray *)children
|
||||
{
|
||||
if (!(self = [super init])) {
|
||||
|
||||
Reference in New Issue
Block a user