---
title: NSAnimation
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsanimation
---

# NSAnimation

An object that manages the timing and progress of animations in the user interface.

## Declaration

```swift
class NSAnimation
```

## Overview

Overview NSAnimation also lets you link together multiple animations so that when one animation ends another one starts. It does not provide any drawing support for animation and does not directly deal with views, targets, or actions. note: For simple tasks requiring a timing mechanism, consider using Timer. NSAnimation objects have several characteristics, including duration, frame rate, and animation curve, which describes the relative speed of the animation over its course. You can set progress marks in an animation, each of which specifies a percentage of the animation completed; when an animation reaches a progress mark, it notifies its delegate and posts a notification to any observers. Animations execute in one of three blocking modes: blocking, non-blocking on the main thread, and non-blocking on a separate thread. The non-blocking modes permit the handling of user events while the animation is running. Subclassing Notes The usual usage pattern for NSAnimation is to make a subclass that overrides (at least) the currentProgress property to invoke the superclass implementation and then perform whatever animation action is needed. The method implementation might use the currentValue property and then use that value to update some drawing; as a consequence of getting the current value, the method animation(_:valueForProgress:) is sent to the delegate (if there is a delegate that implements the method). For more information on subclassing NSAnimation, see Animation Programming Guide for Cocoa.

## Topics

### Initializing an NSAnimation Object

- [init(duration:animationCurve:)](appkit/nsanimation/init(duration:animationcurve:).md)

### Configuring an Animation

- [animationBlockingMode](appkit/nsanimation/animationblockingmode.md)
- [runLoopModesForAnimating](appkit/nsanimation/runloopmodesforanimating.md)
- [animationCurve](appkit/nsanimation/animationcurve.md)
- [duration](appkit/nsanimation/duration.md)
- [frameRate](appkit/nsanimation/framerate.md)

### Managing the Delegate

- [delegate](appkit/nsanimation/delegate.md)

### Controlling and Monitoring an Animation

- [start()](appkit/nsanimation/start().md)
- [stop()](appkit/nsanimation/stop().md)
- [isAnimating](appkit/nsanimation/isanimating.md)
- [currentProgress](appkit/nsanimation/currentprogress.md)
- [currentValue](appkit/nsanimation/currentvalue.md)

### Managing Progress Marks

- [addProgressMark(_:)](appkit/nsanimation/addprogressmark(_:).md)
- [removeProgressMark(_:)](appkit/nsanimation/removeprogressmark(_:).md)
- [progressMarks](appkit/nsanimation/progressmarks.md)

### Linking Animations Together

- [start(when:reachesProgress:)](appkit/nsanimation/start(when:reachesprogress:).md)
- [stop(when:reachesProgress:)](appkit/nsanimation/stop(when:reachesprogress:).md)
- [clearStart()](appkit/nsanimation/clearstart().md)
- [clearStop()](appkit/nsanimation/clearstop().md)

### Constants

- [NSAnimation.Curve](appkit/nsanimation/curve.md)
- [NSAnimation.BlockingMode](appkit/nsanimation/blockingmode.md)
- [NSAnimation.Progress](appkit/nsanimation/progress.md)
- [NSAnimationProgressMark Notification Key](appkit/nsanimationprogressmark-notification-key.md)

### Notifications

- [progressMarkNotification](appkit/nsanimation/progressmarknotification.md)

### Initializers

- [init(coder:)](appkit/nsanimation/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [NSViewAnimation](appkit/nsviewanimation.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Custom Animations

- [NSAnimationDelegate](appkit/nsanimationdelegate.md)
