redacted
Adds a redaction reason to this view hierarchy, replacing rendered content with placeholders. Useful for skeleton loading states. Maps to SwiftUI's redacted(reason:).
redacted(reasons)
| Parameter | Type | Description |
|---|---|---|
reasons(optional) | 'placeholder' | 'privacy' | 'invalidated' | ('placeholder' | 'privacy' | 'invalidated')[] | The redaction reason or reasons to apply (an empty array applies none). Defaults to 'placeholder'. Default: 'placeholder' |
Adds a redaction reason to this view hierarchy, replacing rendered content with placeholders. Useful for skeleton loading states. Maps to SwiftUI's redacted(reason:).
placeholder redacts the whole subtree; privacy and invalidated redact only descendants marked privacySensitive() or invalidatableContent(). Reasons are additive and can be combined in an array; use unredacted() to exempt a subtree. The invalidated reason requires iOS 17+.
Returns: ModifierConfig
See: Official SwiftUI documentation.
Works with
This modifier works with any view. These components accept it:
- VStack
- HStack
- ZStack
- LazyVStack
- LazyHStack
- Group
- Spacer
- Divider
- Overlay
- ScrollView
- Button
- Toggle
- Checkbox
- Slider
- Picker
- DatePicker
- ColorPicker
- Link
- ControlGroup
- Menu
- ContextMenu
- TextField
- SecureField
- Text
- Label
- Image
- List
- Form
- Section
- DisclosureGroup
- SwipeActions
- BottomSheet
- Alert
- ConfirmationDialog
- Popover
- ProgressView
- Gauge
- TabView
- AccessoryWidgetBackground
Sources
The original Expo docs for this page:
- redacted (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)