<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecCodeSignatureFlags/forceHard",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@E@SecCodeSignatureFlags@kSecCodeSignatureForceHard"
  },
  "title" : "forceHard"
}
-->

# forceHard

Always set the [`hard`](/documentation/Security/SecCodeStatus/hard) status flag on launch.

```
static var forceHard: SecCodeSignatureFlags { get }
```

## Discussion

The `kSecCodeStatusHard` flag indicates that the code prefers to be denied access to a resource if gaining such access would cause its invalidation. Once the hard bit is set, it cannot be cleared. Therefore, setting this option flag guarantees that the code will always have the `kSecCodeStatusHard` flag set.

---

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)