diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 531c1c7a6f..03faea2050 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -310,8 +310,6 @@ ACF6ED251B17843500DA7C62 /* ASLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */; }; ACF6ED261B17843500DA7C62 /* ASLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED0D1B17843500DA7C62 /* ASLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; ACF6ED271B17843500DA7C62 /* ASLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED0E1B17843500DA7C62 /* ASLayoutNode.mm */; }; - ACF6ED281B17843500DA7C62 /* ASLayoutNodeSize.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED0F1B17843500DA7C62 /* ASLayoutNodeSize.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ACF6ED291B17843500DA7C62 /* ASLayoutNodeSize.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED101B17843500DA7C62 /* ASLayoutNodeSize.mm */; }; ACF6ED2A1B17843500DA7C62 /* ASLayoutNodeSubclass.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED111B17843500DA7C62 /* ASLayoutNodeSubclass.h */; settings = {ATTRIBUTES = (Public, ); }; }; ACF6ED2B1B17843500DA7C62 /* ASOverlayLayoutNode.h in Headers */ = {isa = PBXBuildFile; fileRef = ACF6ED121B17843500DA7C62 /* ASOverlayLayoutNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; ACF6ED2C1B17843500DA7C62 /* ASOverlayLayoutNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED131B17843500DA7C62 /* ASOverlayLayoutNode.mm */; }; @@ -410,13 +408,13 @@ 058D09D5195D050800B7D73C /* ASControlNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASControlNode.h; sourceTree = ""; }; 058D09D6195D050800B7D73C /* ASControlNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASControlNode.m; sourceTree = ""; }; 058D09D7195D050800B7D73C /* ASControlNode+Subclasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASControlNode+Subclasses.h"; sourceTree = ""; }; - 058D09D8195D050800B7D73C /* ASDisplayNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDisplayNode.h; sourceTree = ""; }; - 058D09D9195D050800B7D73C /* ASDisplayNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASDisplayNode.mm; sourceTree = ""; }; + 058D09D8195D050800B7D73C /* ASDisplayNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ASDisplayNode.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 058D09D9195D050800B7D73C /* ASDisplayNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASDisplayNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 058D09DA195D050800B7D73C /* ASDisplayNode+Subclasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "ASDisplayNode+Subclasses.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 058D09DB195D050800B7D73C /* ASDisplayNodeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDisplayNodeExtras.h; sourceTree = ""; }; 058D09DC195D050800B7D73C /* ASDisplayNodeExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDisplayNodeExtras.mm; sourceTree = ""; }; 058D09DD195D050800B7D73C /* ASImageNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASImageNode.h; sourceTree = ""; }; - 058D09DE195D050800B7D73C /* ASImageNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASImageNode.mm; sourceTree = ""; }; + 058D09DE195D050800B7D73C /* ASImageNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASImageNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 058D09DF195D050800B7D73C /* ASTextNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTextNode.h; sourceTree = ""; }; 058D09E0195D050800B7D73C /* ASTextNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASTextNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 058D09E2195D050800B7D73C /* _ASDisplayLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _ASDisplayLayer.h; sourceTree = ""; }; @@ -527,30 +525,28 @@ B35061DE1B010EDF0018CF92 /* AsyncDisplayKit-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AsyncDisplayKit-iOS.h"; sourceTree = ""; }; AC6456071B0A335000CF11B8 /* ASCellNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCellNode.mm; sourceTree = ""; }; ACF6ED011B17843500DA7C62 /* ASBackgroundLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASBackgroundLayoutNode.h; path = AsyncDisplayKit/Layout/ASBackgroundLayoutNode.h; sourceTree = ""; }; - ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASBackgroundLayoutNode.mm; path = AsyncDisplayKit/Layout/ASBackgroundLayoutNode.mm; sourceTree = ""; }; + ACF6ED021B17843500DA7C62 /* ASBackgroundLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASBackgroundLayoutNode.mm; path = AsyncDisplayKit/Layout/ASBackgroundLayoutNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED031B17843500DA7C62 /* ASCenterLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCenterLayoutNode.h; path = AsyncDisplayKit/Layout/ASCenterLayoutNode.h; sourceTree = ""; }; - ACF6ED041B17843500DA7C62 /* ASCenterLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASCenterLayoutNode.mm; path = AsyncDisplayKit/Layout/ASCenterLayoutNode.mm; sourceTree = ""; }; + ACF6ED041B17843500DA7C62 /* ASCenterLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASCenterLayoutNode.mm; path = AsyncDisplayKit/Layout/ASCenterLayoutNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED051B17843500DA7C62 /* ASCompositeNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCompositeNode.h; path = AsyncDisplayKit/Layout/ASCompositeNode.h; sourceTree = ""; }; ACF6ED061B17843500DA7C62 /* ASCompositeNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASCompositeNode.mm; path = AsyncDisplayKit/Layout/ASCompositeNode.mm; sourceTree = ""; }; ACF6ED071B17843500DA7C62 /* ASDimension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASDimension.h; path = AsyncDisplayKit/Layout/ASDimension.h; sourceTree = ""; }; ACF6ED081B17843500DA7C62 /* ASDimension.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASDimension.mm; path = AsyncDisplayKit/Layout/ASDimension.mm; sourceTree = ""; }; ACF6ED091B17843500DA7C62 /* ASInsetLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASInsetLayoutNode.h; path = AsyncDisplayKit/Layout/ASInsetLayoutNode.h; sourceTree = ""; }; - ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASInsetLayoutNode.mm; path = AsyncDisplayKit/Layout/ASInsetLayoutNode.mm; sourceTree = ""; }; + ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASInsetLayoutNode.mm; path = AsyncDisplayKit/Layout/ASInsetLayoutNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED0B1B17843500DA7C62 /* ASLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayout.h; path = AsyncDisplayKit/Layout/ASLayout.h; sourceTree = ""; }; ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASLayout.mm; path = AsyncDisplayKit/Layout/ASLayout.mm; sourceTree = ""; }; ACF6ED0D1B17843500DA7C62 /* ASLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutNode.h; path = AsyncDisplayKit/Layout/ASLayoutNode.h; sourceTree = ""; }; - ACF6ED0E1B17843500DA7C62 /* ASLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASLayoutNode.mm; path = AsyncDisplayKit/Layout/ASLayoutNode.mm; sourceTree = ""; }; - ACF6ED0F1B17843500DA7C62 /* ASLayoutNodeSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutNodeSize.h; path = AsyncDisplayKit/Layout/ASLayoutNodeSize.h; sourceTree = ""; }; - ACF6ED101B17843500DA7C62 /* ASLayoutNodeSize.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASLayoutNodeSize.mm; path = AsyncDisplayKit/Layout/ASLayoutNodeSize.mm; sourceTree = ""; }; + ACF6ED0E1B17843500DA7C62 /* ASLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASLayoutNode.mm; path = AsyncDisplayKit/Layout/ASLayoutNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED111B17843500DA7C62 /* ASLayoutNodeSubclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASLayoutNodeSubclass.h; path = AsyncDisplayKit/Layout/ASLayoutNodeSubclass.h; sourceTree = ""; }; ACF6ED121B17843500DA7C62 /* ASOverlayLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASOverlayLayoutNode.h; path = AsyncDisplayKit/Layout/ASOverlayLayoutNode.h; sourceTree = ""; }; - ACF6ED131B17843500DA7C62 /* ASOverlayLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASOverlayLayoutNode.mm; path = AsyncDisplayKit/Layout/ASOverlayLayoutNode.mm; sourceTree = ""; }; + ACF6ED131B17843500DA7C62 /* ASOverlayLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASOverlayLayoutNode.mm; path = AsyncDisplayKit/Layout/ASOverlayLayoutNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED141B17843500DA7C62 /* ASRatioLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRatioLayoutNode.h; path = AsyncDisplayKit/Layout/ASRatioLayoutNode.h; sourceTree = ""; }; - ACF6ED151B17843500DA7C62 /* ASRatioLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASRatioLayoutNode.mm; path = AsyncDisplayKit/Layout/ASRatioLayoutNode.mm; sourceTree = ""; }; + ACF6ED151B17843500DA7C62 /* ASRatioLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASRatioLayoutNode.mm; path = AsyncDisplayKit/Layout/ASRatioLayoutNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED161B17843500DA7C62 /* ASStackLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStackLayoutNode.h; path = AsyncDisplayKit/Layout/ASStackLayoutNode.h; sourceTree = ""; }; ACF6ED171B17843500DA7C62 /* ASStackLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASStackLayoutNode.mm; path = AsyncDisplayKit/Layout/ASStackLayoutNode.mm; sourceTree = ""; }; ACF6ED181B17843500DA7C62 /* ASStaticLayoutNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASStaticLayoutNode.h; path = AsyncDisplayKit/Layout/ASStaticLayoutNode.h; sourceTree = ""; }; - ACF6ED191B17843500DA7C62 /* ASStaticLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASStaticLayoutNode.mm; path = AsyncDisplayKit/Layout/ASStaticLayoutNode.mm; sourceTree = ""; }; + ACF6ED191B17843500DA7C62 /* ASStaticLayoutNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = ASStaticLayoutNode.mm; path = AsyncDisplayKit/Layout/ASStaticLayoutNode.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED431B17847A00DA7C62 /* ASInternalHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASInternalHelpers.h; sourceTree = ""; }; ACF6ED441B17847A00DA7C62 /* ASInternalHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASInternalHelpers.mm; sourceTree = ""; }; ACF6ED451B17847A00DA7C62 /* ASLayoutNodeUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutNodeUtilities.h; sourceTree = ""; }; @@ -558,13 +554,13 @@ ACF6ED471B17847A00DA7C62 /* ASStackPositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackPositionedLayout.h; sourceTree = ""; }; ACF6ED481B17847A00DA7C62 /* ASStackPositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackPositionedLayout.mm; sourceTree = ""; }; ACF6ED491B17847A00DA7C62 /* ASStackUnpositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackUnpositionedLayout.h; sourceTree = ""; }; - ACF6ED4A1B17847A00DA7C62 /* ASStackUnpositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackUnpositionedLayout.mm; sourceTree = ""; }; + ACF6ED4A1B17847A00DA7C62 /* ASStackUnpositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASStackUnpositionedLayout.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; ACF6ED531B178DC700DA7C62 /* ASCenterLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCenterLayoutNodeSnapshotTests.mm; sourceTree = ""; }; ACF6ED541B178DC700DA7C62 /* ASDimensionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDimensionTests.mm; sourceTree = ""; }; ACF6ED551B178DC700DA7C62 /* ASInsetLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASInsetLayoutNodeSnapshotTests.mm; sourceTree = ""; }; ACF6ED561B178DC700DA7C62 /* ASLayoutNodeSizeTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASLayoutNodeSizeTests.mm; sourceTree = ""; }; ACF6ED571B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutNodeSnapshotTestsHelper.h; sourceTree = ""; }; - ACF6ED581B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASLayoutNodeSnapshotTestsHelper.m; sourceTree = ""; }; + ACF6ED581B178DC700DA7C62 /* ASLayoutNodeSnapshotTestsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASLayoutNodeSnapshotTestsHelper.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASOverlayLayoutNodeSnapshotTests.mm; sourceTree = ""; }; ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRatioLayoutNodeSnapshotTests.mm; sourceTree = ""; }; ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutNodeSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackLayoutNodeSnapshotTests.mm; sourceTree = ""; }; @@ -933,8 +929,6 @@ ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */, ACF6ED0D1B17843500DA7C62 /* ASLayoutNode.h */, ACF6ED0E1B17843500DA7C62 /* ASLayoutNode.mm */, - ACF6ED0F1B17843500DA7C62 /* ASLayoutNodeSize.h */, - ACF6ED101B17843500DA7C62 /* ASLayoutNodeSize.mm */, ACF6ED111B17843500DA7C62 /* ASLayoutNodeSubclass.h */, ACF6ED121B17843500DA7C62 /* ASOverlayLayoutNode.h */, ACF6ED131B17843500DA7C62 /* ASOverlayLayoutNode.mm */, @@ -977,7 +971,6 @@ ACF6ED241B17843500DA7C62 /* ASLayout.h in Headers */, ACF6ED1E1B17843500DA7C62 /* ASCompositeNode.h in Headers */, ACF6ED2F1B17843500DA7C62 /* ASStackLayoutNode.h in Headers */, - ACF6ED281B17843500DA7C62 /* ASLayoutNodeSize.h in Headers */, ACF6ED1A1B17843500DA7C62 /* ASBackgroundLayoutNode.h in Headers */, 291B63FB1AA53A7A000A71B3 /* ASScrollDirection.h in Headers */, 464052221A3F83C40061C0BA /* ASFlowLayoutController.h in Headers */, @@ -1378,7 +1371,6 @@ 292C59A11A956527007E5DD6 /* ASRangeHandlerPreload.mm in Sources */, 058D0A20195D050800B7D73C /* ASTextNodeWordKerner.m in Sources */, 058D0A1A195D050800B7D73C /* ASHighlightOverlayLayer.mm in Sources */, - ACF6ED291B17843500DA7C62 /* ASLayoutNodeSize.mm in Sources */, 464052231A3F83C40061C0BA /* ASFlowLayoutController.mm in Sources */, 058D0A28195D050800B7D73C /* ASDisplayNode+AsyncDisplay.mm in Sources */, 0587F9BE1A7309ED00AFF0BA /* ASEditableTextNode.mm in Sources */, diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index 5e3ae0fdbb..db96f3c0a2 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -1271,7 +1271,7 @@ static NSInteger incrementIfFound(NSInteger i) { { ASDisplayNodeAssertThreadAffinity(self); ASLayoutNode *layoutNode = [self layoutNodeThatFits:constrainedSize]; - ASLayout *layout = [layoutNode layoutThatFits:{CGSizeZero, constrainedSize} parentSize:constrainedSize]; + ASLayout *layout = [layoutNode computeLayoutThatFits:{CGSizeZero, constrainedSize}]; return layout; } diff --git a/AsyncDisplayKit/AsyncDisplayKit.h b/AsyncDisplayKit/AsyncDisplayKit.h index c2638a8ef3..d32c0d6789 100644 --- a/AsyncDisplayKit/AsyncDisplayKit.h +++ b/AsyncDisplayKit/AsyncDisplayKit.h @@ -27,7 +27,6 @@ #import #import -#import #import #import #import diff --git a/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.h b/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.h index 6a4f2374bb..4712fe06ee 100644 --- a/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.h +++ b/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.h @@ -20,7 +20,6 @@ returns nil. @param background A child that is laid out behind it. May be nil, in which case the background is omitted. */ -+ (instancetype)newWithNode:(ASLayoutNode *)node - background:(ASLayoutNode *)background; ++ (instancetype)newWithNode:(ASLayoutNode *)node background:(ASLayoutNode *)background; @end diff --git a/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.mm b/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.mm index bb090d8006..301ec7b199 100644 --- a/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASBackgroundLayoutNode.mm @@ -24,19 +24,18 @@ @implementation ASBackgroundLayoutNode -+ (instancetype)newWithNode:(ASLayoutNode *)node - background:(ASLayoutNode *)background ++ (instancetype)newWithNode:(ASLayoutNode *)node background:(ASLayoutNode *)background { if (node == nil) { return nil; } - ASBackgroundLayoutNode *n = [super newWithSize:{}]; + ASBackgroundLayoutNode *n = [super new]; n->_node = node; n->_background = background; return n; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size ++ (instancetype)new { ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); } @@ -45,20 +44,13 @@ First layout the contents, then fit the background image. */ - (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize - restrictedToSize:(ASLayoutNodeSize)size - relativeToParentSize:(CGSize)parentSize { - ASDisplayNodeAssert(ASLayoutNodeSizeEqualToNodeSize(size, ASLayoutNodeSizeZero), - @"ASBackgroundLayoutNode only passes size {} to the super class initializer, but received size %@ " - "(node=%@, background=%@)", NSStringFromASLayoutNodeSize(size), _node, _background); - - ASLayout *contentsLayout = [_node layoutThatFits:constrainedSize parentSize:parentSize]; + ASLayout *contentsLayout = [_node computeLayoutThatFits:constrainedSize]; NSMutableArray *children = [NSMutableArray arrayWithCapacity:2]; if (_background) { // Size background to exactly the same size. - ASLayout *backgroundLayout = [_background layoutThatFits:{contentsLayout.size, contentsLayout.size} - parentSize:contentsLayout.size]; + ASLayout *backgroundLayout = [_background computeLayoutThatFits:{contentsLayout.size, contentsLayout.size}]; [children addObject:[ASLayoutChild newWithPosition:{0,0} layout:backgroundLayout]]; } [children addObject:[ASLayoutChild newWithPosition:{0,0} layout:contentsLayout]]; diff --git a/AsyncDisplayKit/Layout/ASCenterLayoutNode.h b/AsyncDisplayKit/Layout/ASCenterLayoutNode.h index 0f9180582f..3f3257029b 100644 --- a/AsyncDisplayKit/Layout/ASCenterLayoutNode.h +++ b/AsyncDisplayKit/Layout/ASCenterLayoutNode.h @@ -38,11 +38,9 @@ typedef NS_OPTIONS(NSUInteger, ASCenterLayoutNodeSizingOptions) { /** @param centeringOptions, see ASCenterLayoutNodeCenteringOptions. @param child The child to center. - @param size The node size or {} for the default which is for the layout to take the maximum space available. */ + (instancetype)newWithCenteringOptions:(ASCenterLayoutNodeCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutNodeSizingOptions)sizingOptions - child:(ASLayoutNode *)child - size:(ASLayoutNodeSize)size; + child:(ASLayoutNode *)child; @end diff --git a/AsyncDisplayKit/Layout/ASCenterLayoutNode.mm b/AsyncDisplayKit/Layout/ASCenterLayoutNode.mm index 60932b63cf..6fe78cfcab 100644 --- a/AsyncDisplayKit/Layout/ASCenterLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASCenterLayoutNode.mm @@ -23,9 +23,8 @@ + (instancetype)newWithCenteringOptions:(ASCenterLayoutNodeCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutNodeSizingOptions)sizingOptions child:(ASLayoutNode *)child - size:(ASLayoutNodeSize)size { - ASCenterLayoutNode *n = [super newWithSize:size]; + ASCenterLayoutNode *n = [super new]; if (n) { n->_centeringOptions = centeringOptions; n->_sizingOptions = sizingOptions; @@ -34,14 +33,16 @@ return n; } ++ (instancetype)new +{ + ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); +} + - (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize { - // If we have a finite size in any direction, pass this so that the child can - // resolve percentages agains it. Otherwise pass kASLayoutNodeParentDimensionUndefined - // as the size will depend on the content CGSize size = { - isinf(constrainedSize.max.width) ? kASLayoutNodeParentDimensionUndefined : constrainedSize.max.width, - isinf(constrainedSize.max.height) ? kASLayoutNodeParentDimensionUndefined : constrainedSize.max.height + constrainedSize.max.width, + constrainedSize.max.height }; // Layout the child @@ -49,7 +50,7 @@ (_centeringOptions & ASCenterLayoutNodeCenteringX) != 0 ? 0 : constrainedSize.min.width, (_centeringOptions & ASCenterLayoutNodeCenteringY) != 0 ? 0 : constrainedSize.min.height, }; - ASLayout *childLayout = [_child layoutThatFits:ASSizeRangeMake(minChildSize, constrainedSize.max) parentSize:size]; + ASLayout *childLayout = [_child computeLayoutThatFits:ASSizeRangeMake(minChildSize, constrainedSize.max)]; // If we have an undetermined height or width, use the child size to define the layout // size diff --git a/AsyncDisplayKit/Layout/ASCompositeNode.h b/AsyncDisplayKit/Layout/ASCompositeNode.h index b749f4d60d..4507f69769 100644 --- a/AsyncDisplayKit/Layout/ASCompositeNode.h +++ b/AsyncDisplayKit/Layout/ASCompositeNode.h @@ -16,7 +16,6 @@ @property (nonatomic, readonly) ASDisplayNode *displayNode; -+ (instancetype)newWithSize:(ASLayoutNodeSize)size displayNode:(ASDisplayNode *)displayNode; + (instancetype)newWithDisplayNode:(ASDisplayNode *)displayNode; @end \ No newline at end of file diff --git a/AsyncDisplayKit/Layout/ASCompositeNode.mm b/AsyncDisplayKit/Layout/ASCompositeNode.mm index f95912522d..3c96af52b2 100644 --- a/AsyncDisplayKit/Layout/ASCompositeNode.mm +++ b/AsyncDisplayKit/Layout/ASCompositeNode.mm @@ -18,23 +18,18 @@ @implementation ASCompositeNode + (instancetype)newWithDisplayNode:(ASDisplayNode *)displayNode -{ - return [self newWithSize:ASLayoutNodeSizeZero displayNode:displayNode]; -} - -+ (instancetype)newWithSize:(ASLayoutNodeSize)size displayNode:(ASDisplayNode *)displayNode { if (displayNode == nil) { return nil; } - ASCompositeNode *n = [super newWithSize:size]; + ASCompositeNode *n = [super new]; if (n) { n->_displayNode = displayNode; } return n; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size ++ (instancetype)new { ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); } diff --git a/AsyncDisplayKit/Layout/ASInsetLayoutNode.h b/AsyncDisplayKit/Layout/ASInsetLayoutNode.h index 269b67c58b..826132c4e6 100644 --- a/AsyncDisplayKit/Layout/ASInsetLayoutNode.h +++ b/AsyncDisplayKit/Layout/ASInsetLayoutNode.h @@ -33,7 +33,6 @@ @param insets The amount of space to inset on each side. @param node The wrapped child layout node to inset. If nil, this method returns nil. */ -+ (instancetype)newWithInsets:(UIEdgeInsets)insets - node:(ASLayoutNode *)node; ++ (instancetype)newWithInsets:(UIEdgeInsets)insets node:(ASLayoutNode *)node; @end diff --git a/AsyncDisplayKit/Layout/ASInsetLayoutNode.mm b/AsyncDisplayKit/Layout/ASInsetLayoutNode.mm index 657ada8c7e..89d3d8326b 100644 --- a/AsyncDisplayKit/Layout/ASInsetLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASInsetLayoutNode.mm @@ -43,13 +43,12 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner) @implementation ASInsetLayoutNode -+ (instancetype)newWithInsets:(UIEdgeInsets)insets - node:(ASLayoutNode *)node ++ (instancetype)newWithInsets:(UIEdgeInsets)insets node:(ASLayoutNode *)node { if (node == nil) { return nil; } - ASInsetLayoutNode *n = [super newWithSize:{}]; + ASInsetLayoutNode *n = [super new]; if (n) { n->_insets = insets; n->_node = node; @@ -57,7 +56,7 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner) return n; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size ++ (instancetype)new { ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); } @@ -67,13 +66,7 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner) the child to respect the inset. */ - (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize - restrictedToSize:(ASLayoutNodeSize)size - relativeToParentSize:(CGSize)parentSize { - ASDisplayNodeAssert(ASLayoutNodeSizeEqualToNodeSize(size, ASLayoutNodeSizeZero), - @"ASInsetLayoutNode only passes size {} to the super class initializer, but received size %@ " - "(node=%@)", NSStringFromASLayoutNodeSize(size), _node); - const CGFloat insetsX = (finiteOrZero(_insets.left) + finiteOrZero(_insets.right)); const CGFloat insetsY = (finiteOrZero(_insets.top) + finiteOrZero(_insets.bottom)); @@ -92,21 +85,13 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner) MAX(0, constrainedSize.max.height - insetsY), } }; - const CGSize insetParentSize = { - MAX(0, parentSize.width - insetsX), - MAX(0, parentSize.height - insetsY) - }; - ASLayout *childLayout = [_node layoutThatFits:insetConstrainedSize parentSize:insetParentSize]; + ASLayout *childLayout = [_node computeLayoutThatFits:insetConstrainedSize]; const CGSize computedSize = ASSizeRangeClamp(constrainedSize, { - finite(childLayout.size.width + _insets.left + _insets.right, parentSize.width), - finite(childLayout.size.height + _insets.top + _insets.bottom, parentSize.height), + finite(childLayout.size.width + _insets.left + _insets.right, constrainedSize.max.width), + finite(childLayout.size.height + _insets.top + _insets.bottom, constrainedSize.max.height), }); - ASDisplayNodeAssert(!isnan(computedSize.width) && !isnan(computedSize.height), - @"Inset node computed size is NaN; you may not specify infinite insets against a NaN parent size\n" - "parentSize = %@, insets = %@", NSStringFromCGSize(parentSize), NSStringFromUIEdgeInsets(_insets)); - const CGFloat x = finite(_insets.left, constrainedSize.max.width - (finite(_insets.right, centerInset(constrainedSize.max.width, childLayout.size.width)) + childLayout.size.width)); diff --git a/AsyncDisplayKit/Layout/ASLayoutNode.h b/AsyncDisplayKit/Layout/ASLayoutNode.h index 8d46989fee..2ce0a49cc0 100644 --- a/AsyncDisplayKit/Layout/ASLayoutNode.h +++ b/AsyncDisplayKit/Layout/ASLayoutNode.h @@ -8,17 +8,9 @@ * */ -#import +#import /** A layout node is an immutable object that describes a layout, loosely inspired by React. */ @interface ASLayoutNode : NSObject -/** - @param size A size constraint that should apply to this layout node. Pass {} to specify no size constraint. - - @example A layout node of a square: - [ASLayoutNode newWithSize:{100, 100}] - */ -+ (instancetype)newWithSize:(ASLayoutNodeSize)size; - @end diff --git a/AsyncDisplayKit/Layout/ASLayoutNode.mm b/AsyncDisplayKit/Layout/ASLayoutNode.mm index 7b80790c08..2cd43b03e7 100644 --- a/AsyncDisplayKit/Layout/ASLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASLayoutNode.mm @@ -17,75 +17,10 @@ #import "ASInternalHelpers.h" #import "ASLayout.h" -CGFloat const kASLayoutNodeParentDimensionUndefined = NAN; -CGSize const kASLayoutNodeParentSizeUndefined = {kASLayoutNodeParentDimensionUndefined, kASLayoutNodeParentDimensionUndefined}; - @implementation ASLayoutNode -{ - ASLayoutNodeSize _size; -} - -#if DEBUG -+ (void)initialize -{ - ASDisplayNodeConditionalAssert(self != [ASLayoutNode class], - !ASSubclassOverridesSelector([ASLayoutNode class], self, @selector(layoutThatFits:parentSize:)), - @"%@ overrides -layoutThatFits:parentSize: which is not allowed. Override -computeLayoutThatFits: " - "or -computeLayoutThatFits:restrictedToSize:relativeToParentSize: instead.", - NSStringFromClass(self)); -} -#endif - -+ (instancetype)newWithSize:(ASLayoutNodeSize)size -{ - return [[self alloc] initWithLayoutNodeSize:size]; -} - -+ (instancetype)new -{ - return [self newWithSize:{}]; -} - -- (instancetype)init -{ - ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); -} - -- (instancetype)initWithLayoutNodeSize:(ASLayoutNodeSize)size -{ - if (self = [super init]) { - _size = size; - } - return self; -} #pragma mark - Layout -- (ASLayout *)layoutThatFits:(ASSizeRange)constrainedSize parentSize:(CGSize)parentSize -{ - ASLayout *layout = [self computeLayoutThatFits:constrainedSize - restrictedToSize:_size - relativeToParentSize:parentSize]; - ASDisplayNodeAssert(layout.node == self, @"Layout computed by %@ should return self as node, but returned %@", - [self class], [layout.node class]); - ASSizeRange resolvedRange = ASSizeRangeIntersect(constrainedSize, ASLayoutNodeSizeResolve(_size, parentSize)); - ASDisplayNodeAssert(layout.size.width <= resolvedRange.max.width - && layout.size.width >= resolvedRange.min.width - && layout.size.height <= resolvedRange.max.height - && layout.size.height >= resolvedRange.min.height, - @"Computed size %@ for %@ does not fall within constrained size %@", - NSStringFromCGSize(layout.size), [self class], NSStringFromASSizeRange(resolvedRange)); - return layout; -} - -- (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize - restrictedToSize:(ASLayoutNodeSize)size - relativeToParentSize:(CGSize)parentSize -{ - ASSizeRange resolvedRange = ASSizeRangeIntersect(constrainedSize, ASLayoutNodeSizeResolve(_size, parentSize)); - return [self computeLayoutThatFits:resolvedRange]; -} - - (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize { return [ASLayout newWithNode:self size:constrainedSize.min]; diff --git a/AsyncDisplayKit/Layout/ASLayoutNodeSize.h b/AsyncDisplayKit/Layout/ASLayoutNodeSize.h deleted file mode 100644 index a3010583f9..0000000000 --- a/AsyncDisplayKit/Layout/ASLayoutNodeSize.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -#import -#import - -/** - A struct specifying a layout node's size. Example: - - ASLayoutNodeSize size = { - .width = Percent(0.5), - .maxWidth = 200, - .minHeight = Percent(0.75) - }; - - // - size.description(); - - */ -typedef struct { - ASRelativeDimension width; - ASRelativeDimension height; - - ASRelativeDimension minWidth; - ASRelativeDimension minHeight; - - ASRelativeDimension maxWidth; - ASRelativeDimension maxHeight; -} ASLayoutNodeSize; - -extern ASLayoutNodeSize const ASLayoutNodeSizeZero; - -ASDISPLAYNODE_EXTERN_C_BEGIN - -extern ASLayoutNodeSize ASLayoutNodeSizeMakeWithCGSize(CGSize size); - -extern ASLayoutNodeSize ASLayoutNodeSizeMake(CGFloat width, CGFloat height); - -extern ASSizeRange ASLayoutNodeSizeResolve(ASLayoutNodeSize nodeSize, CGSize parentSize); - -extern BOOL ASLayoutNodeSizeEqualToNodeSize(ASLayoutNodeSize lhs, ASLayoutNodeSize rhs); - -extern NSString *NSStringFromASLayoutNodeSize(ASLayoutNodeSize nodeSize); - -ASDISPLAYNODE_EXTERN_C_END diff --git a/AsyncDisplayKit/Layout/ASLayoutNodeSize.mm b/AsyncDisplayKit/Layout/ASLayoutNodeSize.mm deleted file mode 100644 index ce633d8f73..0000000000 --- a/AsyncDisplayKit/Layout/ASLayoutNodeSize.mm +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ - -#import "ASLayoutNodeSize.h" -#import "ASAssert.h" - -ASLayoutNodeSize const ASLayoutNodeSizeZero = {}; - -ASLayoutNodeSize ASLayoutNodeSizeMakeWithCGSize(CGSize size) -{ - return ASLayoutNodeSizeMake(size.width, size.height); -} - -ASLayoutNodeSize ASLayoutNodeSizeMake(CGFloat width, CGFloat height) -{ - return {ASRelativeDimensionMakeWithPoints(width), ASRelativeDimensionMakeWithPoints(height)}; -} - -ASDISPLAYNODE_INLINE void ASLNSConstrain(CGFloat minVal, CGFloat exactVal, CGFloat maxVal, CGFloat *outMin, CGFloat *outMax) -{ - ASDisplayNodeCAssert(!isnan(minVal), @"minVal must not be NaN"); - ASDisplayNodeCAssert(!isnan(maxVal), @"maxVal must not be NaN"); - // Avoid use of min/max primitives since they're harder to reason - // about in the presence of NaN (in exactVal) - // Follow CSS: min overrides max overrides exact. - - // Begin with the min/max range - *outMin = minVal; - *outMax = maxVal; - if (maxVal <= minVal) { - // min overrides max and exactVal is irrelevant - *outMax = minVal; - return; - } - if (isnan(exactVal)) { - // no exact value, so leave as a min/max range - return; - } - if (exactVal > maxVal) { - // clip to max value - *outMin = maxVal; - } else if (exactVal < minVal) { - // clip to min value - *outMax = minVal; - } else { - // use exact value - *outMin = *outMax = exactVal; - } -} - -ASSizeRange ASLayoutNodeSizeResolve(ASLayoutNodeSize nodeSize, CGSize parentSize) -{ - CGSize resolvedExact = ASRelativeSizeResolveSize(ASRelativeSizeMake(nodeSize.width, nodeSize.height), parentSize, {NAN, NAN}); - CGSize resolvedMin = ASRelativeSizeResolveSize(ASRelativeSizeMake(nodeSize.minWidth, nodeSize.minHeight), parentSize, {0, 0}); - CGSize resolvedMax = ASRelativeSizeResolveSize(ASRelativeSizeMake(nodeSize.maxWidth, nodeSize.maxHeight), parentSize, {INFINITY, INFINITY}); - - CGSize rangeMin, rangeMax; - ASLNSConstrain(resolvedMin.width, resolvedExact.width, resolvedMax.width, &rangeMin.width, &rangeMax.width); - ASLNSConstrain(resolvedMin.height, resolvedExact.height, resolvedMax.height, &rangeMin.height, &rangeMax.height); - return {rangeMin, rangeMax}; -} - -BOOL ASLayoutNodeSizeEqualToNodeSize(ASLayoutNodeSize lhs, ASLayoutNodeSize rhs) -{ - return ASRelativeDimensionEqualToDimension(lhs.width, rhs.width) - && ASRelativeDimensionEqualToDimension(lhs.height, rhs.height) - && ASRelativeDimensionEqualToDimension(lhs.minWidth, rhs.minWidth) - && ASRelativeDimensionEqualToDimension(lhs.minHeight, rhs.minHeight) - && ASRelativeDimensionEqualToDimension(lhs.maxWidth, rhs.maxWidth) - && ASRelativeDimensionEqualToDimension(lhs.maxHeight, rhs.maxHeight); -} - -NSString *NSStringFromASLayoutNodeSize(ASLayoutNodeSize nodeSize) -{ - return [NSString stringWithFormat:@"", - NSStringFromASRelativeSize(ASRelativeSizeMake(nodeSize.width, nodeSize.height)), - NSStringFromASRelativeSize(ASRelativeSizeMake(nodeSize.minWidth, nodeSize.minHeight)), - NSStringFromASRelativeSize(ASRelativeSizeMake(nodeSize.maxWidth, nodeSize.maxHeight))]; -} diff --git a/AsyncDisplayKit/Layout/ASLayoutNodeSubclass.h b/AsyncDisplayKit/Layout/ASLayoutNodeSubclass.h index e23aa0ffad..340d136aee 100644 --- a/AsyncDisplayKit/Layout/ASLayoutNodeSubclass.h +++ b/AsyncDisplayKit/Layout/ASLayoutNodeSubclass.h @@ -13,54 +13,13 @@ @interface ASLayoutNode () -/** A constant that indicates that the parent's size is not yet determined in a given dimension. */ -extern CGFloat const kASLayoutNodeParentDimensionUndefined; - -/** A constant that indicates that the parent's size is not yet determined in either dimension. */ -extern CGSize const kASLayoutNodeParentSizeUndefined; - -/** - Call this on children layout nodes to compute their layouts within your implementation of -computeLayoutThatFits:. - - @warning You may not override this method. Override -computeLayoutThatFits: instead. - - @param constrainedSize Specifies a minimum and maximum size. The receiver must choose a size that is in this range. - @param parentSize The parent layout node's size. If the parent layout node does not have a final size in a given dimension, - then it should be passed as kASLayoutNodeParentDimensionUndefined (for example, if the parent's width - depends on the child's size). - - @return An ASLayout instance defining the layout of the receiver and its children. - */ -- (ASLayout *)layoutThatFits:(ASSizeRange)constrainedSize - parentSize:(CGSize)parentSize; - /** Override this method to compute your node's layout. - @discussion Why do you need to override -computeLayoutThatFits: instead of -layoutThatFits:parentSize:? - The base implementation of -layoutThatFits:parentSize: does the following for you: - 1. First, it uses the parentSize parameter to resolve the node's size (the one passed into -initWithSize:). - 2. Then, it intersects the resolved size with the constrainedSize parameter. If the two don't intersect, - constrainedSize wins. This allows a node to always override its childrens' sizes when computing its layout. - (The analogy for UIView: you might return a certain size from -sizeThatFits:, but a parent view can always override - that size and set your frame to any size.) + @param constrainedSize @param constrainedSize The maximum size the receiver should fit in. - @param constrainedSize A min and max size. This is computed as described in the description. The ASLayout you - return MUST have a size between these two sizes. This is enforced by assertion. + @return An ASLayout instance defining the layout of the receiver and its children. */ - (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize; -/** - ASLayoutNode's implementation of -layoutThatFits:parentSize: calls this method to resolve the node's size - against parentSize, intersect it with constrainedSize, and call -computeLayoutThatFits: with the result. - - In certain advanced cases, you may want to customize this logic. Overriding this method allows you to receive all - three parameters and do the computation yourself. - - @warning Overriding this method should be done VERY rarely. - */ -- (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize - restrictedToSize:(ASLayoutNodeSize)size - relativeToParentSize:(CGSize)parentSize; - @end diff --git a/AsyncDisplayKit/Layout/ASOverlayLayoutNode.mm b/AsyncDisplayKit/Layout/ASOverlayLayoutNode.mm index 22cc7ff8ef..57fb4b3210 100644 --- a/AsyncDisplayKit/Layout/ASOverlayLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASOverlayLayoutNode.mm @@ -21,10 +21,9 @@ ASLayoutNode *_node; } -+ (instancetype)newWithNode:(ASLayoutNode *)node - overlay:(ASLayoutNode *)overlay ++ (instancetype)newWithNode:(ASLayoutNode *)node overlay:(ASLayoutNode *)overlay { - ASOverlayLayoutNode *n = [super newWithSize:{}]; + ASOverlayLayoutNode *n = [super new]; if (n) { ASDisplayNodeAssertNotNil(node, @"Node that will be overlayed on shouldn't be nil"); n->_overlay = overlay; @@ -33,7 +32,7 @@ return n; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size ++ (instancetype)new { ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); } @@ -42,17 +41,11 @@ First layout the contents, then fit the overlay on top of it. */ - (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize - restrictedToSize:(ASLayoutNodeSize)size - relativeToParentSize:(CGSize)parentSize { - ASDisplayNodeAssert(ASLayoutNodeSizeEqualToNodeSize(size, ASLayoutNodeSizeZero), - @"ASOverlayLayoutNode only passes size {} to the super class initializer, but received size %@ " - "(node=%@, overlay=%@)", NSStringFromASLayoutNodeSize(size), _node, _overlay); - - ASLayout *contentsLayout = [_node layoutThatFits:constrainedSize parentSize:parentSize]; + ASLayout *contentsLayout = [_node computeLayoutThatFits:constrainedSize]; NSMutableArray *layoutChildren = [NSMutableArray arrayWithObject:[ASLayoutChild newWithPosition:{0, 0} layout:contentsLayout]]; if (_overlay) { - ASLayout *overlayLayout = [_overlay layoutThatFits:{contentsLayout.size, contentsLayout.size} parentSize:contentsLayout.size]; + ASLayout *overlayLayout = [_overlay computeLayoutThatFits:{contentsLayout.size, contentsLayout.size}]; [layoutChildren addObject:[ASLayoutChild newWithPosition:{0, 0} layout:overlayLayout]]; } diff --git a/AsyncDisplayKit/Layout/ASRatioLayoutNode.h b/AsyncDisplayKit/Layout/ASRatioLayoutNode.h index a5ebee69b5..4536fd3078 100644 --- a/AsyncDisplayKit/Layout/ASRatioLayoutNode.h +++ b/AsyncDisplayKit/Layout/ASRatioLayoutNode.h @@ -30,8 +30,6 @@ **/ @interface ASRatioLayoutNode : ASLayoutNode -+ (instancetype)newWithRatio:(CGFloat)ratio - size:(ASLayoutNodeSize)size - node:(ASLayoutNode *)node; ++ (instancetype)newWithRatio:(CGFloat)ratio node:(ASLayoutNode *)node; @end diff --git a/AsyncDisplayKit/Layout/ASRatioLayoutNode.mm b/AsyncDisplayKit/Layout/ASRatioLayoutNode.mm index 814b12a42e..18b68aae23 100644 --- a/AsyncDisplayKit/Layout/ASRatioLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASRatioLayoutNode.mm @@ -26,16 +26,14 @@ ASLayoutNode *_node; } -+ (instancetype)newWithRatio:(CGFloat)ratio - size:(ASLayoutNodeSize)size - node:(ASLayoutNode *)node ++ (instancetype)newWithRatio:(CGFloat)ratio node:(ASLayoutNode *)node { ASDisplayNodeAssert(ratio > 0, @"Ratio should be strictly positive, but received %f", ratio); if (ratio <= 0) { return nil; } - ASRatioLayoutNode *n = [super newWithSize:size]; + ASRatioLayoutNode *n = [super new]; if (n) { n->_ratio = ratio; n->_node = node; @@ -43,7 +41,7 @@ return n; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size ++ (instancetype)new { ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); } @@ -71,8 +69,7 @@ // If there is no max size in *either* dimension, we can't apply the ratio, so just pass our size range through. const ASSizeRange childRange = (bestSize == sizeOptions.end()) ? constrainedSize : ASSizeRangeMake(*bestSize, *bestSize); - const CGSize parentSize = (bestSize == sizeOptions.end()) ? kASLayoutNodeParentSizeUndefined : *bestSize; - ASLayout *childLayout = [_node layoutThatFits:childRange parentSize:parentSize]; + ASLayout *childLayout = [_node computeLayoutThatFits:childRange]; return [ASLayout newWithNode:self size:childLayout.size children:@[[ASLayoutChild newWithPosition:{0, 0} layout:childLayout]]]; diff --git a/AsyncDisplayKit/Layout/ASStackLayoutNode.h b/AsyncDisplayKit/Layout/ASStackLayoutNode.h index fb6e958436..d86399ccde 100644 --- a/AsyncDisplayKit/Layout/ASStackLayoutNode.h +++ b/AsyncDisplayKit/Layout/ASStackLayoutNode.h @@ -136,12 +136,9 @@ typedef struct { @interface ASStackLayoutNode : ASLayoutNode /** - @param size A size, or {} for the default size. @param style Specifies how children are laid out. @param children Children to be positioned, each is of type ASStackLayoutNodeChild. */ -+ (instancetype)newWithSize:(ASLayoutNodeSize)size - style:(ASStackLayoutNodeStyle)style - children:(NSArray *)children; ++ (instancetype)newWithStyle:(ASStackLayoutNodeStyle)style children:(NSArray *)children; @end diff --git a/AsyncDisplayKit/Layout/ASStackLayoutNode.mm b/AsyncDisplayKit/Layout/ASStackLayoutNode.mm index 4be9667be8..26879f4381 100644 --- a/AsyncDisplayKit/Layout/ASStackLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASStackLayoutNode.mm @@ -99,9 +99,9 @@ std::vector _children; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size style:(ASStackLayoutNodeStyle)style children:(NSArray *)children ++ (instancetype)newWithStyle:(ASStackLayoutNodeStyle)style children:(NSArray *)children { - ASStackLayoutNode *n = [super newWithSize:size]; + ASStackLayoutNode *n = [super new]; if (n) { n->_style = style; n->_children = std::vector(); @@ -114,7 +114,7 @@ return n; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size ++ (instancetype)new { ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); } diff --git a/AsyncDisplayKit/Layout/ASStaticLayoutNode.h b/AsyncDisplayKit/Layout/ASStaticLayoutNode.h index e851a98a7f..2485d97941 100644 --- a/AsyncDisplayKit/Layout/ASStaticLayoutNode.h +++ b/AsyncDisplayKit/Layout/ASStaticLayoutNode.h @@ -39,14 +39,6 @@ @interface ASStaticLayoutNode : ASLayoutNode /** - @param children Children to be positioned at fixed positions, each is of type ASStaticLayoutNodeChild. - */ -+ (instancetype)newWithSize:(ASLayoutNodeSize)size - children:(NSArray *)children; - -/** - Convenience that does not have a size. - @param children Children to be positioned at fixed positions, each is of type ASStaticLayoutNodeChild. */ + (instancetype)newWithChildren:(NSArray *)children; diff --git a/AsyncDisplayKit/Layout/ASStaticLayoutNode.mm b/AsyncDisplayKit/Layout/ASStaticLayoutNode.mm index e761e9631d..aeaea5e4c8 100644 --- a/AsyncDisplayKit/Layout/ASStaticLayoutNode.mm +++ b/AsyncDisplayKit/Layout/ASStaticLayoutNode.mm @@ -39,26 +39,25 @@ NSArray *_children; } -+ (instancetype)newWithSize:(ASLayoutNodeSize)size - children:(NSArray *)children ++ (instancetype)newWithChildren:(NSArray *)children { - ASStaticLayoutNode *n = [super newWithSize:size]; + ASStaticLayoutNode *n = [super new]; if (n) { n->_children = children; } return n; } -+ (instancetype)newWithChildren:(NSArray *)children ++ (instancetype)new { - return [self newWithSize:{} children:children]; + ASDISPLAYNODE_NOT_DESIGNATED_INITIALIZER(); } - (ASLayout *)computeLayoutThatFits:(ASSizeRange)constrainedSize { CGSize size = { - isinf(constrainedSize.max.width) ? kASLayoutNodeParentDimensionUndefined : constrainedSize.max.width, - isinf(constrainedSize.max.height) ? kASLayoutNodeParentDimensionUndefined : constrainedSize.max.height + constrainedSize.max.width, + constrainedSize.max.height }; NSMutableArray *layoutChildren = [NSMutableArray arrayWithCapacity:_children.count]; @@ -69,7 +68,7 @@ }; ASSizeRange childConstraint = ASRelativeSizeRangeResolveSizeRange(child.size, size, {{0,0}, autoMaxSize}); ASLayoutChild *layoutChild = [ASLayoutChild newWithPosition:child.position - layout:[child.node layoutThatFits:childConstraint parentSize: size]]; + layout:[child.node computeLayoutThatFits:childConstraint]]; [layoutChildren addObject:layoutChild]; } diff --git a/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm b/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm index e05e103459..db9d3def6d 100644 --- a/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm +++ b/AsyncDisplayKit/Private/ASStackUnpositionedLayout.mm @@ -18,22 +18,19 @@ /** Sizes the child given the parameters specified, and returns the computed layout. - - @param size the size of the stack layout node. May be undefined in either or both directions. */ static ASLayout *crossChildLayout(const ASStackLayoutNodeChild *child, const ASStackLayoutNodeStyle style, const CGFloat stackMin, const CGFloat stackMax, const CGFloat crossMin, - const CGFloat crossMax, - const CGSize size) + const CGFloat crossMax) { const ASStackLayoutAlignItems alignItems = alignment(child.alignSelf, style.alignItems); // stretched children will have a cross dimension of at least crossMin const CGFloat childCrossMin = alignItems == ASStackLayoutAlignItemsStretch ? crossMin : 0; const ASSizeRange childSizeRange = directionSizeRange(style.direction, stackMin, stackMax, childCrossMin, crossMax); - return [child.node layoutThatFits:childSizeRange parentSize:size]; + return [child.node computeLayoutThatFits:childSizeRange]; } /** @@ -67,11 +64,9 @@ static ASLayout *crossChildLayout(const ASStackLayoutNodeChild *child, @param layouts pre-computed child layouts; modified in-place as needed @param style the layout style of the overall stack layout - @param size the size of the stack layout node. May be undefined in either or both directions. */ static void stretchChildrenAlongCrossDimension(std::vector &layouts, - const ASStackLayoutNodeStyle &style, - const CGSize size) + const ASStackLayoutNodeStyle &style) { // Find the maximum cross dimension size among child layouts const auto it = std::max_element(layouts.begin(), layouts.end(), @@ -90,7 +85,7 @@ static void stretchChildrenAlongCrossDimension(std::vector 0.01) { - l.layout = crossChildLayout(l.child, style, stack, stack, childCrossMax, childCrossMax, size); + l.layout = crossChildLayout(l.child, style, stack, stack, childCrossMax, childCrossMax); } } } @@ -217,8 +212,7 @@ ASDISPLAYNODE_INLINE BOOL useOptimizedFlexing(const std::vector &items, const ASStackLayoutNodeStyle &style, - const ASSizeRange &sizeRange, - const CGSize size) + const ASSizeRange &sizeRange) { for (ASStackUnpositionedItem &item : items) { if (isFlexibleInBothDirections(item.child)) { @@ -227,8 +221,7 @@ static void layoutFlexibleChildrenAtZeroSize(std::vector &items, const ASStackLayoutNodeStyle &style, const ASSizeRange &sizeRange, - const CGSize size, const BOOL useOptimizedFlexing) { const CGFloat stackDimensionSum = computeStackDimensionSum(items, style); @@ -261,7 +252,7 @@ static void flexChildrenAlongStackDimension(std::vector if (flexibleChildren == 0) { // If optimized flexing was used then we have to clean up the unsized children, and lay them out at zero size if (useOptimizedFlexing) { - layoutFlexibleChildrenAtZeroSize(items, style, sizeRange, size); + layoutFlexibleChildrenAtZeroSize(items, style, sizeRange); } return; } @@ -283,8 +274,7 @@ static void flexChildrenAlongStackDimension(std::vector MAX(flexedStackSize, 0), MAX(flexedStackSize, 0), crossDimension(style.direction, sizeRange.min), - crossDimension(style.direction, sizeRange.max), - size); + crossDimension(style.direction, sizeRange.max)); isFirstFlex = NO; } } @@ -313,8 +303,7 @@ static std::vector layoutChildrenAlongUnconstrainedStac ASRelativeDimensionResolve(child.flexBasis, 0, stackDimension(style.direction, size)), ASRelativeDimensionResolve(child.flexBasis, INFINITY, stackDimension(style.direction, size)), minCrossDimension, - maxCrossDimension, - size) + maxCrossDimension) }; } }); @@ -324,11 +313,9 @@ ASStackUnpositionedLayout ASStackUnpositionedLayout::compute(const std::vector