ASDisplayNode(LayoutTransitioning) Category Reference

Declared in ASDisplayNode.h

  defaultLayoutTransitionDuration

The amount of time it takes to complete the default transition animation. Default is 0.2.

@property (nonatomic, assign) NSTimeInterval defaultLayoutTransitionDuration

Declared In

ASDisplayNode.h

  defaultLayoutTransitionDelay

The amount of time (measured in seconds) to wait before beginning the default transition animation. Default is 0.0.

@property (nonatomic, assign) NSTimeInterval defaultLayoutTransitionDelay

Declared In

ASDisplayNode.h

  defaultLayoutTransitionOptions

A mask of options indicating how you want to perform the default transition animations. For a list of valid constants, see UIViewAnimationOptions.

@property (nonatomic, assign) UIViewAnimationOptions defaultLayoutTransitionOptions

Declared In

ASDisplayNode.h

– animateLayoutTransition:

A place to perform your animation. New nodes have been inserted here. You can also use this time to re-order the hierarchy.

- (void)animateLayoutTransition:(nonnull id<ASContextTransitioning>)context

Discussion

A place to perform your animation. New nodes have been inserted here. You can also use this time to re-order the hierarchy.

Declared In

ASDisplayNode.h

– didCompleteLayoutTransition:

A place to clean up your nodes after the transition

- (void)didCompleteLayoutTransition:(nonnull id<ASContextTransitioning>)context

Discussion

A place to clean up your nodes after the transition

Declared In

ASDisplayNode.h

– transitionLayoutWithSizeRange:animated:shouldMeasureAsync:measurementCompletion:

Transitions the current layout with a new constrained size. Must be called on main thread.

- (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize animated:(BOOL)animated shouldMeasureAsync:(BOOL)shouldMeasureAsync measurementCompletion:(nullable void ( ^ ) ( ))completion

Parameters

animated

Animation is optional, but will still proceed through your animateLayoutTransition implementation with isAnimated == NO.

shouldMeasureAsync

Measure the layout asynchronously.

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. If passed YES to shouldMeasureAsync it’s guaranteed that measurement is happening on a background thread, otherwise measaurement will happen on the thread that the method was called on. The measurementCompletion callback is always called on the main thread right after the measurement and before -animateLayoutTransition:.

Declared In

ASDisplayNode.h

– transitionLayoutWithAnimation:shouldMeasureAsync:measurementCompletion:

Invalidates the current layout and begins a relayout of the node with the current constrainedSize. Must be called on main thread.

- (void)transitionLayoutWithAnimation:(BOOL)animated shouldMeasureAsync:(BOOL)shouldMeasureAsync measurementCompletion:(nullable void ( ^ ) ( ))completion

Parameters

animated

Animation is optional, but will still proceed through your animateLayoutTransition implementation with isAnimated == NO.

shouldMeasureAsync

Measure the layout asynchronously.

measurementCompletion

Optional completion block called only if a new layout is calculated.

Discussion

It is called right after the measurement and before -animateLayoutTransition:.

Declared In

ASDisplayNode.h

– cancelLayoutTransition

Cancels all performing layout transitions. Can be called on any thread.

- (void)cancelLayoutTransition

Declared In

ASDisplayNode.h