标签: swift casting
我正在尝试使用自定义Struct投射数组到[Any]。
Struct
[Any]
struct CustomStruct {} var cs_array = [CustomStruct]() var arr: [Any] = cs_array as [Any]
我收到错误:CustomStruct is not equal to Any 我无法弄清楚为什么会这样。如果我让CustomStruct成为一个有效的课程。
CustomStruct is not equal to Any
CustomStruct