POPAnimationEvent.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <Foundation/Foundation.h>
  9. /**
  10. @abstract Enumeraton of animation event types.
  11. */
  12. typedef NS_ENUM(NSUInteger, POPAnimationEventType) {
  13. kPOPAnimationEventPropertyRead = 0,
  14. kPOPAnimationEventPropertyWrite,
  15. kPOPAnimationEventToValueUpdate,
  16. kPOPAnimationEventFromValueUpdate,
  17. kPOPAnimationEventVelocityUpdate,
  18. kPOPAnimationEventBouncinessUpdate,
  19. kPOPAnimationEventSpeedUpdate,
  20. kPOPAnimationEventFrictionUpdate,
  21. kPOPAnimationEventMassUpdate,
  22. kPOPAnimationEventTensionUpdate,
  23. kPOPAnimationEventDidStart,
  24. kPOPAnimationEventDidStop,
  25. kPOPAnimationEventDidReachToValue,
  26. kPOPAnimationEventAutoreversed
  27. };
  28. /**
  29. @abstract The base animation event class.
  30. */
  31. @interface POPAnimationEvent : NSObject
  32. /**
  33. @abstract The event type. See {@ref POPAnimationEventType} for possible values.
  34. */
  35. @property (readonly, nonatomic, assign) POPAnimationEventType type;
  36. /**
  37. @abstract The time of event.
  38. */
  39. @property (readonly, nonatomic, assign) CFTimeInterval time;
  40. /**
  41. @abstract Optional string describing the animation at time of event.
  42. */
  43. @property (readonly, nonatomic, copy) NSString *animationDescription;
  44. @end
  45. /**
  46. @abstract An animation event subclass for recording value and velocity.
  47. */
  48. @interface POPAnimationValueEvent : POPAnimationEvent
  49. /**
  50. @abstract The value recorded.
  51. */
  52. @property (readonly, nonatomic, strong) id value;
  53. /**
  54. @abstract The velocity recorded, if any.
  55. */
  56. @property (readonly, nonatomic, strong) id velocity;
  57. @end