<!--
{
  "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/LayoutSubviews",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI14LayoutSubviewsV"
  },
  "title" : "LayoutSubviews"
}
-->

# LayoutSubviews

A collection of proxy values that represent the subviews of a layout view.

```
struct LayoutSubviews
```

## Overview

You receive a `LayoutSubviews` input to your implementations of
[`Layout`](/documentation/SwiftUI/Layout) protocol methods, like
[`placeSubviews(in:proposal:subviews:cache:)`](/documentation/SwiftUI/Layout/placeSubviews(in:proposal:subviews:cache:)) and
[`sizeThatFits(proposal:subviews:cache:)`](/documentation/SwiftUI/Layout/sizeThatFits(proposal:subviews:cache:)). The `subviews`
parameter (which the protocol aliases to the [`Layout.Subviews`](/documentation/SwiftUI/Layout/Subviews) type)
is a collection that contains proxies for the layout’s subviews (of type
[`LayoutSubview`](/documentation/SwiftUI/LayoutSubview)). The proxies appear in the collection in the same
order that they appear in the [`ContentBuilder`](/documentation/SwiftUI/ContentBuilder) input to the layout
container. Use the proxies to perform layout operations.

Access the proxies in the collection as you would the contents of any
Swift random-access collection. For example, you can enumerate all of the
subviews and their indices to inspect or operate on them:

```
for (index, subview) in subviews.enumerated() {
    // ...
}
```

## Topics

### Getting the layout direction

[`var layoutDirection: LayoutDirection`](/documentation/SwiftUI/LayoutSubviews/layoutDirection)

The layout direction inherited by the container view.

### Accessing subviews

[`subscript(_:)`](/documentation/SwiftUI/LayoutSubviews/subscript(_:))

Gets the subview proxies in the specified range.

[`var startIndex: Int`](/documentation/SwiftUI/LayoutSubviews/startIndex)

The index of the first subview.

[`var endIndex: Int`](/documentation/SwiftUI/LayoutSubviews/endIndex)

An index that’s one higher than the last subview.

[`typealias Element`](/documentation/SwiftUI/LayoutSubviews/Element)

A type that contains a proxy value.

[`typealias Index`](/documentation/SwiftUI/LayoutSubviews/Index)

A type that you can use to index proxy values.

[`typealias SubSequence`](/documentation/SwiftUI/LayoutSubviews/SubSequence)

A type that contains a subsequence of proxy values.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sequence`](/documentation/Swift/Sequence)

[`Collection`](/documentation/Swift/Collection)

[`Equatable`](/documentation/Swift/Equatable)

[`BidirectionalCollection`](/documentation/Swift/BidirectionalCollection)

[`Sendable`](/documentation/Swift/Sendable)

[`RandomAccessCollection`](/documentation/Swift/RandomAccessCollection)

---

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)