-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use .count #14
Comments
You can use the .array property to cast a JSONValue in to an Array. if let boardsArray = boardsJSON["boards"]{
let countOfArray = boardsArray.count //Here you got your count
}
//If you are sure about the stability of your data struct, you can also use:
for board in boardsJSON["boards"].array!{
let name = board["name"].string!
} Hope this help. |
Thanks |
Is there a way to have it support Array(obj) for conversion? |
nghuiqin
pushed a commit
to nghuiqin/SwiftyJSON
that referenced
this issue
Sep 20, 2016
Renamed the Kitura-Build repo to Package-Builder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm using SwiftyJSON in a project where I'm using
to return the following JSON
I can dive down the tree using something like
But if I wanted to iterate over all the names in my JSON how would I get the count of objects in the array?
The text was updated successfully, but these errors were encountered: