Contents

privacySensitive(_:)

Marks the view as containing sensitive, private user data.

Declaration

nonisolated func privacySensitive(_ sensitive: Bool = true) -> some View

Discussion

SwiftUI redacts views marked with this modifier when you apply the privacy redaction reason.

struct BankAccountView: View {
    var body: some View {
        VStack {
            Text("Account #")

            Text(accountNumber)
                .font(.headline)
                .privacySensitive() // Hide only the account number.
        }
    }
}

See Also

Redacting private content