Trying to pass a generated sequence (could be more complex struct or func values), like generation of some key strings during array initialize.
Here's an array initialization string:
let MyArray: Array<Int> = Array<Int>(count: 100, repeatedValue:(for i in 0...99))
// it does not work, I am doing it wrong :(
// instead of (for i in 0...99) could be anything, a key sequence generator
Here's what documentation says:
/// Construct a Array of `count` elements, each initialized to
/// `repeatedValue`.
init(count: Int, repeatedValue: T)
What would be a proper way to replace the "T" with generated or sequenced values. Or should I not bother with this and make array a variable and just fill it later on?
Thanks.