[Layout] Further deprecation steps for preferredFrameSize (#2255)

* Deprecate preferredFrameSize

- Remove all support for preferredFrameSize in ASDK
- preferredFrameSize setter calls through and sets the width and height of the node
- preferredFrameSize getter tries to return a CGSize based on the width and height properties otherwise if this is not possible it throws

* Address comments

* Return CGSizeZero for preferredFrameSize unless width and height are ASDimensionUnitPoints

* Better comment for preferredFrameSize and remove lock in calculateSizeThatFits:
This commit is contained in:
Michael Schneider
2016-09-27 16:07:36 -04:00
committed by Adlai Holler
parent e8f01f082a
commit f574f2c54e
7 changed files with 50 additions and 69 deletions
+1 -13
View File
@@ -510,19 +510,7 @@
if (UIEdgeInsetsEqualToEdgeInsets(UIEdgeInsetsZero, contentEdgeInsets) == NO) {
spec = [ASInsetLayoutSpec insetLayoutSpecWithInsets:contentEdgeInsets child:spec];
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (CGSizeEqualToSize(self.preferredFrameSize, CGSizeZero) == NO) {
#if DEBUG
NSLog(@"Using -[ASDisplayNde preferredFrameSize] is deprecated.");
#endif
stack.style.width = ASDimensionMake(ASDimensionUnitPoints, self.preferredFrameSize.width);
stack.style.height = ASDimensionMake(ASDimensionUnitPoints, self.preferredFrameSize.height);
spec = [ASStaticLayoutSpec staticLayoutSpecWithChildren:@[stack]];
}
#pragma clang diagnostic pop
if (_backgroundImageNode.image) {
spec = [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:spec background:_backgroundImageNode];
}