---
title: SubviewsCollection
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/subviewscollection
---

# SubviewsCollection

An opaque collection representing the subviews of view.

## Declaration

```swift
struct SubviewsCollection
```

## Overview

Overview Subviews collection constructs subviews on demand, so only access the part of the collection you need to create the resulting content. You can get access to a view’s subview collection by using the Group/init(sectionsOf:transform:) initializer. The collection’s elements are the pieces that make up the given view, and the collection as a whole acts as a proxy for the original view.

## Relationships

### Conforms To

- [BidirectionalCollection](swift/bidirectionalcollection.md)
- [Collection](swift/collection.md)
- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [RandomAccessCollection](swift/randomaccesscollection.md)
- [Sequence](swift/sequence.md)
- [View](swiftui/view.md)

## See Also

### Accessing a container’s subviews

- [Subview](swiftui/subview.md)
- [SubviewsCollectionSlice](swiftui/subviewscollectionslice.md)
- [containerValue(_:_:)](swiftui/view/containervalue(_:_:).md)
- [ContainerValues](swiftui/containervalues.md)
- [ContainerValueKey](swiftui/containervaluekey.md)
