實例方法
privacy
privacySensitive(_:)
將視圖標記為包含敏感的私有用戶數據。
聲明
func privacySensitive(_ sensitive: Bool = true) -> some View
詳述
當您應用RedactionReasons/privacy
編輯原因時,SwiftUI 會編輯標記有此修飾符的視圖。
struct BankAccountView: View {
var body: some View {
VStack {
Text("Account #")
Text(accountNumber)
.font(.headline)
.privacySensitive() // Hide only the account number.
}
}
}
可用版本
iOS 15.0+, iPadOS 15.0+, macOS 12.0+, Mac Catalyst 15.0+, tvOS 15.0+, watchOS 8.0+
相關用法
- Swift Never previewDisplayName(_:)用法及代碼示例
- Swift Never progressViewStyle(_:)用法及代碼示例
- Swift Never projectionEffect(_:)用法及代碼示例
- Swift Never previewLayout(_:)用法及代碼示例
- Swift Never previewDevice(_:)用法及代碼示例
- Swift Never preferredColorScheme(_:)用法及代碼示例
- Swift Never prefersDefaultFocus(_:in:)用法及代碼示例
- Swift Never previewInterfaceOrientation(_:)用法及代碼示例
- Swift Never pageCommand(value:in:step:)用法及代碼示例
- Swift Never position(x:y:)用法及代碼示例
- Swift Never position(_:)用法及代碼示例
- Swift Never popover(isPresented:attachmentAnchor:arrowEdge:content:)用法及代碼示例
- Swift Never padding(_:_:)用法及代碼示例
- Swift Never popover(item:attachmentAnchor:arrowEdge:content:)用法及代碼示例
- Swift Never padding(_:)用法及代碼示例
- Swift Never opacity(_:)用法及代碼示例
- Swift Never colorMultiply(_:)用法及代碼示例
- Swift Never accessibilityAction(action:label:)用法及代碼示例
- Swift Never alert(isPresented:error:actions:message:)用法及代碼示例
- Swift Never confirmationDialog(_:isPresented:titleVisibility:actions:)用法及代碼示例
- Swift Never flipsForRightToLeftLayoutDirection(_:)用法及代碼示例
- Swift Never luminanceToAlpha()用法及代碼示例
- Swift Never accessibilityAction(_:_:)用法及代碼示例
- Swift Never badge(_:)用法及代碼示例
- Swift Never buttonStyle(_:)用法及代碼示例
注:本文由純淨天空篩選整理自apple.com大神的英文原創作品 Never privacySensitive(_:)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。