<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSAccessibility-swift.struct/setMayContainProtectedContent(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@F@NSAccessibilitySetMayContainProtectedContent"
  },
  "title" : "setMayContainProtectedContent(_:)"
}
-->

# setMayContainProtectedContent(_:)

Sets whether the app may have protected content.

```
static func setMayContainProtectedContent(_ flag: Bool) -> Bool
```

## Discussion

Uses the value of `flag` to specify whether the app may have protected content. Protected content is identified by a value of <doc://com.apple.documentation/documentation/Swift/true> for `NSAccessibilityContainsProtectedContentAttribute`, but if `NSAccessibilitySetMayContainProtectedContent` returns <doc://com.apple.documentation/documentation/Swift/false>, the value of `NSAccessibilityContainsProtectedContentAttribute` is ignored. This function returns <doc://com.apple.documentation/documentation/Swift/true> on success.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)