Protocol

NSAnimatablePropertyContainer

A set of methods that defines a way to add animation to an existing class with a minimum of API impact.

Declaration

@protocol NSAnimatablePropertyContainer

Overview

The NSAnimatablePropertyContainer protocol returns a proxy object for the receiver that can be used to initiate implied animation of property changes. An object's animator proxy should be treated as if it was the object itself, and may be passed to any code that accepts the object as a parameter. Sending of key-value-coding compliant "set" messages to the proxy will trigger animation for automatically animated properties of its target object.

An object's automatically animated properties are those for which NSAnimatablePropertyContainer finds and returns a CAAnimation object instead of nil, often because animator specifies a default animation for the key.

It's perfectly valid to set a new value for a property for which an animation that is currently in progress; this simply sets a new target value for that property, with animation to the new target proceeding from whatever current value the property has reached. An in-flight property animation can be stopped by setting a new value for the property bracketed by an NSAnimationContext with 0.0 as the duration.

Topics

Getting the Animator Proxy

- animator

Returns a proxy object for the receiver that can be used to initiate implied animation for property changes.

Required.

Managing Animations for Properties

animations

Sets the option dictionary that maps event trigger keys to animation objects.

Required.

- animationForKey:

Returns the animation that should be performed for the specified key.

Required.

+ defaultAnimationForKey:

Returns the default animation that should be performed for the specified key.

Required.

Constants

Transition Animation Keys

The following constants define the keys that reference the transitions used as views are made visible and hidden.

See Also

View-Based Animations

NSViewAnimation

An animation of an app's views, limited to changes in frame location and size, and to fade-in and fade-out effects.

NSAnimationContext

An animation context, which contains information about environment and state.

NSAnimationProgress

The animation progress, as a floating-point number between 0.0 and 1.0.

NSAnimationEffect

The type for standard system animation effects, which include both display and sound.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software