iCloud.docWrite()

Type Function
Return value none
Revision Current Public Release (2018.3326)
Keywords iCloud, sync, storage, document, docWrite
See also iCloud.docRead()
iCloudDocEvent
iCloud.*

Overview

Writes data to a specified file and invokes the onComplete listener function with an iCloudDocEvent upon completion.

Syntax

iCloud.docWrite( params )
params (required)

Table. Table containing method-specific parameters — see the next section for details.

Parameter Reference

Valid keys for the params table include:

Example

local function docListener( event )

    if event.isError then
        print( event.error )
        print( event.errorCode )
    end
end

iCloud.docWrite(
    {
        filename = "test.txt",
        contents = "Corona",
        onComplete = docListener
    }
)