I already used another post to solver part of the problem,so now I am able to wait the end of the request. I made a http request with Almofire and parse the resulting JSON file.
You are creating the Card
instance at the wrong place.
Before the inner repeat loop you are creating one instance and appending the same instance to the allCard
array. If Card
is a class (reference semantics) all occurrences of that instance contain the same data (the last loop item).
Put the two lines in the repeat loop.
//Write the updateJSONCards method here:
func updateJSONCards(json: JSON) {
//create the cards
for (set, value) in json {
if !json[set].isEmpty {
for i in 0..