首先感谢您的光临。目前,我正在尝试查找多维数组的类型。例如,在以下行中,
let example = [[5,2,7],[4,8],[9,1,3]]
你如何确定最底层的类型example
是Int
?
我努力了,
extension Array {
func findType() {
let arrayType = type(of: self).Element.self // Array<Int>
// let realType = array.Element.self // Error
}
}
好像Element
是Element
不存在的。谢谢您的帮助。