Skip to content

Redacted

Nick Sarno edited this page Apr 3, 2022 · 1 revision

.redacted(if:)

Redact any View based on a Boolean

Text(text)
     .redacted(if: text.isEmpty, style: .placeholder)
  • Use .placeholder for Apple's default redacted state
  • Use .appear to hide the view while redacted
  • Use .opacity to animate the view's opacity from 0 to 1 when changing Boolean's value
public enum RedactedStyle {
    case placeholder
    case opacity
    case appear
    case none
}
Clone this wiki locally