<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Mirror/Children-swift.typealias",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s6MirrorV8Childrena"
  },
  "title" : "Mirror.Children"
}
-->

# Mirror.Children

The type used to represent substructure.

```
typealias Children = AnyCollection<Mirror.Child>
```

## Discussion

When working with a mirror that reflects a bidirectional or random access
collection, you may find it useful to “upgrade” instances of this type
to `AnyBidirectionalCollection` or `AnyRandomAccessCollection`. For
example, to display the last twenty children of a mirror if they can be
accessed efficiently, you write the following code:

```
if let b = AnyBidirectionalCollection(someMirror.children) {
    for element in b.suffix(20) {
        print(element)
    }
}
```

---

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)