Answers for "put json array with string in param swift"

0

put json array with string in param swift

var membersArray = [AnyObject]()
 for i in 0..<members.count {
     let json: [String: Any]  = [
         "id_member": members[i].idMember!,
         "email": members[i].email!,
         "id_member_type": "\(Int(members[i].idMemberType)!)",
     ]
     membersArray.append(json as AnyObject)
 }

 let jsonMembers = JSON(membersArray)

 let jsonObject: [String: Any]  = [
     "member" : jsonMembers,
     "name": name!,
     "intention": intention!,
     "id_frequency": frequency!
 ]

 let jsonUpdate = JSON(jsonObject)
Posted by: Guest on June-30-2021

Browse Popular Code Answers by Language