AnyObject and Any in Swift

AnyObject is only for reference types (classes), Any is for both value and reference types. So you should go for [String: Any]. Type Casting for Any and AnyObject Swift provides two special types for working with nonspecific types: Any can represent an instance of any type at all, including function types. AnyObject can represent an … Read more