> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trycandid.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Hide Sensitive Views in Candid Recordings

> Mask personal and confidential data in Candid recordings while keeping it visible in your app.

Candid records the participant's screen during a session. Use redaction to keep personal and confidential information out of these recordings.

> [!WARNING]
>
> **You must mask all sensitive data.** Before you ship the Candid SDK in your app, review every screen a participant can reach during a study. Mask any view that shows personal or confidential information, such as names, email addresses, phone numbers, addresses, account or payment details, or private messages.

Masked views appear as solid magenta blocks in the recording. Participants still see and use them normally in your app.

> [!NOTE]
>
> Redaction is available from SDK version 0.6.0.

## Mask a SwiftUI view

Add `.candidRedacted()` to the view. Place it after layout modifiers such as `.padding()` or `.frame()` so the mask covers the whole area.

```swift theme={null}
Text(user.email)
    .padding()
    .candidRedacted()
Text(user.socialSecurityNumber)
    .padding()
    .candidRedacted()
```

## Mask a UIKit view

Call `Candid.setRedacted(true, for:)` before the view displays sensitive content:

```swift theme={null}
Candid.setRedacted(true, for: emailLabel)
Candid.setRedacted(true, for: socialSecurityNumberLabel)
```

## Best practices

* **Mask every occurrence.** If the same data appears in several places, mask each view.
* **Mask containers to cover whole sections.** Masking a container hides everything inside it.
* **Use `.candidRedacted()` for Candid recordings.** Apple's `.privacySensitive()` modifier serves a different purpose.
* **Review your recordings.** Run a study on a physical device and watch the recording to confirm that every sensitive view is masked.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.