You can create a two dimensional array of one type of variable in swift with:
var array2D: [[String]] = [["hi", "bye"], ["hello", "goodbye"]]
I want to create a two dimensional array with the second variable a Float along the following lines:
var array2d2types = [[String,Float]] = [["height",1],["width",2]]
But this gives error: Cannot assign to immutable expression of type '[[Any]]'
How can I create an array of arrays each of which has a String and a Float?
let sizes: [CGSize] = [.init(width: 2, height: 1)]Using width and height may have been misleading These could be any stringand why not to think of them generically what you will do with key names in your app flow ????