Tuesday, March 29, 2016

Array of arrays - Multidimensional array

The following code has been tested with Xcode 7.3 playground:

let array : [[Int]] = [[1, 2, 3],[4, 5, 6]]

let element = array[0]

let digit1 = element[0]

let digit2 = array[0][1]

Result:


No comments:

Post a Comment