StructureSwift

Repeated

A collection whose elements are all identical.

@frozen struct Repeated<Element>

Overview

You create an instance of the Repeated collection by calling the repeatElement(_:count:) function. The following example creates a collection containing the name “Humperdinck” repeated five times:

let repeatedName = repeatElement("Humperdinck", count: 5)
for name in repeatedName {
    print(name)
}
// "Humperdinck"
// "Humperdinck"
// "Humperdinck"
// "Humperdinck"
// "Humperdinck"

Members

Typealiases

  • typealias Index

    A type that represents a valid position in the collection.

  • typealias Indices

    A type that represents the indices that are valid for subscripting the collection, in ascending order.

Instance Subscripts

Instance Properties

Instance Methods

Conforms To

Removed Members

Instance Methods