StructureSwift5.9.0

    Repeated

    A collection whose elements are all identical.

    @frozen struct Repeated<Element>

    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"

    Citizens in Swift

    Conformances

    Members

    Features

    Citizens in Swift

    where Element:Sendable

    Conformances

    • protocol Sendable

      A type whose values can safely be passed across concurrency domains by copying.

    Available in Foundation

    where Element == UInt8

    Conformances

    Members

    Features