Reputation: 987
My aim is to have an array of empty arrays in swift. Something like this:
[[][][][][]]
They are all of type Game. This is my attempt:
let numberOfDays = 5
var gamesCache: [[Game]] = [](count: numberOfDays, repeatedValue: [])
It comes up with the error. Cannot call value of non function type '[Any]'
Upvotes: 2
Views: 976
Reputation: 72410
Try like this way.
let numberOfDays = 5
var gamesCache = [[Game]](count: numberOfDays, repeatedValue: [])
Upvotes: 7