---
title: "unloadResource(resource:options:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsunaryfilesystemoperations/unloadresource(resource:options:replyhandler:)"
---

# unloadResource(resource:options:replyHandler:)

Requests that the file system unload the specified resource.

## Declaration

```swift
func unloadResource(resource: FSResource, options: FSTaskOptions, replyHandler reply: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func unloadResource(resource: FSResource, options: FSTaskOptions) async throws
```

## Parameters

- `resource`: An doc://FSKit/documentation/FSKit/FSResource to unload.
- `options`: An doc://FSKit/documentation/FSKit/FSTaskOptions object specifying options to apply when unloading the resource.
- `reply`: A block or closure that your implementation invokes when it finishes unloading or encounters an error. If unloading fails, pass an error as the parameter to describe the problem. Otherwise, pass nil.

## See Also

### Loading and unloading resources

- [loadResource(resource:options:replyHandler:)](fskit/fsunaryfilesystemoperations/loadresource(resource:options:replyhandler:).md)
- [didFinishLoading()](fskit/fsunaryfilesystemoperations/didfinishloading().md)
