<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewPropertyAnimator",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewPropertyAnimator"
  },
  "title" : "UIViewPropertyAnimator"
}
-->

# UIViewPropertyAnimator

A class that animates changes to views and allows the dynamic modification of those animations.

```
@MainActor class UIViewPropertyAnimator
```

## Overview

A [`UIViewPropertyAnimator`](/documentation/UIKit/UIViewPropertyAnimator) object lets you animate changes to views and dynamically modify your animations before they finish. With a property animator, you can run your animations from start to finish normally or you can turn them into interactive animations and control the timing yourself. The animator operates on animatable properties of views, such as the [`frame`](/documentation/UIKit/UIView/frame), [`center`](/documentation/UIKit/UIView/center), [`alpha`](/documentation/UIKit/UIView/alpha), and [`transform`](/documentation/UIKit/UIView/transform) properties, creating the needed animations from the blocks you provide.

When creating a property animator object, you specify the following:

- A block containing code that modifies the properties of one or more views.
- The timing curve that defines the speed of the animation over the course of its run.
- The duration (in seconds) of the animation.
- An optional completion block to execute when the animations finish.

In your animation blocks, set the value of an animatable property to the final value you want reflected by that view. For example, if you want to fade out a view, you would set its alpha property to `0` in your block. The property animator object creates an animation that adjusts the value of that property from its initial value to the new value that you specified in your block.

The speed at which the value of a property changes is controlled by the timing curve you specify when creating the property animator. Property animators include support for the built-in UIKit animation curves such as linear, ease-in, and ease-out. You can also use a cubic Bezier curve or a spring function to control the timing of the animations.

If you create your animator using one of the standard initialization methods, you must explicitly start your animations by calling the [`startAnimation()`](/documentation/UIKit/UIViewAnimating/startAnimation()) method. If you want to start the animations immediately after the creation of your animator, use the [`runningPropertyAnimator(withDuration:delay:options:animations:completion:)`](/documentation/UIKit/UIViewPropertyAnimator/runningPropertyAnimator(withDuration:delay:options:animations:completion:)) method instead of the standard initializers.

This class adopts the [`UIViewAnimating`](/documentation/UIKit/UIViewAnimating) and [`UIViewImplicitlyAnimating`](/documentation/UIKit/UIViewImplicitlyAnimating) protocols, which define the methods for starting, stopping, and modifying your animations. For more information about the methods of those protocols, see [`UIViewAnimating`](/documentation/UIKit/UIViewAnimating) and [`UIViewImplicitlyAnimating`](/documentation/UIKit/UIViewImplicitlyAnimating).

### Modify animations dynamically

A property animator gives you programmatic control over the timing and execution of the animations. Specifically, you can:

- Start, pause, resume, and stop animations; see the methods of the ``doc://com.apple.uikit/documentation/UIKit/UIViewAnimating`` protocol.
- Add animation blocks after the original animations start using the ``doc://com.apple.uikit/documentation/UIKit/UIViewPropertyAnimator/addAnimations(_:)`` and ``doc://com.apple.uikit/documentation/UIKit/UIViewPropertyAnimator/addAnimations(_:delayFactor:)`` methods.
- Scrub through a paused animation by modifying the ``doc://com.apple.uikit/documentation/UIKit/UIViewAnimating/fractionComplete`` property.
- Change the animation’s direction using the ``doc://com.apple.uikit/documentation/UIKit/UIViewAnimating/isReversed`` property.
- Modify the timing and duration of a partially complete animation by pausing the animation and using the ``doc://com.apple.uikit/documentation/UIKit/UIViewPropertyAnimator/continueAnimation(withTimingParameters:durationFactor:)`` method to finish it.

Most of the basic behavior is controlled by the properties of the [`UIViewAnimating`](/documentation/UIKit/UIViewAnimating) protocol, which this class adopts. Use those methods and properties to start, pause, resume, and stop the animations. You can also use them to scrub through the animation and change its direction. Use the methods and properties of this class to modify the animation blocks themselves and to update the timing information.

## Topics

### Initializing a property animator

[`init(duration:curve:animations:)`](/documentation/UIKit/UIViewPropertyAnimator/init(duration:curve:animations:))

Initializes the animator with a built-in UIKit timing curve.

[`init(duration:controlPoint1:controlPoint2:animations:)`](/documentation/UIKit/UIViewPropertyAnimator/init(duration:controlPoint1:controlPoint2:animations:))

Initializes the animator object with a cubic Bézier timing curve.

[`init(duration:dampingRatio:animations:)`](/documentation/UIKit/UIViewPropertyAnimator/init(duration:dampingRatio:animations:))

Initializes the animator object with spring-based timing information.

[`init(duration:timingParameters:)`](/documentation/UIKit/UIViewPropertyAnimator/init(duration:timingParameters:))

Initializes the animator object with a custom timing curve object.

[`runningPropertyAnimator(withDuration:delay:options:animations:completion:)`](/documentation/UIKit/UIViewPropertyAnimator/runningPropertyAnimator(withDuration:delay:options:animations:completion:))

Creates and returns an animator object that begins running its animations immediately.

### Modifying animations

[`addAnimations(_:)`](/documentation/UIKit/UIViewPropertyAnimator/addAnimations(_:))

Adds the specified animation block to the animator.

[`addAnimations(_:delayFactor:)`](/documentation/UIKit/UIViewPropertyAnimator/addAnimations(_:delayFactor:))

Adds the specified animation block with a delay.

[`addCompletion(_:)`](/documentation/UIKit/UIViewPropertyAnimator/addCompletion(_:))

Adds the specified completion block to the animator.

[`continueAnimation(withTimingParameters:durationFactor:)`](/documentation/UIKit/UIViewPropertyAnimator/continueAnimation(withTimingParameters:durationFactor:))

Adjusts the timing and duration of a paused animation.

### Accessing the animation parameters

[`duration`](/documentation/UIKit/UIViewPropertyAnimator/duration)

The total duration (in seconds) of the main animations.

[`delay`](/documentation/UIKit/UIViewPropertyAnimator/delay)

The delay (in seconds) after which the animations begin.

[`timingParameters`](/documentation/UIKit/UIViewPropertyAnimator/timingParameters)

The information used to determine the timing curve for the animation.

[`isInterruptible`](/documentation/UIKit/UIViewPropertyAnimator/isInterruptible)

A Boolean value indicating whether the animator is interruptible and can be paused or stopped.

[`isUserInteractionEnabled`](/documentation/UIKit/UIViewPropertyAnimator/isUserInteractionEnabled)

A Boolean value indicating whether views receive touch events while animations are running.

[`isManualHitTestingEnabled`](/documentation/UIKit/UIViewPropertyAnimator/isManualHitTestingEnabled)

A Boolean value indicating whether your app manages hit-testing while animations are in progress.

[`scrubsLinearly`](/documentation/UIKit/UIViewPropertyAnimator/scrubsLinearly)

A Boolean value indicating whether a paused animation scrubs linearly or uses its specified timing information.

[`pausesOnCompletion`](/documentation/UIKit/UIViewPropertyAnimator/pausesOnCompletion)

A Boolean value that indicates whether a completed animation remains in the active state.



---

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)
