I can easily write a multi-dimensional array in Swift when all the dimensions are of the same type, for example:
var totalTime : [[Int]]
How would I get the first dimension to be String and the second dimension Int?
I would recommend using an array of tuples instead. What you want could be accomplished using an array of type Any, but it is not a good idea.
Instead, your array should be [[(String, Int)]]. This would also be more compact than what you want to do.
var myArray: [[(String, Int)]] = []
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With