---
title: "claimKnownFolders(_:localizedReason:completionHandler:)"
framework: fileprovider
role: symbol
role_heading: Instance Method
path: "fileprovider/nsfileprovidermanager/claimknownfolders(_:localizedreason:completionhandler:)"
---

# claimKnownFolders(_:localizedReason:completionHandler:)

Asks the domain to sync the specified known folders.

## Declaration

```swift
func claimKnownFolders(_ knownFolders: NSFileProviderKnownFolderLocations, localizedReason: String, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func claimKnownFolders(_ knownFolders: NSFileProviderKnownFolderLocations, localizedReason: String) async throws
```

## Discussion

Discussion Use this method to claim a set of known folders according to the information in the knownFolders parameter. The system only enables sync for these folders in the domain if the set of locations is valid and if the user agrees.

## See Also

### Syncing Desktop and Documents folders

- [releaseKnownFolders(_:localizedReason:completionHandler:)](fileprovider/nsfileprovidermanager/releaseknownfolders(_:localizedreason:completionhandler:).md)
- [NSFileProviderKnownFolders](fileprovider/nsfileproviderknownfolders.md)
- [NSFileProviderKnownFolderLocations](fileprovider/nsfileproviderknownfolderlocations.md)
- [NSFileProviderKnownFolderSupporting](fileprovider/nsfileproviderknownfoldersupporting.md)
