---
title: "init(appGroup:)"
framework: coreai
role: symbol
role_heading: Initializer
path: "coreai/aimodelcache/init(appgroup:)"
---

# init(appGroup:)

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

## Declaration

```swift
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.

## Mentioned in

Managing model specialization and caching

## Return Value

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

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.
