Swift инициализируйте массив с размером
let myArraySize: Int = 42
let myArray: [Int] = [Int](repeating: 0, count: myArraySize)
Adventurous Anteater
let myArraySize: Int = 42
let myArray: [Int] = [Int](repeating: 0, count: myArraySize)