0

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".

public database

How can I now parse the StringList into my local model? Does anyone know the exact syntax?

Thanks in advance.

New contributor
valentine is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.