Skip to content

Instantly share code, notes, and snippets.

@mitulmanish
Created July 6, 2016 07:11
Show Gist options
  • Save mitulmanish/9c647c232b19159547921f90e715b3d4 to your computer and use it in GitHub Desktop.
Save mitulmanish/9c647c232b19159547921f90e715b3d4 to your computer and use it in GitHub Desktop.
Two Dimensional array iteration in Swift 3 (Java Style)
var twoDimArray: [[Int]] = [ [1, 11], [2, 22] ]
for x in 0 ..< twoDimArray.count {
for y in 0 ..< twoDimArray[x].count {
print("vector[\(x), \(y)] = \(twoDimArray[x][y])" )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment