UIView Animation
2016-04-24 15:37
399 查看
@interface UIView(UIViewAnimation)
+ (void)beginAnimations:(nullable
NSString *)animationID context:(nullable
void *)context;
// additional context info passed to will start/did stop selectors. begin/commit can be nested
+ (void)commitAnimations;
// starts up any animations when the top level animation is commited
// no getters. if called outside animation block, these setters have no effect.
+ (void)setAnimationDelegate:(nullable
id)delegate;
// default = nil
+ (void)setAnimationWillStartSelector:(nullable
SEL)selector;
// default = NULL. -animationWillStart:(NSString *)animationID context:(void *)context
+ (void)setAnimationDidStopSelector:(nullable
SEL)selector;
// default = NULL. -animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
+ (void)setAnimationDuration:(NSTimeInterval)duration;
// default = 0.2
+ (void)setAnimationDelay:(NSTimeInterval)delay;
// default = 0.0
+ (void)setAnimationStartDate:(NSDate *)startDate;
// default = now ([NSDate date])
+ (void)setAnimationCurve:(UIViewAnimationCurve)curve;
// default = UIViewAnimationCurveEaseInOut
+ (void)setAnimationRepeatCount:(float)repeatCount;
// default = 0.0. May be fractional
+ (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses;
// default = NO. used if repeat count is non-zero
+ (void)setAnimationBeginsFromCurrentState:(BOOL)fromCurrentState;
// default = NO. If YES, the current view position is always used for new animations -- allowing animations to "pile up" on each other. Otherwise, the last end state is used for the animation (the default).
+ (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView *)view cache:(BOOL)cache;
// current limitation - only one per begin/commit block
+ (void)setAnimationsEnabled:(BOOL)enabled;
// ignore any attribute changes while set.
+ (BOOL)areAnimationsEnabled;
+ (void)performWithoutAnimation:(void (^)(void))actionsWithoutAnimation
NS_AVAILABLE_IOS(7_0);
+ (NSTimeInterval)inheritedAnimationDuration
NS_AVAILABLE_IOS(9_0);
@end
@interface UIView(UIViewAnimationWithBlocks)
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options
animations:(void (^)(void))animations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void
(^ __nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
// delay = 0.0, options = 0
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations
NS_AVAILABLE_IOS(4_0);
// delay = 0.0, options = 0, completion = NULL
/* Performs `animations` using a timing curve described by the motion of a spring. When `dampingRatio` is 1, the animation will smoothly decelerate to its final model values without oscillating. Damping ratios less than 1 will oscillate more and more before
coming to a complete stop. You can use the initial spring velocity to specify how fast the object at the end of the simulated spring was moving before it was attached. It's a unit coordinate system, where 1 is defined as travelling the total animation distance
in a second. So if you're changing an object's position by 200pt in this animation, and you want the animation to behave as if the object was moving at 100pt/s before the animation started, you'd pass 0.5. You'll typically want to pass 0 for the velocity.
*/
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio
initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations
completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(7_0);
+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void
(^ __nullable)(void))animations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
+ (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options
completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
// toView added to fromView.superview, fromView removed from its superview
/* Performs the requested system-provided animation on one or more views. Specify addtional animations in the parallelAnimations block. These additional animations will run alongside the system animation with the same timing and duration that the system animation
defines/inherits. Additional animations should not modify properties of the view on which the system animation is being performed. Not all system animations honor all available options.
*/
+ (void)performSystemAnimation:(UISystemAnimation)animation onViews:(NSArray<__kindof
UIView *> *)views options:(UIViewAnimationOptions)options animations:(void (^
__nullable)(void))parallelAnimations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(7_0);
@end
@interface UIView (UIViewKeyframeAnimations)
+ (void)animateKeyframesWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options
animations:(void (^)(void))animations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(7_0);
+ (void)addKeyframeWithRelativeStartTime:(double)frameStartTime relativeDuration:(double)frameDuration
animations:(void (^)(void))animations
NS_AVAILABLE_IOS(7_0);
// start time and duration are values between 0.0 and 1.0 specifying time and duration relative to the overall time of the keyframe animation
@end
+ (void)beginAnimations:(nullable
NSString *)animationID context:(nullable
void *)context;
// additional context info passed to will start/did stop selectors. begin/commit can be nested
+ (void)commitAnimations;
// starts up any animations when the top level animation is commited
// no getters. if called outside animation block, these setters have no effect.
+ (void)setAnimationDelegate:(nullable
id)delegate;
// default = nil
+ (void)setAnimationWillStartSelector:(nullable
SEL)selector;
// default = NULL. -animationWillStart:(NSString *)animationID context:(void *)context
+ (void)setAnimationDidStopSelector:(nullable
SEL)selector;
// default = NULL. -animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
+ (void)setAnimationDuration:(NSTimeInterval)duration;
// default = 0.2
+ (void)setAnimationDelay:(NSTimeInterval)delay;
// default = 0.0
+ (void)setAnimationStartDate:(NSDate *)startDate;
// default = now ([NSDate date])
+ (void)setAnimationCurve:(UIViewAnimationCurve)curve;
// default = UIViewAnimationCurveEaseInOut
+ (void)setAnimationRepeatCount:(float)repeatCount;
// default = 0.0. May be fractional
+ (void)setAnimationRepeatAutoreverses:(BOOL)repeatAutoreverses;
// default = NO. used if repeat count is non-zero
+ (void)setAnimationBeginsFromCurrentState:(BOOL)fromCurrentState;
// default = NO. If YES, the current view position is always used for new animations -- allowing animations to "pile up" on each other. Otherwise, the last end state is used for the animation (the default).
+ (void)setAnimationTransition:(UIViewAnimationTransition)transition forView:(UIView *)view cache:(BOOL)cache;
// current limitation - only one per begin/commit block
+ (void)setAnimationsEnabled:(BOOL)enabled;
// ignore any attribute changes while set.
+ (BOOL)areAnimationsEnabled;
+ (void)performWithoutAnimation:(void (^)(void))actionsWithoutAnimation
NS_AVAILABLE_IOS(7_0);
+ (NSTimeInterval)inheritedAnimationDuration
NS_AVAILABLE_IOS(9_0);
@end
@interface UIView(UIViewAnimationWithBlocks)
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options
animations:(void (^)(void))animations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations completion:(void
(^ __nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
// delay = 0.0, options = 0
+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations
NS_AVAILABLE_IOS(4_0);
// delay = 0.0, options = 0, completion = NULL
/* Performs `animations` using a timing curve described by the motion of a spring. When `dampingRatio` is 1, the animation will smoothly decelerate to its final model values without oscillating. Damping ratios less than 1 will oscillate more and more before
coming to a complete stop. You can use the initial spring velocity to specify how fast the object at the end of the simulated spring was moving before it was attached. It's a unit coordinate system, where 1 is defined as travelling the total animation distance
in a second. So if you're changing an object's position by 200pt in this animation, and you want the animation to behave as if the object was moving at 100pt/s before the animation started, you'd pass 0.5. You'll typically want to pass 0 for the velocity.
*/
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio
initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations
completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(7_0);
+ (void)transitionWithView:(UIView *)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void
(^ __nullable)(void))animations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
+ (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options
completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(4_0);
// toView added to fromView.superview, fromView removed from its superview
/* Performs the requested system-provided animation on one or more views. Specify addtional animations in the parallelAnimations block. These additional animations will run alongside the system animation with the same timing and duration that the system animation
defines/inherits. Additional animations should not modify properties of the view on which the system animation is being performed. Not all system animations honor all available options.
*/
+ (void)performSystemAnimation:(UISystemAnimation)animation onViews:(NSArray<__kindof
UIView *> *)views options:(UIViewAnimationOptions)options animations:(void (^
__nullable)(void))parallelAnimations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(7_0);
@end
@interface UIView (UIViewKeyframeAnimations)
+ (void)animateKeyframesWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewKeyframeAnimationOptions)options
animations:(void (^)(void))animations completion:(void (^
__nullable)(BOOL finished))completion
NS_AVAILABLE_IOS(7_0);
+ (void)addKeyframeWithRelativeStartTime:(double)frameStartTime relativeDuration:(double)frameDuration
animations:(void (^)(void))animations
NS_AVAILABLE_IOS(7_0);
// start time and duration are values between 0.0 and 1.0 specifying time and duration relative to the overall time of the keyframe animation
@end
相关文章推荐
- Codeforces #591 D Chip 'n Dale Rescue Rangers(二分查找/转换参考系)
- Rescue宽度搜索的最优解
- 解密uiautomator-API之UiDevice实例化方法
- 如何区分:Request中getContextPath、getServletPath、getRequestURI、request.getRealPath
- Adobe系列软件破解on mac-Adobe flash builder on mac
- Stringbuffer和Stringbuilder
- 【Arduino官方教程第一辑】示例程序 2-6 音乐键盘-tone函数的运用
- 人机交互设计——评价谷歌拼音输入法(安卓版)
- BZOJ 1670: [Usaco2006 Oct]Building the Moat护城河的挖掘|二维凸包
- AI中基本工具介绍太原UI设计师分享给你【平面设计、logo设计】
- flash builder 4.7破解亲测可用
- C# 使用Guid类生成不重复的随机数
- POJ:3061 Subsequence(尺取法)
- 按钮UIBUtton的常用属性及方法总结
- MyStringBuild
- hdu 5667 Sequence 矩阵快速幂+费马小定理
- 蘑菇阵(动态规划、百度)——unique paths
- ZOJ 3940 Modulo Query
- POJ 3061 Subsequence(尺取法)
- 人机交互设计之百度搜索软件评价