---
title: "loadData(completion:)"
framework: localauthentication
role: symbol
role_heading: Instance Method
path: "localauthentication/lasecret/loaddata(completion:)"
---

# loadData(completion:)

Retrieves data stored in a secret.

## Declaration

```swift
func loadData(completion handler: @escaping @Sendable (Data?, (any Error)?) -> Void)
```

```swift
var rawData: Data { get async throws }
```

## Parameters

- `handler`: A completion handler that provides the data stored in a secret.

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: var rawData: Data { get async throws } For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously.
