-
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
It seems not easy to manipulate an array or dictionary? #110
Comments
Having the exact same issue. |
Figured it out! On your returned JSON object, just call the optional vars If your object is an array and you rightfully call Array Example let json = JSON(data: data)
let array = json.array // Returns an [AnyObject]?, which means you'll get an [AnyObject] or nil Dictionary Example let json = JSON(data: data)
let dictionary = json.dictionary // Returns an [String: JSON]?, which means you'll get an [String: JSON] or nil |
@ArtSabintsev but array is immutable, you cannot append to it |
Then you can make a new immutable array and populate it with the data in the immutable array. |
I'm having the same problem. I just cannot get the JSON to update.
|
for example, delete one item, append one item. the setter can change the whole array or dictionary. but how can i just manipulate an array or dictionary?
The text was updated successfully, but these errors were encountered: