I am very new to Swift and this problem has got me stumped. I am trying to create a two-dimensional map. In init of my Map class, I need to create a two-dimensional array of another class called Grid.
This is what I have right now:
class Map: NSObject {
var squares: [[Grid]]
let MAXROWS = 200
let MAXCOLUMNS = 200
override init(){
for r in 0...MAXROWS{
for c in 0...MAXCOLUMNS{
squares[r][c].append
}
}
}
At the append function, it creates an error:
value of type "Grid" has no member "append"
How do I do this correctly?