<!--
{
  "availability" : [
    "iOS: 2.0.0 - 13.0.0",
    "iPadOS: 2.0.0 - 13.0.0",
    "macCatalyst: 13.1.0 - 13.1.0",
    "tvOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIView/beginAnimations(_:context:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIView(cm)beginAnimations:context:"
  },
  "title" : "beginAnimations(_:context:)"
}
-->

# beginAnimations(_:context:)

Marks the beginning of a begin/commit animation block.

```
class func beginAnimations(_ animationID: String?, context: UnsafeMutableRawPointer?)
```

## Parameters

`animationID`

An application-supplied identifier for the animations.

`context`

Custom data that you want to associate with this set of animations. information that is passed to the animation delegate messages—the selectors set using the [`setAnimationWillStart(_:)`](/documentation/UIKit/UIView/setAnimationWillStart(_:)) and [`setAnimationDidStop(_:)`](/documentation/UIKit/UIView/setAnimationDidStop(_:)) methods.

## Discussion

This method signals to the system that you want to specify one or more animations to perform. After calling this method, configure the animation options (using the `setAnimation…` class methods) and then change the desired animatable properties of your views. When you are done changing your view properties, call the [`commitAnimations()`](/documentation/UIKit/UIView/commitAnimations()) method to close the set and schedule the animations.

You can nest sets of animations (by calling this method again before committing a previous set of animations) as needed. Nesting animations groups them together and allows you to set different animation options for the nested group.

If you install a start or stop selector using the [`setAnimationWillStart(_:)`](/documentation/UIKit/UIView/setAnimationWillStart(_:)) or [`setAnimationDidStop(_:)`](/documentation/UIKit/UIView/setAnimationDidStop(_:)) method, the values you specify for the `animationID` and `context` parameters are passed to your selectors at runtime. You can use these parameters to pass additional information to those selectors.

Use of this method is discouraged in iOS 4.0 and later. You should use the block-based animation methods to specify your animations instead.

---

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)