<!--
{
  "availability" : [
    "iOS: 27.3.0 -",
    "iPadOS: 27.3.0 -",
    "macCatalyst: -",
    "macOS: 27.3.0 -",
    "tvOS: 27.3.0 -",
    "visionOS: 27.3.0 -",
    "watchOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/ComputedProperty(title:description:authenticationPolicy:visibility:)",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents16ComputedProperty5title11description20authenticationPolicy10visibilityy10Foundation23LocalizedStringResourceVSg_AjA020IntentAuthenticationH0OSgAA0N10VisibilityVSgtcfm"
  },
  "title" : "ComputedProperty(title:description:authenticationPolicy:visibility:)"
}
-->

# ComputedProperty(title:description:authenticationPolicy:visibility:)

A macro that adds a computed app entity property with a get accessor and an optional set accessor.

```
@attached(peer, names: prefixed(`$`), prefixed(`_`)) @attached(accessor, names: named(get), named(set)) macro ComputedProperty(title: LocalizedStringResource? = nil, description: LocalizedStringResource? = nil, authenticationPolicy: IntentAuthenticationPolicy? = nil, visibility: IntentVisibility? = nil)
```

## Parameters

`title`

A localized string resource describing the property for display in the user interface.

`description`

Additional details about this property.

`authenticationPolicy`

The authentication policy to enforce when the system accesses this property, or `nil` to use the entity’s policy.

`visibility`

Whether the property is available to system features, or only to your app, or `nil` for `.default`.

## Example

```swift
struct Restaurant: AppEntity {
    var model: Menu

    @ComputedProperty(title: "Menu Items", description: "The dishes this restaurant currently serves.")
    var menuItems: [MenuItem] {
        model.menuItems
    }
}
```

---

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)