An abstract superclass used to animate properties of a UIView. It is supported by a collection concrete subclasses provided for the alpha, frame, scroll position, affine transformation (including a special subclass for rotation), and zooming.
// Constants
typedef enum {
kUIAnimationCurveEaseInEaseOut,
kUIAnimationCurveEaseIn,
kUIAnimationCurveEaseOut,
kUIAnimationCurveLinear
} UIAnimationCurve;
@interface UIAnimation : NSObject {}
// Creating animations
- (id)initWithTarget:(id)target;
// Properties
- (id)target;
- (void)setDelegate:(id)delegate;
- (id)delegate;
- (void)setAction:(SEL)action;
- (SEL)action;
- (void)setAnimationCurve:(UIAnimationCurve)animationCurve;
- (float)progressForFraction:(float)fraction;
// Implemented by subclasses
- (void)setProgress:(float)progress;
// Controlling animations
- (void)stopAnimation;
@end
// Provided UIAnimation subclasses
// alpha
@interface UIAlphaAnimation : UIAnimation {}
- (void)setStartAlpha:(float)alpha;
- (void)setEndAlpha:(float)alpha;
- (float)alphaForFraction:(float)fraction;
@end
// frame
@interface UIFrameAnimation : UIAnimation {}
- (void)setStartFrame:(CGRect)frame;
- (void)setEndFrame:(CGRect)frame;
- (CGRect)endFrame;
@end
// rotation
@interface UIRotationAnimation : UIAnimation {}
- (void)setStartRotationAngle:(float)angle;
- (void)setEndRotationAngle:(float)angle;
@end
// scroll
@interface UIScrollAnimation : UIAnimation {}
- (void)setStartPoint:(CGPoint)startPoint;
- (void)setEndPoint:(CGPoint)endPoint;
@end
// transform
@interface UITransformAnimation : UIAnimation {}
- (void)setStartTransform:(CGAffineTransform)transform;
- (void)setEndTransform:(CGAffineTransform)transform;
- (CGAffineTransform)transformForFraction:(float)fraction;
@end
// zoom
@interface UIZoomAnimation : UIAnimation {}
+ (float)defaultDuration;
+ (id)zoomAnimationForTarget:(id)target endScale:(float)scale endScrollPoint:(CGPoint)point;
+ (id)zoomAnimationForTarget:(id)target focusRect:(CGRect)focusRect deviceBoundaryRect:(CGRect)deviceBoundaryRect scale:(float)scale;
- (void)setEndScale:(float)scale;
- (void)setStartScale:(float)scale;
- (void)setEndScrollPoint:(CGPoint)point;
- (void)setStartScrollPoint:(CGPoint)point;
@end
This category on UIView allows for automatically animating view properties, and also allows modifying global animation parameters inside an animation grouping. This is the preferred way to animate views.
@interface UIView (Animation)
+ (void)enableAnimation;
+ (void)disableAnimation;
+ (void)beginAnimations:(id)unknown;
+ (void)endAnimations;
+ (void)setAnimationAutoreverses:(BOOL)autoreverses;
+ (void)setAnimationCurve:(UIAnimationCurve)animationCurve;
+ (void)setAnimationDelay:(double)startDelay;
+ (void)setAnimationDelegate:(id)delegate;
+ (void)setAnimationDuration:(double)duration;
+ (void)setAnimationFrameInterval:(double)minimumTimeIntervalBetweenFrames;
+ (void)setAnimationFromCurrentState:(BOOL)shouldAnimateFromCurrentState;
+ (void)setAnimationPosition:(CGPoint)position;
+ (void)setAnimationStartTime:(double)startTime;
+ (void)setAnimationRepeatCount:(float)repeatCount;
+ (void)setAnimationRoundsToInteger:(BOOL)shouldRoundToInteger;
+ (void)setAnimationWillStartSelector:(SEL)willStartSelector;
+ (void)setAnimationDidStopSelector:(SEL)willEndSelector;
- (void)addAnimation:(UIAnimation *)animation forKey:(NSString *)key;
@end
UIAnimator provides a shared controller for starting and stopping global animations. The animation methods in UIView are preferred over UIAnimator.
@interface UIAnimator : NSObject {}
+ (id)sharedAnimator;
+ (void)disableAnimation;
+ (void)enableAnimation;
- (void)addAnimation:(UIAnimation *)animation withDuration:(double)duration start:(BOOL)start;
- (void)addAnimations:(NSArray *)animations withDuration:(double)duration start:(BOOL)start;
- (void)removeAnimationsForTarget:(id)target;
- (void)removeAnimationsForTarget:(id)target ofKind:(Class)classOfTarget;
- (void)startAnimation:(UIAnimation *)animation;
- (void)stopAnimation:(UIAnimation *)animation;
- (float)fractionForAnimation:(UIAnimation *)animation;
@end
UIResponder is an abstract superclass that provides the event handling and responder chain controller. See also NSResponder.
struct __GSEvent;
typedef struct __GSEvent GSEventRef;
@interface UIResponder : NSObject {}
// events
- (void)mouseDown:(GSEventRef)event;
- (void)mouseUp:(GSEventRef)event;
- (void)mouseDragged:(GSEventRef)event;
- (void)mouseEntered:(GSEventRef)event;
- (void)mouseExited:(GSEventRef)event;
- (void)mouseMoved:(GSEventRef)event;
- (void)scrollWheel:(GSEventRef)event;
- (void)keyDown:(GSEventRef)event;
- (void)keyUp:(GSEventRef)event;
- (void)gestureStarted:(GSEventRef)event;
- (void)gestureEnded:(GSEventRef)event;
- (void)gestureChanged:(GSEventRef)event;
// controlling the responder chain
- (id)nextResponder;
- (unsigned int)becomeFirstResponder;
- (BOOL)canBecomeFirstResponder;
- (BOOL)resignFirstResponder;
- (BOOL)canResignFirstResponder;
- (BOOL)isFirstResponder;
- (id)firstResponder;
@end
UIWindow handles events and mangages the device display for a UIView that is visible onscreen. See also NSWindow.
@interface UIWindow : UIView {}
// finding the key window
+ (UIWindow *)keyWindow;
// unknown
+ (CGRect)constrainFrameToScreen:(CGRect)rect;
// designated initializer
- (id)initWithContentRect:(CGRect)frame;
// the contentView should be set immediately after creating the window
- (UIView *)contentView;
- (void)setContentView:(UIView *)contextView;
// window properties
- (void)setFrame:(CGRect)fp8;
- (void)setTransform:(CGAffineTransform)fp8;
// handling interface events
- (BOOL)shouldRespondToStatusBarHeightChange;
- (void)handleStatusBarHeightChange;
// events and responders
- (void)sendEvent:(UIEvent *)event;
- (void)setBecomeKeyOnOrderFront:(BOOL)shouldBecomeKey;
- (void)orderFront:(id)sender;
- (void)orderOut:(id)sender;
- (void)makeKey:(id)sender;
- (id)firstResponder;
- (id)nextResponder;
// coordinate conversion
- (CGPoint)warpPoint:(CGPoint)point;
- (CGPoint)convertWindowToDevice:(CGPoint)point;
- (CGPoint)convertDeviceToWindow:(CGPoint)point;
// setting the backlight level
- (void)setLevel:(float)level;
- (float)level;
// unknown
- (void)setOutput:(int)output;
- (int)output;
- (void)synchronizeDrawingWithID:(int)fp8;
- (void *)createCoreSurfaceWithFrame:(CGRect)fp8;
- (void *)createCoreSurface;
- (id)representation;
- (void)writeSnapshotsToDir:(NSString *)directoryPath;
- (int)controlTint;
@end