Contextual type ‘AnyObject’ cannot be used with dictionary literal?

You can see that the contents of the array are dictionaries with String keys and unknown values.

Therefore declare the array more specific

var inputsOutputs = [[String:AnyObject]]()

In Swift 3 for JSON collection types or if the dictionary / array contains only value types use

var inputsOutputs = [[String:Any]]()

Leave a Comment

tech