I have several objects
Struct object {
var title:String?
}
var one = object(\"green\")
var two = object(\"black\")
var three = object(\"blue\")
Your value
is an array of object "[object]" but not a string, as defined by your code above:
var dict = ["a":[one, two], "b":[three]]
So you have to process the value as an array of object
to find out what you want.
for (key, value) in dict {
let found = value.filter({ (anObject: object) -> Bool in
return anObject.title!.lowercaseString.containsString("b")
})
if (found.count > 0) {
//you find what you want.
}
}