Hi i am trying to give to alamofire parameters called "Dict" that are in dictionary...dictionary can contain 3 or X items. I am trying to use FOR cycle to ad dictionary to another one set of items, but...it only shows the last one...that seems it override the previous one. I tried everything I know...Even try to use SwiftyJSON framework....but alamofire only take pure dictionary type.
var Dict = [[String: Any]]()
Dict.removeAll()
for (index, value) in _SurveySubmitModel.enumerated() {
print("Item \(index + 1): \(value)")
let parameters: [String: Any] = [
"ID": value.ID,
"SurveyID": value.SurveyID,
"QuestionID": value.QuestionID,
"FilledBy": value.FilledBy,
"Response": value.Response
]
Dict.append(parameters)
}
print("Dict = \(Dict)")
well I need something like this
[{
"ID": 0,
"SurveyID": 25,
"QuestionID": 28,
"FilledBy": 7335,
"Response": "1In the two weeks before you felt sick, did you:"
},
{
"ID": 0,
"SurveyID": 25,
"QuestionID": 28,
"FilledBy": 7335,
"Response": "1In the two weeks before you felt sick, did you:"
}
]