My data contains user data of various values (which I can parse out) then balances for each user in a number of currencies.
I can parse out the user data. For example:
if let add2 = parsed["address"] as? String {
println("Alert: \(add2)")
}
I can get the lists of balances:
if let findbalances = parsed["balances"]{
println("find the balances: \(findbalances)")
and I can get the individual values:
var balance11:Double = findbalances[0]["available_amount"] as! Double/100
var curr11:String = findbalances[0]["currency"] as! String
The array is AnyObject. If I try:
for currency in findbalances {
I get
Type AnyObject does not conform to Sequence
So then I tried to downcast it to String:
if let findbalances = parsed["balances"] as? String {
for currency in findbalances {
and my output is blank.
Yet I know the values are there.
I am stumped; how do you loop through an AnyObject Array in Swift?