Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit fa4308b

Browse files
author
Scott Goodson
committed
Merge branch 'master' into CollectionRefactoring
2 parents 9944305 + c020dcf commit fa4308b

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

AsyncDisplayKit.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,10 @@
15251525
058D09B9195D04C000B7D73C /* Frameworks */,
15261526
058D09BA195D04C000B7D73C /* Resources */,
15271527
3B9D88CDF51B429C8409E4B6 /* Copy Pods Resources */,
1528+
<<<<<<< HEAD
1529+
=======
1530+
5ADEA7587189397768F2B36C /* Embed Pods Frameworks */,
1531+
>>>>>>> master
15281532
);
15291533
buildRules = (
15301534
);
@@ -1654,6 +1658,21 @@
16541658
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests-resources.sh\"\n";
16551659
showEnvVarsInLog = 0;
16561660
};
1661+
5ADEA7587189397768F2B36C /* Embed Pods Frameworks */ = {
1662+
isa = PBXShellScriptBuildPhase;
1663+
buildActionMask = 2147483647;
1664+
files = (
1665+
);
1666+
inputPaths = (
1667+
);
1668+
name = "Embed Pods Frameworks";
1669+
outputPaths = (
1670+
);
1671+
runOnlyForDeploymentPostprocessing = 0;
1672+
shellPath = /bin/sh;
1673+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests-frameworks.sh\"\n";
1674+
showEnvVarsInLog = 0;
1675+
};
16571676
/* End PBXShellScriptBuildPhase section */
16581677

16591678
/* Begin PBXSourcesBuildPhase section */

AsyncDisplayKit/ASButtonNode.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ typedef enum : NSUInteger {
3131
*/
3232
@property (nonatomic, assign) BOOL laysOutHorizontally;
3333

34+
/** Horizontally align content (text or image).
35+
Defaults to ASAlignmentMiddle.
36+
*/
37+
@property (nonatomic, assign) ASHorizontalAlignment contentHorizontalAlignment;
38+
39+
/** Vertically align content (text or image).
40+
Defaults to ASAlignmentCenter.
41+
*/
42+
@property (nonatomic, assign) ASVerticalAlignment contentVerticalAlignment;
43+
44+
3445
- (NSAttributedString *)attributedTitleForState:(ASButtonState)state;
3546
- (void)setAttributedTitle:(NSAttributedString *)title forState:(ASButtonState)state;
3647

AsyncDisplayKit/ASButtonNode.mm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ - (instancetype)init
3939
_titleNode = [[ASTextNode alloc] init];
4040
_imageNode = [[ASImageNode alloc] init];
4141

42+
_contentHorizontalAlignment = ASAlignmentMiddle;
43+
_contentVerticalAlignment = ASAlignmentCenter;
44+
4245
[self addSubnode:_titleNode];
4346
[self addSubnode:_imageNode];
4447

@@ -195,8 +198,8 @@ - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
195198
ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init];
196199
stack.direction = self.laysOutHorizontally ? ASStackLayoutDirectionHorizontal : ASStackLayoutDirectionVertical;
197200
stack.spacing = self.contentSpacing;
198-
stack.justifyContent = ASStackLayoutJustifyContentCenter;
199-
stack.alignItems = ASStackLayoutAlignItemsCenter;
201+
stack.horizontalAlignment = _contentHorizontalAlignment;
202+
stack.verticalAlignment = _contentVerticalAlignment;
200203

201204
NSMutableArray *children = [[NSMutableArray alloc] initWithCapacity:2];
202205
if (self.imageNode.image) {

0 commit comments

Comments
 (0)