at first the operation:
operation.recordMatchedBlock = {recordID, result in
switch result{
case .success(let record):
print("RecordID: \(recordID), record: \(record)")
let order = Order()
order.recordID = record.recordID
order.name = record["name"]
order.products = record["products"]
newOrders.append(order)
orders = newOrders
case .failure(let error):
print("failed for \(recordID): \(error)")
}
}
And here is my model:
class Order:NSObject, Identifiable{
var recordID: CKRecord.ID!
var name: String!
var products: [String]?
}
My record from the public database consists of an array(StringList) - "products".
How can I now parse the StringList into my local model? Does anyone know the exact syntax?
Thanks in advance.
