Type Function Object CloudKitRecord Return value none Revision Release 2025.3721 Keywords iCloud, sync, storage, CloudKit, CloudKitRecord, save See also CloudKitRecord CloudKitRecord:set() iCloud.*
Saves contents of the record to the CloudKit database.
CloudKitRecord:save( params )
Table. Table with
Valid keys for the params table include:
database — Optional string value. If this string is "public", the public database will be used instead of a private database. Records in the public database can be accessed/shared by other users.
containerId — Optional string value indicating a specific iCloud Container. Do not pass this parameter if you have only one iCloud Container associated with your app.
onComplete — Optional listener function to be invoked with an iCloudRecordEvent.
local recordData = {
company = { type="string", string="Corona Labs" },
when = { type="date", time=-1449201382 },
where = { type="location", latitude=37.453139, longitude=122.113451 },
amount = { type="number", number=1 }
}
local record = iCloud.recordCreate(
{
type = "company",
recordName = "Corona Labs 1",
table = recordData
}
)
record:save()