---
title: "handle(intent:completion:)"
framework: intents
role: symbol
role_heading: Instance Method
path: "intents/inupdatemediaaffinityintenthandling/handle(intent:completion:)"
---

# handle(intent:completion:)

Handles the media update affinity request.

## Declaration

```swift
func handle(intent: INUpdateMediaAffinityIntent, completion: @escaping @Sendable (INUpdateMediaAffinityIntentResponse) -> Void)
```

```swift
func handle(intent: INUpdateMediaAffinityIntent) async -> INUpdateMediaAffinityIntentResponse
```

## Parameters

- `intent`: The doc://com.apple.sirikit/documentation/Intents/INUpdateMediaAffinityIntent object that contains details about the user’s request. The Intents app extension confirms the information in this intent before the system calls the doc://com.apple.sirikit/documentation/Intents/INUpdateMediaAffinityIntentHandling/handle(intent:completion:) method.
- `completion`: The handler block to execute with your response. You must execute this handler while implementing this method. This handler has no return value and takes the following parameter:

## Discussion

Discussion Implement this method to update the affinity for the media item.
