diff --git a/AsyncDisplayKit/ASDisplayNode+Deprecated.h b/AsyncDisplayKit/ASDisplayNode+Deprecated.h index 4a3667e4f4..2a3bb4cd30 100644 --- a/AsyncDisplayKit/ASDisplayNode+Deprecated.h +++ b/AsyncDisplayKit/ASDisplayNode+Deprecated.h @@ -18,6 +18,8 @@ * @abstract Called whenever the visiblity of the node changed. * * @discussion Subclasses may use this to monitor when they become visible. + * + * @deprecated @see didEnterVisibleState @see didExitVisibleState */ - (void)visibilityDidChange:(BOOL)isVisible ASDISPLAYNODE_REQUIRES_SUPER ASDISPLAYNODE_DEPRECATED; @@ -25,6 +27,8 @@ * @abstract Called whenever the visiblity of the node changed. * * @discussion Subclasses may use this to monitor when they become visible. + * + * @deprecated @see didEnterVisibleState @see didExitVisibleStat */ - (void)visibleStateDidChange:(BOOL)isVisible ASDISPLAYNODE_REQUIRES_SUPER ASDISPLAYNODE_DEPRECATED; @@ -34,6 +38,8 @@ * @discussion Subclasses may use this to monitor when a node should be rendering its content. * * @note This method can be called from any thread and should therefore be thread safe. + * + * @deprecated @see didEnterDisplayState @see didExitDisplayState */ - (void)displayStateDidChange:(BOOL)inDisplayState ASDISPLAYNODE_REQUIRES_SUPER ASDISPLAYNODE_DEPRECATED; @@ -43,8 +49,72 @@ * @discussion Subclasses may use this to monitor data for a node should be loaded, either from a local or remote source. * * @note This method can be called from any thread and should therefore be thread safe. + * * @deprecated @see didEnterPreloadState @see didExitPreloadState */ - (void)loadStateDidChange:(BOOL)inLoadState ASDISPLAYNODE_REQUIRES_SUPER ASDISPLAYNODE_DEPRECATED; +/** + * @abstract Transitions the current layout with a new constrained size. Must be called on main thread. + * + * @param animated Animation is optional, but will still proceed through your `animateLayoutTransition` implementation with `isAnimated == NO`. + * @param shouldMeasureAsync Measure the layout asynchronously. + * @param measurementCompletion Optional completion block called only if a new layout is calculated. + * It is called on main, right after the measurement and before -animateLayoutTransition:. + * + * @discussion If the passed constrainedSize is the the same as the node's current constrained size, this method is noop. + * + * @see animateLayoutTransition: + * + * @deprecated Deprecated in version 2.0: Use transitionLayoutWithSizeRange:animated:measurementCompletion:. + * shouldMeasureAsync is enabled by default now. + * + */ +- (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize + animated:(BOOL)animated + shouldMeasureAsync:(BOOL)shouldMeasureAsync + measurementCompletion:(nullable void(^)())completion ASDISPLAYNODE_DEPRECATED; + + +/** + * @abstract Invalidates the current layout and begins a relayout of the node with the current `constrainedSize`. Must be called on main thread. + * + * @discussion It is called right after the measurement and before -animateLayoutTransition:. + * + * @param animated Animation is optional, but will still proceed through your `animateLayoutTransition` implementation with `isAnimated == NO`. + * @param shouldMeasureAsync Measure the layout asynchronously. + * @param measurementCompletion Optional completion block called only if a new layout is calculated. + * + * @see animateLayoutTransition: + * + * @deprecated Deprecated in version 2.0: Use transitionLayoutAnimated:measurementCompletion: + * shouldMeasureAsync is enabled by default now. + * + */ +- (void)transitionLayoutWithAnimation:(BOOL)animated + shouldMeasureAsync:(BOOL)shouldMeasureAsync + measurementCompletion:(nullable void(^)())completion ASDISPLAYNODE_DEPRECATED; + +/** + * @abstract Cancels all performing layout transitions. Can be called on any thread. + * + * @deprecated Deprecated in version 2.0: Use cancelLayoutTransition + */ +- (void)cancelLayoutTransitionsInProgress ASDISPLAYNODE_DEPRECATED; + +/** + * @abstract A boolean that shows whether the node automatically inserts and removes nodes based on the presence or + * absence of the node and its subnodes is completely determined in its layoutSpecThatFits: method. + * + * @discussion If flag is YES the node no longer require addSubnode: or removeFromSupernode method calls. The presence + * or absence of subnodes is completely determined in its layoutSpecThatFits: method. + * + * @deprecated Deprecated in version 2.0: Use automaticallyManagesSubnodes + */ +@property (nonatomic, assign) BOOL usesImplicitHierarchyManagement ASDISPLAYNODE_DEPRECATED; + +- (void)reclaimMemory ASDISPLAYNODE_DEPRECATED; +- (void)recursivelyReclaimMemory ASDISPLAYNODE_DEPRECATED; +@property (nonatomic, assign) BOOL placeholderFadesOut ASDISPLAYNODE_DEPRECATED; + @end diff --git a/AsyncDisplayKit/ASDisplayNode.h b/AsyncDisplayKit/ASDisplayNode.h index cd4f550835..3274ea8072 100644 --- a/AsyncDisplayKit/ASDisplayNode.h +++ b/AsyncDisplayKit/ASDisplayNode.h @@ -855,73 +855,6 @@ NS_ASSUME_NONNULL_BEGIN * @param node The node to be added. */ - (void)addSubnode:(nonnull ASDisplayNode *)node; -@end - - -@interface ASDisplayNode (Deprecated) - -/** - * @abstract Transitions the current layout with a new constrained size. Must be called on main thread. - * - * @param animated Animation is optional, but will still proceed through your `animateLayoutTransition` implementation with `isAnimated == NO`. - * @param shouldMeasureAsync Measure the layout asynchronously. - * @param measurementCompletion Optional completion block called only if a new layout is calculated. - * It is called on main, right after the measurement and before -animateLayoutTransition:. - * - * @discussion If the passed constrainedSize is the the same as the node's current constrained size, this method is noop. - * - * @see animateLayoutTransition: - * - * @deprecated Deprecated in version 2.0: Use transitionLayoutWithSizeRange:animated:measurementCompletion:. - * shouldMeasureAsync is enabled by default now. - * - */ -- (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize - animated:(BOOL)animated - shouldMeasureAsync:(BOOL)shouldMeasureAsync - measurementCompletion:(nullable void(^)())completion ASDISPLAYNODE_DEPRECATED; - - -/** - * @abstract Invalidates the current layout and begins a relayout of the node with the current `constrainedSize`. Must be called on main thread. - * - * @discussion It is called right after the measurement and before -animateLayoutTransition:. - * - * @param animated Animation is optional, but will still proceed through your `animateLayoutTransition` implementation with `isAnimated == NO`. - * @param shouldMeasureAsync Measure the layout asynchronously. - * @param measurementCompletion Optional completion block called only if a new layout is calculated. - * - * @see animateLayoutTransition: - * - * @deprecated Deprecated in version 2.0: Use transitionLayoutAnimated:measurementCompletion: - * shouldMeasureAsync is enabled by default now. - * - */ -- (void)transitionLayoutWithAnimation:(BOOL)animated - shouldMeasureAsync:(BOOL)shouldMeasureAsync - measurementCompletion:(nullable void(^)())completion ASDISPLAYNODE_DEPRECATED; - -/** - * @abstract Cancels all performing layout transitions. Can be called on any thread. - * - * @deprecated Deprecated in version 2.0: Use cancelLayoutTransition - */ -- (void)cancelLayoutTransitionsInProgress ASDISPLAYNODE_DEPRECATED; - -/** - * @abstract A boolean that shows whether the node automatically inserts and removes nodes based on the presence or - * absence of the node and its subnodes is completely determined in its layoutSpecThatFits: method. - * - * @discussion If flag is YES the node no longer require addSubnode: or removeFromSupernode method calls. The presence - * or absence of subnodes is completely determined in its layoutSpecThatFits: method. - * - * @deprecated Deprecated in version 2.0: Use automaticallyManagesSubnodes - */ -@property (nonatomic, assign) BOOL usesImplicitHierarchyManagement ASDISPLAYNODE_DEPRECATED; - -- (void)reclaimMemory ASDISPLAYNODE_DEPRECATED; -- (void)recursivelyReclaimMemory ASDISPLAYNODE_DEPRECATED; -@property (nonatomic, assign) BOOL placeholderFadesOut ASDISPLAYNODE_DEPRECATED; @end diff --git a/examples/ASDKLayoutTransition/Sample/ViewController.m b/examples/ASDKLayoutTransition/Sample/ViewController.m index c15ae1418b..48f1ffeba1 100644 --- a/examples/ASDKLayoutTransition/Sample/ViewController.m +++ b/examples/ASDKLayoutTransition/Sample/ViewController.m @@ -40,7 +40,7 @@ self = [super init]; if (self == nil) { return self; } - self.usesImplicitHierarchyManagement = YES; + self.automaticallyManagesSubnodes = YES; // Define the layout transition duration for the default transition self.defaultLayoutTransitionDuration = 1.0; diff --git a/examples/ASDKgram/Sample/PhotoCellNode.m b/examples/ASDKgram/Sample/PhotoCellNode.m index fa6cde9e09..082ecbf46f 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.m +++ b/examples/ASDKgram/Sample/PhotoCellNode.m @@ -94,7 +94,7 @@ _photoCommentsView.shouldRasterizeDescendants = YES; // instead of adding everything addSubnode: - self.usesImplicitHierarchyManagement = YES; + self.automaticallyManagesSubnodes = YES; #if DEBUG_PHOTOCELL_LAYOUT _userAvatarImageView.backgroundColor = [UIColor greenColor]; diff --git a/examples/ASViewController/Sample/DetailRootNode.m b/examples/ASViewController/Sample/DetailRootNode.m index 6a6573762a..658a9b78d7 100644 --- a/examples/ASViewController/Sample/DetailRootNode.m +++ b/examples/ASViewController/Sample/DetailRootNode.m @@ -47,7 +47,7 @@ static const NSInteger kImageHeight = 200; // Enable usesImplicitHierarchyManagement so the first time the layout pass of the node is happening all nodes that are referenced // in layouts within layoutSpecThatFits: will be added automatically - self.usesImplicitHierarchyManagement = YES; + self.automaticallyManagesSubnodes = YES; return self; }