diff --git a/AsyncDisplayKit/ASButtonNode.mm b/AsyncDisplayKit/ASButtonNode.mm index 0bcad75c..fda284ad 100644 --- a/AsyncDisplayKit/ASButtonNode.mm +++ b/AsyncDisplayKit/ASButtonNode.mm @@ -78,7 +78,7 @@ // of the button node to add a touch handler. [_titleNode setLayerBacked:YES]; #endif - _titleNode.style.flexShrink = 1; + _titleNode.style.flexShrink = 1.0; } return _titleNode; } diff --git a/AsyncDisplayKit/ASVideoPlayerNode.mm b/AsyncDisplayKit/ASVideoPlayerNode.mm index 573d38dd..00be9a81 100644 --- a/AsyncDisplayKit/ASVideoPlayerNode.mm +++ b/AsyncDisplayKit/ASVideoPlayerNode.mm @@ -417,7 +417,7 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; { if (_controlFlexGrowSpacerSpec == nil) { _controlFlexGrowSpacerSpec = [[ASStackLayoutSpec alloc] init]; - _controlFlexGrowSpacerSpec.style.flexGrow = 1; + _controlFlexGrowSpacerSpec.style.flexGrow = 1.0; } [_cachedControls setObject:_controlFlexGrowSpacerSpec forKey:@(ASVideoPlayerNodeControlTypeFlexGrowSpacer)]; @@ -733,7 +733,7 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; _scrubberNode.style.preferredSize = CGSizeMake(maxSize.width, 44.0); ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; - spacer.style.flexGrow = 1; + spacer.style.flexGrow = 1.0; ASStackLayoutSpec *controlbarSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal spacing:10.0 diff --git a/examples/ASDKLayoutTransition/Sample/ViewController.m b/examples/ASDKLayoutTransition/Sample/ViewController.m index e3addd46..28f08b25 100644 --- a/examples/ASDKLayoutTransition/Sample/ViewController.m +++ b/examples/ASDKLayoutTransition/Sample/ViewController.m @@ -98,8 +98,8 @@ - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize { ASTextNode *nextTextNode = self.enabled ? self.textNodeTwo : self.textNodeOne; - nextTextNode.style.flexGrow = YES; - nextTextNode.style.flexShrink = YES; + nextTextNode.style.flexGrow = 1.0; + nextTextNode.style.flexShrink = 1.0; ASStackLayoutSpec *horizontalStackLayout = [ASStackLayoutSpec horizontalStackLayoutSpec]; horizontalStackLayout.children = @[nextTextNode]; diff --git a/examples/ASDKTube/Sample/Nodes/VideoContentCell.m b/examples/ASDKTube/Sample/Nodes/VideoContentCell.m index 3459c9a3..ca214c7a 100644 --- a/examples/ASDKTube/Sample/Nodes/VideoContentCell.m +++ b/examples/ASDKTube/Sample/Nodes/VideoContentCell.m @@ -47,7 +47,7 @@ _titleNode = [[ASTextNode alloc] init]; _titleNode.attributedText = [[NSAttributedString alloc] initWithString:_videoModel.title attributes:[self titleNodeStringOptions]]; - _titleNode.style.flexGrow = YES; + _titleNode.style.flexGrow = 1.0; [self addSubnode:_titleNode]; _avatarNode = [[ASNetworkImageNode alloc] init]; @@ -184,7 +184,7 @@ - (ASLayoutSpec*)videoPlayerNodeLayoutSpec:(ASVideoPlayerNode *)videoPlayer forControls:(NSDictionary *)controls forMaximumSize:(CGSize)maxSize { ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; - spacer.style.flexGrow = YES; + spacer.style.flexGrow = 1.0; UIEdgeInsets insets = UIEdgeInsetsMake(10.0, 10.0, 10.0, 10.0); @@ -193,7 +193,7 @@ scrubber.style.height = ASDimensionMakeWithPoints(44.0); scrubber.style.minWidth = ASDimensionMakeWithPoints(0.0); scrubber.style.maxWidth = ASDimensionMakeWithPoints(maxSize.width); - scrubber.style.flexGrow = YES; + scrubber.style.flexGrow = 1.0; } NSArray *controlBarControls = [self controlsForControlBar:controls]; diff --git a/examples/ASDKTube/Sample/ViewController.m b/examples/ASDKTube/Sample/ViewController.m index 19a9213b..537d4421 100644 --- a/examples/ASDKTube/Sample/ViewController.m +++ b/examples/ASDKTube/Sample/ViewController.m @@ -176,7 +176,7 @@ } ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; - spacer.flexGrow = YES; + spacer.flexGrow = 1.0; ASStackLayoutSpec *topBarSpec = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionHorizontal spacing:10.0 diff --git a/examples/ASDKgram/Sample/PhotoCellNode.m b/examples/ASDKgram/Sample/PhotoCellNode.m index 4b22f0be..db5f8b55 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.m +++ b/examples/ASDKgram/Sample/PhotoCellNode.m @@ -113,11 +113,11 @@ - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize { // username / photo location header vertical stack - _photoLocationLabel.style.flexShrink = YES; - _userNameLabel.style.flexShrink = YES; + _photoLocationLabel.style.flexShrink = 1.0; + _userNameLabel.style.flexShrink = 1.0; ASStackLayoutSpec *headerSubStack = [ASStackLayoutSpec verticalStackLayoutSpec]; - headerSubStack.style.flexShrink = YES; + headerSubStack.style.flexShrink = 1.0; if (_photoLocationLabel.attributedText) { [headerSubStack setChildren:@[_userNameLabel, _photoLocationLabel]]; } else { @@ -131,7 +131,7 @@ _photoTimeIntervalSincePostLabel.style.spacingBefore = HORIZONTAL_BUFFER; // to remove double spaces around spacer ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; // FIXME: long locations overflow post time - set max size? - spacer.style.flexGrow = YES; + spacer.style.flexGrow = 1.0; UIEdgeInsets avatarInsets = UIEdgeInsetsMake(HORIZONTAL_BUFFER, 0, HORIZONTAL_BUFFER, HORIZONTAL_BUFFER); ASInsetLayoutSpec *avatarInset = [ASInsetLayoutSpec insetLayoutSpecWithInsets:avatarInsets child:_userAvatarImageView]; diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m index ce09ceeb..d58b6862 100644 --- a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m @@ -70,7 +70,7 @@ - (ASSizeRange)collectionView:(ASCollectionView *)collectionView constrainedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath { - return ASSizeRangeMakeExactSize(CGSizeMake(100, 100)); + return ASSizeRangeMake(CGSizeMake(100, 100)); } @end diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m index 7dbe996d..585c4c35 100644 --- a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m @@ -387,8 +387,8 @@ typedef ASLayoutSpec *(^OverviewDisplayNodeSizeThatFitsBlock)(ASSizeRange constr // If we just would add the childrent to the stack layout the layout would be to tall and run out of the edge of // the node as 50+50+50 = 150 but the parent node is only 100 height. To prevent that we set flexShrink on 2 of the // children to let the stack layout know it should shrink these children in case the layout will run over the edge - childNode2.style.flexShrink = YES; - childNode3.style.flexShrink = YES; + childNode2.style.flexShrink = 1.0; + childNode3.style.flexShrink = 1.0; parentNode = [self parentNodeWithChild:childNode]; parentNode.entryTitle = @"Vertical ASStackLayoutSpec"; @@ -407,7 +407,7 @@ typedef ASLayoutSpec *(^OverviewDisplayNodeSizeThatFitsBlock)(ASSizeRange constr #pragma mark Horizontal ASStackLayoutSpec childNode1 = [ASDisplayNode new]; childNode1.style.preferredSize = CGSizeMake(10.0, 20.0); - childNode1.style.flexGrow = YES; + childNode1.style.flexGrow = 1.0; childNode1.backgroundColor = [UIColor greenColor]; childNode2 = [ASDisplayNode new]; diff --git a/examples/CatDealsCollectionView/Sample/ItemNode.m b/examples/CatDealsCollectionView/Sample/ItemNode.m index 3fb7a393..4ee00143 100644 --- a/examples/CatDealsCollectionView/Sample/ItemNode.m +++ b/examples/CatDealsCollectionView/Sample/ItemNode.m @@ -76,7 +76,7 @@ const CGFloat kSoldOutGBHeight = 50.0; self.titleLabel = [[ASTextNode alloc] init]; self.titleLabel.maximumNumberOfLines = 2; self.titleLabel.style.alignSelf = ASStackLayoutAlignSelfStart; - self.titleLabel.style.flexGrow = YES; + self.titleLabel.style.flexGrow = 1.0; self.titleLabel.layerBacked = YES; self.firstInfoLabel = [[ASTextNode alloc] init]; @@ -110,11 +110,11 @@ const CGFloat kSoldOutGBHeight = 50.0; self.soldOutLabelBackground.style.width = ASDimensionMakeWithFraction(1.0); self.soldOutLabelBackground.style.height = ASDimensionMakeWithPoints(kSoldOutGBHeight); self.soldOutLabelBackground.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.9]; - self.soldOutLabelBackground.style.flexGrow = YES; + self.soldOutLabelBackground.style.flexGrow = 1.0; self.soldOutLabelBackground.layerBacked = YES; self.soldOutOverlay = [[ASDisplayNode alloc] init]; - self.soldOutOverlay.style.flexGrow = YES; + self.soldOutOverlay.style.flexGrow = 1.0; self.soldOutOverlay.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5]; self.soldOutOverlay.layerBacked = YES; @@ -257,13 +257,13 @@ const CGFloat kSoldOutGBHeight = 50.0; UIEdgeInsets textInsets = UIEdgeInsetsMake(kInsetTop, kInsetHorizontal, kInsetBottom, kInsetHorizontal); ASLayoutSpec *verticalSpacer = [[ASLayoutSpec alloc] init]; - verticalSpacer.style.flexGrow = YES; + verticalSpacer.style.flexGrow = 1.0; ASLayoutSpec *horizontalSpacer1 = [[ASLayoutSpec alloc] init]; - horizontalSpacer1.style.flexGrow = YES; + horizontalSpacer1.style.flexGrow = 1.0; ASLayoutSpec *horizontalSpacer2 = [[ASLayoutSpec alloc] init]; - horizontalSpacer2.style.flexGrow = YES; + horizontalSpacer2.style.flexGrow = 1.0; NSArray *info1Children = @[self.firstInfoLabel, self.distanceLabel, horizontalSpacer1, self.originalPriceLabel]; NSArray *info2Children = @[self.secondInfoLabel, horizontalSpacer2, self.finalPriceLabel]; @@ -279,7 +279,7 @@ const CGFloat kSoldOutGBHeight = 50.0; ASStackLayoutSpec *textStack = [ASStackLayoutSpec stackLayoutSpecWithDirection:ASStackLayoutDirectionVertical spacing:0.0 justifyContent:ASStackLayoutJustifyContentEnd alignItems:ASStackLayoutAlignItemsStretch children:@[self.titleLabel, verticalSpacer, info1Stack, info2Stack]]; ASInsetLayoutSpec *textWrapper = [ASInsetLayoutSpec insetLayoutSpecWithInsets:textInsets child:textStack]; - textWrapper.style.flexGrow = YES; + textWrapper.style.flexGrow = 1.0; return textWrapper; } @@ -294,7 +294,7 @@ const CGFloat kSoldOutGBHeight = 50.0; ASAbsoluteLayoutSpec *badgePosition = [ASAbsoluteLayoutSpec absoluteLayoutSpecWithChildren:@[self.badge]]; ASOverlayLayoutSpec *badgeOverImage = [ASOverlayLayoutSpec overlayLayoutSpecWithChild:imagePlace overlay:badgePosition]; - badgeOverImage.style.flexGrow = YES; + badgeOverImage.style.flexGrow = 1.0; return badgeOverImage; } diff --git a/examples/Kittens/Sample/KittenNode.mm b/examples/Kittens/Sample/KittenNode.mm index 2313338e..67e586b4 100644 --- a/examples/Kittens/Sample/KittenNode.mm +++ b/examples/Kittens/Sample/KittenNode.mm @@ -148,7 +148,7 @@ static const CGFloat kInnerPadding = 10.0f; _imageNode.style.preferredSize = imageSize; // Shrink the text node in case the image + text gonna be too wide - _textNode.style.flexShrink = YES; + _textNode.style.flexShrink = 1.0; // Configure stack ASStackLayoutSpec *stackLayoutSpec = diff --git a/examples/SocialAppLayout/Sample/PostNode.m b/examples/SocialAppLayout/Sample/PostNode.m index 945635c7..3206b00d 100644 --- a/examples/SocialAppLayout/Sample/PostNode.m +++ b/examples/SocialAppLayout/Sample/PostNode.m @@ -59,7 +59,7 @@ // Username node _usernameNode = [[ASTextNode alloc] init]; _usernameNode.attributedText = [[NSAttributedString alloc] initWithString:_post.username attributes:[TextStyles usernameStyle]]; - _usernameNode.style.flexShrink = YES; //if name and username don't fit to cell width, allow username shrink + _usernameNode.style.flexShrink = 1.0; //if name and username don't fit to cell width, allow username shrink _usernameNode.truncationMode = NSLineBreakByTruncatingTail; _usernameNode.maximumNumberOfLines = 1; [self addSubnode:_usernameNode]; @@ -210,11 +210,11 @@ { // Flexible spacer between username and time ASLayoutSpec *spacer = [[ASLayoutSpec alloc] init]; - spacer.style.flexGrow = YES; + spacer.style.flexGrow = 1.0; // NOTE: This inset is not actually required by the layout, but is an example of the upward propogation of layoutable // properties. Specifically, .flexGrow from the child is transferred to the inset spec so they can expand together. - // Without this capability, it would be required to set insetSpacer.flexGrow = YES; + // Without this capability, it would be required to set insetSpacer.flexGrow = 1.0; ASInsetLayoutSpec *insetSpacer = [ASInsetLayoutSpec insetLayoutSpecWithInsets:UIEdgeInsetsMake(0, 0, 0, 0) @@ -279,7 +279,7 @@ justifyContent:ASStackLayoutJustifyContentStart alignItems:ASStackLayoutAlignItemsStretch children:mainStackContent]; - contentSpec.style.flexShrink = YES; + contentSpec.style.flexShrink = 1.0; // Horizontal spec for avatar ASStackLayoutSpec *avatarContentSpec = diff --git a/examples_extra/ASTraitCollection/Sample/KittenNode.m b/examples_extra/ASTraitCollection/Sample/KittenNode.m index 70cb9de1..6643f03b 100644 --- a/examples_extra/ASTraitCollection/Sample/KittenNode.m +++ b/examples_extra/ASTraitCollection/Sample/KittenNode.m @@ -91,8 +91,8 @@ static const CGFloat kInnerPadding = 10.0f; _textNode = [[ASTextNode alloc] init]; _textNode.attributedText = [[NSAttributedString alloc] initWithString:[self kittyIpsum] attributes:[self textStyle]]; - _textNode.style.flexShrink = YES; - _textNode.style.flexGrow = YES; + _textNode.style.flexShrink = 1.0; + _textNode.style.flexGrow = 1.0; [self addSubnode:_textNode]; return self; diff --git a/examples_extra/ASTraitCollection/Sample/OverrideViewController.m b/examples_extra/ASTraitCollection/Sample/OverrideViewController.m index 1148c907..7ca5f877 100644 --- a/examples_extra/ASTraitCollection/Sample/OverrideViewController.m +++ b/examples_extra/ASTraitCollection/Sample/OverrideViewController.m @@ -33,8 +33,8 @@ static NSString *kLinkAttributeName = @"PlaceKittenNodeLinkAttributeName"; return nil; _textNode = [[ASTextNode alloc] init]; - _textNode.style.flexGrow = YES; - _textNode.style.flexShrink = YES; + _textNode.style.flexGrow = 1.0; + _textNode.style.flexShrink = 1.0; _textNode.maximumNumberOfLines = 3; [self addSubnode:_textNode]; diff --git a/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift b/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift index a6611b0a..8ce79266 100644 --- a/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift @@ -33,10 +33,10 @@ final class DemoCellNode: ASCellNode { override func layoutSpecThatFits(constrainedSize: ASSizeRange) -> ASLayoutSpec { let specA = ASRatioLayoutSpec(ratio: 1, child: childA) specA.style.flexBasis = ASDimensionMakeWithPoints(1) - specA.style.flexGrow = 1 + specA.style.flexGrow = 1.0 let specB = ASRatioLayoutSpec(ratio: 1, child: childB) specB.style.flexBasis = ASDimensionMakeWithPoints(1) - specB.style.flexGrow = 1 + specB.style.flexGrow = 1.0 let children = state.isReverse ? [ specB, specA ] : [ specA, specB ] let direction: ASStackLayoutDirection = state.isVertical ? .Vertical : .Horizontal return ASStackLayoutSpec(direction: direction, diff --git a/examples_extra/SynchronousKittens/Sample/KittenNode.mm b/examples_extra/SynchronousKittens/Sample/KittenNode.mm index 8c8ba288..87e2c40f 100644 --- a/examples_extra/SynchronousKittens/Sample/KittenNode.mm +++ b/examples_extra/SynchronousKittens/Sample/KittenNode.mm @@ -143,7 +143,7 @@ static const CGFloat kInnerPadding = 10.0f; CGSize imageSize = _isImageEnlarged ? CGSizeMake(2.0 * kImageSize, 2.0 * kImageSize) : CGSizeMake(kImageSize, kImageSize); _imageNode.size = ASRelativeSizeRangeMakeWithExactCGSize(imageSize); - _textNode.flexShrink = YES; + _textNode.flexShrink = 1.0; ASStackLayoutSpec *stackSpec = [[ASStackLayoutSpec alloc] init]; stackSpec.direction = ASStackLayoutDirectionHorizontal; diff --git a/examples_extra/VideoTableView/Sample/NicCageNode.mm b/examples_extra/VideoTableView/Sample/NicCageNode.mm index 6e3d8ea4..7110143e 100644 --- a/examples_extra/VideoTableView/Sample/NicCageNode.mm +++ b/examples_extra/VideoTableView/Sample/NicCageNode.mm @@ -168,7 +168,7 @@ static const CGFloat kInnerPadding = 10.0f; CGSize videoNodeSize = _isImageEnlarged ? CGSizeMake(2.0 * kImageSize, 2.0 * kImageSize) : CGSizeMake(kImageSize, kImageSize); _videoNode.size = ASRelativeSizeRangeMakeWithExactCGSize(videoNodeSize); - _textNode.flexShrink = YES; + _textNode.flexShrink = 1.0; ASStackLayoutSpec *stackSpec = [[ASStackLayoutSpec alloc] init]; stackSpec.direction = ASStackLayoutDirectionHorizontal;