POPAnimatorPrivate.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. Copyright (c) 2014-present, Facebook, Inc.
  3. All rights reserved.
  4. This source code is licensed under the BSD-style license found in the
  5. LICENSE file in the root directory of this source tree. An additional grant
  6. of patent rights can be found in the PATENTS file in the same directory.
  7. */
  8. #import <pop/POPAnimator.h>
  9. @class POPAnimation;
  10. @protocol POPAnimatorObserving <NSObject>
  11. @required
  12. /**
  13. @abstract Called on each observer after animator has advanced. Core Animation actions are disabled by default.
  14. */
  15. - (void)animatorDidAnimate:(POPAnimator *)animator;
  16. @end
  17. @interface POPAnimator ()
  18. #if !TARGET_OS_IPHONE
  19. /**
  20. Determines whether or not to use a high priority background thread for animation updates. Using a background thread can result in faster, more responsive updates, but may be less compatible. Defaults to YES.
  21. */
  22. + (BOOL)disableBackgroundThread;
  23. + (void)setDisableBackgroundThread:(BOOL)flag;
  24. /**
  25. Determines the frequency (Hz) of the timer used when no display is available. Defaults to 60Hz.
  26. */
  27. + (uint64_t)displayTimerFrequency;
  28. + (void)setDisplayTimerFrequency:(uint64_t)frequency;
  29. #endif
  30. /**
  31. Used for externally driven animator instances.
  32. */
  33. @property (assign, nonatomic) BOOL disableDisplayLink;
  34. /**
  35. Time used when starting animations. Defaults to 0 meaning current media time is used. Exposed for unit testing.
  36. */
  37. @property (assign, nonatomic) CFTimeInterval beginTime;
  38. /**
  39. Exposed for unit testing.
  40. */
  41. - (void)renderTime:(CFTimeInterval)time;
  42. /**
  43. Funnel methods for category additions.
  44. */
  45. - (void)addAnimation:(POPAnimation *)anim forObject:(id)obj key:(NSString *)key;
  46. - (void)removeAllAnimationsForObject:(id)obj;
  47. - (void)removeAnimationForObject:(id)obj key:(NSString *)key;
  48. - (NSArray *)animationKeysForObject:(id)obj;
  49. - (POPAnimation *)animationForObject:(id)obj key:(NSString *)key;
  50. /**
  51. @abstract Add an animator observer. Observer will be notified of each subsequent animator advance until removal.
  52. */
  53. - (void)addObserver:(id<POPAnimatorObserving>)observer;
  54. /**
  55. @abstract Remove an animator observer.
  56. */
  57. - (void)removeObserver:(id<POPAnimatorObserving>)observer;
  58. @end