ios - Code pattern / snippet for retrieving single column from cloudkit -


i'm building app allows users upload / download info common store. thought cloudkit storage ideal this.

i'd users able search records in store keyword field, download entire record when select one.

in sql terms like:

select id,keywords mydb keywords %searchstring% 

followed by:

select * mydb id = selectedid 

i have been using code pattern retrieve records cloudkit storage:

var publicdatabase: ckdatabase? let container = ckcontainer.defaultcontainer()  override func viewdidload() {     super.viewdidload()     publicdatabase = container.publicclouddatabase }  func performquery(){     let predicate = nspredicate(value: true)     let query = ckquery(recordtype: "library", predicate: predicate)     publicdatabase?.performquery(query, inzonewithid: nil,         completionhandler: ({results, error in          ...         [code handle results / error here]         ...     }) } 

but returns all content of each record lot of unnecessary info.

i'd fetch single field cloudkit records.

is there easy way , have code snippet?

ckfetchrecordsoperation allows downloading of restricted columns requires know ids of records download.

for can use desiredkeys property on ckqueryoperation. more information see: desiredkeys documentation


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -