init
TypeScriptstatic initFileURL(fileURL: string): CKAssetSwift declarationinit(fileURL: URL)class · iOS 8.0+ · SDK 27.1
class CKAssetstatic initFileURL(fileURL: string): CKAssetSwift declarationinit(fileURL: URL)get fileURL(): (string) | nullSwift declarationvar fileURL: URL? { get }static initImporting(exportedAssetID: CKAsset_ExportedAssetID): CKAssetSwift declarationconvenience 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.
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)