---
title: "setAnimationDidStop(_:)"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uiview/setanimationdidstop(_:)"
---

# setAnimationDidStop(_:)

Sets the message to send to the animation delegate when animation stops.

## Declaration

```swift
class func setAnimationDidStop(_ selector: Selector?)
```

## Parameters

- `selector`: The message sent to the animation delegate after animations end. The default value is NULL. The selector should be of the form: - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context. Your method must take the following arguments: animationID An doc://com.apple.documentation/documentation/Foundation/NSString containing an optional application-supplied identifier. This is the identifier that is passed to the doc://com.apple.uikit/documentation/UIKit/UIView/beginAnimations(_:context:) method. This argument can be nil. finished An doc://com.apple.documentation/documentation/Foundation/NSNumber object containing a Boolean value. The value is doc://com.apple.documentation/documentation/Swift/true if the animation ran to completion before it stopped or doc://com.apple.documentation/documentation/Swift/false if it did not. context An optional application-supplied context. This is the context data passed to the doc://com.apple.uikit/documentation/UIKit/UIView/beginAnimations(_:context:) method. This argument can be nil.

## Discussion

Discussion If you specify an animation delegate for a begin/commit set of animations, you use this method to specify the selector to call after the animations end. This method does nothing if called from outside of an animation block. It must be called between calls to the beginAnimations(_:context:) and commitAnimations() methods. This selector is set to NULL by default. note: Your stop selector is still called even if animations are disabled. Use of this method is discouraged in iOS 4.0 and later. If you are using the block-based animation methods, you can include your delegate’s end code directly inside your block.

## See Also

### Deprecated methods

- [beginAnimations(_:context:)](uikit/uiview/beginanimations(_:context:).md)
- [commitAnimations()](uikit/uiview/commitanimations().md)
- [setAnimationStart(_:)](uikit/uiview/setanimationstart(_:).md)
- [setAnimationsEnabled(_:)](uikit/uiview/setanimationsenabled(_:).md)
- [setAnimationDelegate(_:)](uikit/uiview/setanimationdelegate(_:).md)
- [setAnimationWillStart(_:)](uikit/uiview/setanimationwillstart(_:).md)
- [setAnimationDuration(_:)](uikit/uiview/setanimationduration(_:).md)
- [setAnimationDelay(_:)](uikit/uiview/setanimationdelay(_:).md)
- [setAnimationCurve(_:)](uikit/uiview/setanimationcurve(_:).md)
- [setAnimationRepeatCount(_:)](uikit/uiview/setanimationrepeatcount(_:).md)
- [setAnimationRepeatAutoreverses(_:)](uikit/uiview/setanimationrepeatautoreverses(_:).md)
- [setAnimationBeginsFromCurrentState(_:)](uikit/uiview/setanimationbeginsfromcurrentstate(_:).md)
- [setAnimationTransition(_:for:cache:)](uikit/uiview/setanimationtransition(_:for:cache:).md)
- [areAnimationsEnabled](uikit/uiview/areanimationsenabled.md)
- [forBaselineLayout()](uikit/uiview/forbaselinelayout().md)
