<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Layout/Cache",
  "metadataVersion" : "0.1.0",
  "role" : "Associated Type",
  "symbol" : {
    "kind" : "Associated Type",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI6LayoutP5CacheQa"
  },
  "title" : "Cache"
}
-->

# Cache

Cached values associated with the layout instance.

```
associatedtype Cache = Void
```

## Discussion

If you create a cache for your custom layout, you can use
a type alias to define this type as your data storage type.
Alternatively, you can refer to the data storage type directly in all
the places where you work with the cache.

See [`makeCache(subviews:)`](/documentation/SwiftUI/Layout/makeCache(subviews:)) for more information.

---

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)