One Logo Pool Ball
CloudKit · IOS API REFERENCE

CKAsset

class · iOS 8.0+ · SDK 27.1

class CKAsset

Members (3)

init · iOS 8.0+

init

TypeScript
static initFileURL(fileURL: string): CKAsset
Swift declaration
init(fileURL: URL)
get · iOS 8.0+

fileURL

TypeScript
get fileURL(): (string) | null
Swift declaration
var fileURL: URL? { get }
init · iOS 27.0+

init

TypeScript
static initImporting(exportedAssetID: CKAsset_ExportedAssetID): CKAsset
Swift declaration
convenience init(importing exportedAssetID: CKAsset.ExportedAssetID)

Initialize a new ``CKAsset`` that can be used to create a copy of an asset that already exists in iCloud, potentially in a different container. When this asset is saved, a server-side copy of the referenced asset is created. - Parameters: - exportedAssetID: Identifies the source asset that this ``CKAsset`` will copy. The `exportedAssetID` is only valid on the same device it was created, and it expires after a few days. The new ``CKAsset`` does not reference any data on the local device (its ``fileURL`` is `nil`). When you assign this asset to a field in a ``CKRecord`` and save the record, the CloudKit server creates a new asset by copying the contents of the asset identified by the `exportedAssetID`. If the source asset no longer exists on the server, saving the record fails with ``CKError/Code/unknownItem``. If the `exportedAssetID` is invalid or expired, saving the record fails with ``CKError/Code/assetNotAvailable``. Assets created this way are supported starting with iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, and visionOS 1.0. Devices running older OS versions may fail to download the created asset.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

CKAsset.init()

inherited init: cannot prove legal (class declares 2 custom initializers)

All CloudKit types →