How To Get The Size Of An Array In Swift | iSwift Cookbook

Comments · 1242 Views

Learn how to get size of an array in swift

“Get size of array

To check the size of an array, we can use its count property.”

“// First, we initialize our example array with some values

let a = [1,2,3]

// Now, let's count how many items we've got

print("The array contains \(a.count) elements")
The array contains 3 elements”