_ASTransitionContext.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // _ASTransitionContext.h
  3. // AsyncDisplayKit
  4. //
  5. // Created by Levi McCallum on 2/4/16.
  6. //
  7. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  8. // This source code is licensed under the BSD-style license found in the
  9. // LICENSE file in the root directory of this source tree. An additional grant
  10. // of patent rights can be found in the PATENTS file in the same directory.
  11. //
  12. #import <Foundation/Foundation.h>
  13. #import "ASContextTransitioning.h"
  14. @class ASLayout;
  15. @class _ASTransitionContext;
  16. @protocol _ASTransitionContextLayoutDelegate <NSObject>
  17. - (NSArray<ASDisplayNode *> *)currentSubnodesWithTransitionContext:(_ASTransitionContext *)context;
  18. - (NSArray<ASDisplayNode *> *)insertedSubnodesWithTransitionContext:(_ASTransitionContext *)context;
  19. - (NSArray<ASDisplayNode *> *)removedSubnodesWithTransitionContext:(_ASTransitionContext *)context;
  20. - (ASLayout *)transitionContext:(_ASTransitionContext *)context layoutForKey:(NSString *)key;
  21. - (ASSizeRange)transitionContext:(_ASTransitionContext *)context constrainedSizeForKey:(NSString *)key;
  22. @end
  23. @protocol _ASTransitionContextCompletionDelegate <NSObject>
  24. - (void)transitionContext:(_ASTransitionContext *)context didComplete:(BOOL)didComplete;
  25. @end
  26. @interface _ASTransitionContext : NSObject <ASContextTransitioning>
  27. @property (assign, readonly, nonatomic, getter=isAnimated) BOOL animated;
  28. - (instancetype)initWithAnimation:(BOOL)animated
  29. layoutDelegate:(id<_ASTransitionContextLayoutDelegate>)layoutDelegate
  30. completionDelegate:(id<_ASTransitionContextCompletionDelegate>)completionDelegate;
  31. @end
  32. @interface _ASAnimatedTransitionContext : NSObject
  33. @property (nonatomic, strong, readonly) ASDisplayNode *node;
  34. @property (nonatomic, assign, readonly) CGFloat alpha;
  35. + (instancetype)contextForNode:(ASDisplayNode *)node alpha:(CGFloat)alphaValue;
  36. @end