---
title: activate()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsapplication/activate()
---

# activate()

Activates the receiver app, if appropriate.

## Declaration

```swift
func activate()
```

## Mentioned in

Passing control from one app to another with cooperative activation

## Discussion

Discussion Use this method to request app activation; calling this method doesn’t guarantee app activation. For cooperative activation, the other app should call yieldActivation(to:) or equivalent before the target app invokes activate(). Invoking activate() on an already-active application cancels any pending activation yields by the receiver.

## See Also

### Activating and deactivating the app

- [Passing control from one app to another with cooperative activation](appkit/passing-control-from-one-app-to-another-with-cooperative-activation.md)
- [deactivate()](appkit/nsapplication/deactivate().md)
- [isActive](appkit/nsapplication/isactive.md)
- [yieldActivation(to:)](appkit/nsapplication/yieldactivation(to:).md)
- [yieldActivation(toApplicationWithBundleIdentifier:)](appkit/nsapplication/yieldactivation(toapplicationwithbundleidentifier:).md)
- [NSApplication.ActivationOptions](appkit/nsapplication/activationoptions.md)
