I have a [Any]
as the input and would like to know the dimension of the array. For example,
var a = [[[1, 2], [3, 4], [5, 6]]]
The dimension is 3 (3 layer array).
The way I'm using is to use type
to convert it to type and count the number of "Array".
"\(type(of: a))"
$R16: String = "Array<Array<Array<Int>>>"
I wonder is there any better way to achieve my goal.