sffsf sffsf - 1 month ago 5x
Swift Question

Swift2 check array in dictionary

I am trying to create case in one line but I can not find how can I do that

I need to write that code in one line

if let holdings = i["holdings"] as Array where !holdings.isEmpty {

any ideas?

ohr ohr

AnyObject since your didn't specify what was inside your array.

if let holdings = i["key"] as? [AnyObject] where !holdings.isEmpty


if let holdings = i["key"] as? Array<AnyObject> where !holdings.isEmpty