Generics call with Type T in Swift

后端 未结 7 994
逝去的感伤
逝去的感伤 2021-02-12 17:14

In my application I want to create an generic method which creates an array of object depening on the given type T.

I created the following function:

fun         


        
相关标签:
7条回答
  • 2021-02-12 18:18

    You should be able to indicate the type with the as keyword: object.getArray("key") as Document[].

    0 讨论(0)
提交回复
热议问题