initialize empty array swift code example
Example 1: swift empty an array
myArray.removeAll()
Example 2: swift initialize array with size
let myArraySize: Int = 42
let myArray: [Int] = [Int](repeating: 0, count: myArraySize)
myArray.removeAll()
let myArraySize: Int = 42
let myArray: [Int] = [Int](repeating: 0, count: myArraySize)