---
title: "setActive(_:animated:)"
framework: arkit
role: symbol
role_heading: Instance Method
path: "arkit/arcoachingoverlayview/setactive(_:animated:)"
---

# setActive(_:animated:)

Controls whether coaching is in progress.

## Declaration

```swift
func setActive(_ active: Bool, animated: Bool)
```

## Parameters

- `active`: A flag you set to indicate whether the coaching overlay should activate or deactivate.
- `animated`: A flag that when doc://com.apple.documentation/documentation/Swift/true, fades the coaching overlay in or out. When you pass a value of doc://com.apple.documentation/documentation/Swift/false, the coaching overlay shows or hides instantly.

## Discussion

Discussion If the animated property of setActive(_:animated:) is true, isActive and isHidden are false while the coaching overlay is fading out. When the coaching overlay is deactivated without animation, or when the animation finishes, ARKit notifies you by calling coachingOverlayViewDidDeactivate(_:).

## See Also

### Activating the View

- [activatesAutomatically](arkit/arcoachingoverlayview/activatesautomatically.md)
- [isActive](arkit/arcoachingoverlayview/isactive.md)
