Reputation: 2734
I have a SwiftyJSON object representing questions and answers, fetched as JSON from a webserver.
What i would like to achieve, is to add questions to the end of the SwiftyJSON object, taken that the user answers the question wrongly.
I've tried the following
JsonArray[ JsonArray.count+1 ] = JsonArray[CurrentIndex]
But nothing happens at all.
Any ideas?
Thanks in advance
Upvotes: 1
Views: 550
Reputation: 1117
It is surprisingly simple:
let data = JSON(currentdata.arrayObject! + newdata.arrayObject!)
Upvotes: 2