---
title: "windowScene(_:performActionFor:completionHandler:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiwindowscenedelegate/windowscene(_:performactionfor:completionhandler:)"
---

# windowScene(_:performActionFor:completionHandler:)

Asks the delegate to perform the user-selected action.

## Declaration

```swift
optional func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void)
```

```swift
optional func windowScene(_ windowScene: UIWindowScene, performActionFor shortcutItem: UIApplicationShortcutItem) async -> Bool
```

## Parameters

- `windowScene`: The window scene object receiving the shortcut item.
- `shortcutItem`: The action selected by the user. Your app defines the actions that it supports, and the user chooses from among those actions. For information about how to create and configure shortcut items for your app, see doc://com.apple.uikit/documentation/UIKit/UIApplicationShortcutItem.
- `completionHandler`: A handler block to call after you complete the action. This block has no return value and takes the following parameter:

## Discussion

Discussion When the user selects one of your app’s shortcut items, use this method to perform the selected action. After you finish the action, execute the specified completionHandler block to report your success or failure in performing the action.

## See Also

### Performing tasks

- [windowScene(_:userDidAcceptCloudKitShareWith:)](uikit/uiwindowscenedelegate/windowscene(_:userdidacceptcloudkitsharewith:).md)
