<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSPropertyDescription/isOptional",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPropertyDescription(py)optional"
  },
  "title" : "isOptional"
}
-->

# isOptional

A Boolean value that indicates whether the receiver is optional.

```
var isOptional: Bool { get set }
```

## Discussion

<doc://com.apple.documentation/documentation/Swift/true> if the receiver is optional, otherwise <doc://com.apple.documentation/documentation/Swift/false>. The optionality flag specifies whether a property’s value can be `nil` before an object can be saved to a persistent store.

### Special Considerations

Setting this property raises an exception if the receiver’s model has been used by an object graph manager.

---

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)