Repeated
A collection whose elements are all identical.
Declaration
@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"