Get the size of an array


I have an Array and want to calculate its size/capacity (how many elements it contains).


// Initialize the Array
var a = [1,2,3]

// Get the size of the array

let size = a.count


Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)