Improve deprecation situation for 2.0 (#2514)

* Improve deprecations for 2.0

- Add deprecations for node / layoutSpec style properties
- Implement missing methods on ASDisplay from deprecation header
- Cleanup all of the deprecation categories

* Remove DeprecatedProtocolMethods

* Fix "Life without Cocoapods"

* Update comments
This commit is contained in:
Michael Schneider
2016-10-31 16:46:21 -07:00
committed by GitHub
parent f09b92641c
commit 4464b7de60
10 changed files with 95 additions and 65 deletions

View File

@@ -3471,8 +3471,6 @@ static const char *ASDisplayNodeDrawingPriorityKey = "ASDrawingPriority";
#pragma mark - Deprecated
ASLayoutElementStyleForwarding
- (ASLayout *)measureWithSizeRange:(ASSizeRange)constrainedSize
{
return [self layoutThatFits:constrainedSize parentSize:constrainedSize.max];
@@ -3642,11 +3640,6 @@ static const char *ASDisplayNodeAssociatedNodeKey = "ASAssociatedNode";
self.debugName = name;
}
- (CGSize)measure:(CGSize)constrainedSize
{
return [self layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
}
- (void)setPreferredFrameSize:(CGSize)preferredFrameSize
{
// Deprecated preferredFrameSize just calls through to set width and height
@@ -3661,6 +3654,49 @@ static const char *ASDisplayNodeAssociatedNodeKey = "ASAssociatedNode";
return isPoints ? CGSizeMake(size.width.value, size.height.value) : CGSizeZero;
}
- (CGSize)measure:(CGSize)constrainedSize
{
return [self layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
}
ASLayoutElementStyleForwarding
- (void)visibilityDidChange:(BOOL)isVisible
{
if (isVisible) {
[self didEnterVisibleState];
} else {
[self didExitVisibleState];
}
}
- (void)visibleStateDidChange:(BOOL)isVisible
{
if (isVisible) {
[self didEnterVisibleState];
} else {
[self didExitVisibleState];
}
}
- (void)displayStateDidChange:(BOOL)inDisplayState
{
if (inDisplayState) {
[self didEnterVisibleState];
} else {
[self didExitVisibleState];
}
}
- (void)loadStateDidChange:(BOOL)inLoadState
{
if (inLoadState) {
[self didEnterPreloadState];
} else {
[self didExitPreloadState];
}
}
- (void)cancelLayoutTransitionsInProgress
{
[self cancelLayoutTransition];