i have declared my array like
var tile = [[Int]]()
and after that i have initialize its value like
for (var index = 0; in
As the commentators @C_X & @MartinR say, your array is empty. Here's how to initialise it as you want...
var tile = [[Int]](count:4, repeatedValue: [Int](count: 4, repeatedValue: 0))
for index in 0 ..< 4 {
for sindex in 0 ..< 4 {
tile[index][sindex] = 0 // no error here now...
print("\(index) \(sindex)")
}
}
...of course, the for loops are now redundant, if you just want zeroes!