Structure¶
RedactionReasons¶
The reasons to apply a redaction to data displayed on screen.¶
Declaration¶
struct RedactionReasons : OptionSet
Overview¶
Use this type with the redacted(reason:) view modifier to "redact" a view's contents. For now, that simply means to replace the view with a placeholder.
In the future, this type may get more optionality, but as of now, the only redaction reason is placeholder
See the following example for adding redaction to a view.
struct RedactedView: View {
var body: some View {
VStack {
Label("Taylor Swift", systemImage: "person.fill")
Label("Kanye West", systemImage: "person.fill")
.redacted(reason: .placeholder)
}
}
}

Availability¶
iOS 14.0+
macOS 11.0+
tvOS 14.0+
watchOS 7.0+
Topics¶
Initializer¶
init(rawValue:) Creates a new set from a raw value.
Type Alias¶
ArrayLiteralElement The type of the elements of an array literal.
Element The element type of the option set.
RawValue The raw type that can be used to represent all values of the conforming type.
Instance Property¶
rawValue The raw value.
Type Property¶
placeholder Displayed data should appear as generic placeholders.