I have;
let parameters =
[
"generalSearchInput": search,
"requireAllWords": true,
"brandOwner": brand,
"includeDataTypes":
{
"Branded": true
}
] as [String : Any]
THE ABOVE OBVIOUSLY DOES NOT WORK, I just do not understand how to do nested.
I am trying to mimic;
{
"generalSearchInput": "SHARP CHEDDAR CHEESE",
"requireAllWords": true,
"brandOwner": "usa",
"includeDataTypes":
{
"Branded": true
}
}
Thanks
Try
let parameters: [String : Any] =
[
"generalSearchInput": search,
"requireAllWords": true,
"brandOwner": brand,
"includeDataTypes":
[
"Branded": true
]
]
In swift dictionary composing a json dictionary is expressed with [:] and array with [ ]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments