Type Alias

Mirror.Children

The type used to represent substructure.

Declaration

typealias Mirror.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)
    }
}