forked from overtake/telegram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPOPCustomAnimation.h
executable file
·46 lines (37 loc) · 1.76 KB
/
POPCustomAnimation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
Copyright (c) 2014-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
*/
#import "POPAnimation.h"
@class POPCustomAnimation;
/**
@abstract POPCustomAnimationBlock is the callback block of a custom animation.
@discussion This block will be executed for each animation frame and should update the property or properties being animated based on current timing.
@param target The object being animated. Reference the passed in target to help avoid retain loops.
@param animation The custom animation instance. Use to determine the current and elapsed time since last callback. Reference the passed in animation to help avoid retain loops.
@return Flag indicating whether the animation should continue animating. Return NO to indicate animation is done.
*/
typedef BOOL (^POPCustomAnimationBlock)(id target, POPCustomAnimation *animation);
/**
@abstract POPCustomAnimation is a concrete animation subclass for custom animations.
*/
@interface POPCustomAnimation : POPAnimation
/**
@abstract Creates and returns an initialized custom animation instance.
@discussion This is the designated initializer.
@param block The custom animation callback block. See {@ref POPCustomAnimationBlock}.
@return The initialized custom animation instance.
*/
+ (instancetype)animationWithBlock:(POPCustomAnimationBlock)block;
/**
@abstract The current animation time at time of callback.
*/
@property (readonly, nonatomic) CFTimeInterval currentTime;
/**
@abstract The elapsed animation time since last callback.
*/
@property (readonly, nonatomic) CFTimeInterval elapsedTime;
@end