---
title: "resourceLoader(_:shouldWaitForResponseTo:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avassetresourceloaderdelegate/resourceloader(_:shouldwaitforresponseto:)"
---

# resourceLoader(_:shouldWaitForResponseTo:)

Tells the delegate that assistance is required of the application to respond to an authentication challenge.

## Declaration

```swift
optional func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForResponseTo authenticationChallenge: URLAuthenticationChallenge) -> Bool
```

## Parameters

- `resourceLoader`: The resource loader.
- `authenticationChallenge`: The authentication challenge.

## Return Value

Return Value true if the resource loader should wait for a response to the authentication challenge; otherwise false.

## Discussion

Discussion Delegates receive this message when assistance is required of the application to respond to an authentication challenge. Return true if you expect a response either subsequently or immediately to the authenticationChallenger object’s sender. If you intend to respond to the authentication challenge after your handling of resourceLoader:shouldWaitForResponseToAuthenticationChallenge: returns, you must retain the authenticationChallenge until after your response has been made.

## See Also

### Processing authentication challenges

- [resourceLoader(_:didCancel:)](avfoundation/avassetresourceloaderdelegate/resourceloader(_:didcancel:)-1wqin.md)
