---
title: "finishLoading(with:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avassetresourceloadingrequest/finishloading(with:)"
---

# finishLoading(with:)

Causes the receiver to handle the failure to load a resource for which a resource loader’s delegate took responsibility.

## Declaration

```swift
func finishLoading(with error: (any Error)?)
```

## Parameters

- `error`: An error object indicating the reason for the failure.

## Discussion

Discussion When a resource loader’s delegate takes responsibility for loading a resource, it calls this method when a failure occurred when loading the resource. This method marks the loading request as finished and notifies the resource loader object that the resource could not be loaded.

## See Also

### Reporting the result of the request

- [response](avfoundation/avassetresourceloadingrequest/response.md)
- [finishLoading()](avfoundation/avassetresourceloadingrequest/finishloading().md)
- [isCancelled](avfoundation/avassetresourceloadingrequest/iscancelled.md)
- [isFinished](avfoundation/avassetresourceloadingrequest/isfinished.md)
- [finishLoading(with:data:redirect:)](avfoundation/avassetresourceloadingrequest/finishloading(with:data:redirect:).md)
