<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreAI",
  "identifier" : "/documentation/CoreAI/AIModelCache/init(appGroup:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core AI"
    ],
    "preciseIdentifier" : "s:15CoreAIDelegates12AIModelCacheC8appGroupACSgSS_tcfc"
  },
  "title" : "init(appGroup:)"
}
-->

# init(appGroup:)

Creates a cache that shares specialized assets across an app group.

```
init?(appGroup groupIdentifier: String)
```

## Parameters

`groupIdentifier`

A string that names the group whose shared
cache you want to obtain. This input should exactly match one of the strings
in the app’s App Groups Entitlement.

## Return Value

The shared app group cache, or `nil` when the group identifier is invalid
(on iOS), the app group container cannot be accessed, or entitlement checks fail.

## Discussion

Use this initializer when multiple apps within an app group need to
share a cache for their specialized assets. This allows all apps within
an app group to avoid each performing their own specialization for a
shared model.

---

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)