<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSViewAnimation",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSViewAnimation"
  },
  "title" : "NSViewAnimation"
}
-->

# NSViewAnimation

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

```
class NSViewAnimation
```

## Overview

An [`NSViewAnimation`](/documentation/AppKit/NSViewAnimation) object takes an array of dictionaries from which it determines the objects to animate and the effects to apply to them. Each dictionary must have a target object and, optionally, properties that specify beginning and ending frame and whether to fade in or fade out. (See [`NSViewAnimation.Key`](/documentation/AppKit/NSViewAnimation/Key) for further information.) Animations with [`NSViewAnimation`](/documentation/AppKit/NSViewAnimation) are, by default, in non-blocking mode over a duration of 0.5 seconds using the ease in-out animation curve. But you can configure the animation to have any duration, curve, frame rate, and blocking mode. You may also set progress marks, assign a delegate, and implement delegation methods in order to animate view and windows concurrent with the ones specified as targets in the view-animation dictionary.

Invoking the [`NSAnimation`](/documentation/AppKit/NSAnimation) [`stop()`](/documentation/AppKit/NSAnimation/stop()) method on a running [`NSViewAnimation`](/documentation/AppKit/NSViewAnimation) object moves the animation to the end frame.

## Topics

### Initializing an NSViewAnimation object

[`-  initWithViewAnimations:`](/documentation/AppKit/NSViewAnimation/init(viewAnimations:))

Returns an `NSViewAnimation` object initialized with the supplied information.

### Getting and setting view-animation dictionaries

[`viewAnimations`](/documentation/AppKit/NSViewAnimation/viewAnimations)

The dictionaries defining the objects to animate.

[`Key`](/documentation/AppKit/NSViewAnimation/Key)

The following string constants are keys for the dictionaries in the array passed into [`init(viewAnimations:)`](/documentation/AppKit/NSViewAnimation/init(viewAnimations:)) and [`viewAnimations`](/documentation/AppKit/NSViewAnimation/viewAnimations).

[`EffectName`](/documentation/AppKit/NSViewAnimation/EffectName)

The following constants specify the animation effect to apply and are used as values for the animation effect property of the animation view. See the description of [`effect`](/documentation/AppKit/NSViewAnimation/Key/effect) for usage details.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSAnimation`](/documentation/AppKit/NSAnimation)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)