Reading from the github docs I can see how to use it, but when I try to initialize it (to empty):
var responses: OrderedDictionary = [:]
it says: Empty collection literal requires an explicit type
I tried this:
var responses: OrderedDictionary<String: <TransactionsDataItemsClassAModel>> = [:]
but doesn't work, what's the proper way to initialize this?
This is how I have initialized my non ordered diccionary:
var dataDiccionary: [String: [TransactionsDataItemsClassAModel]] = [:]
Thanks
The regular syntax for generic types is like
Array<T>andDictionary<K, V>ArrayandDictionary:[T]and[K: V].You're confusing some things and combined the two into an an invalid middle-ground.
OrderedDictionarydoesn't have any special short-hands, so you would just treat it like any other generic type. The generic type parameters are specified with a comma separated list: