Documentation
¶
Overview ¶
Package cloudkit provides Go bindings for the CloudKit framework.
Store structured app and user data in iCloud containers that all users of your app can share.
The CloudKit framework provides interfaces for moving data between your app and your iCloud containers. You use CloudKit to store your app’s existing data in the cloud so that the user can access it on multiple devices. You can also store data in a public area where all users can access it.
Essentials ¶
- Deciding whether CloudKit is right for your app: Explore the various options you have for using iCloud to store and sync your app’s data.
- Enabling CloudKit in Your App: Configure your app to store data in iCloud using CloudKit.
Schemas ¶
- Designing and Creating a CloudKit Database: Create a schema to store your app’s objects as records in iCloud using CloudKit.
- Managing iCloud Containers with CloudKit Database App: Inspect and modify the schema and data for your app’s iCloud container.
- CKRecordZone: A database partition that contains related records.
- CKRecord: A collection of key-value pairs that store your app’s data. (CKRecordKeyValueSetting, CKRecordValue)
- CKReference: A relationship between two records in a record zone.
- CKAsset: An external file that belongs to a record.
- Integrating a Text-Based Schema into Your Workflow: Define and update your schema with the CloudKit Schema Language.
Records ¶
- Local Records: Manipulate records on-device and save changes to the server. (CKModifyRecordZonesOperation, CKModifyRecordsOperation, CKFetchRecordZonesOperation, CKFetchRecordsOperation, CKQuery)
- Remote Records: Use subscriptions and change tokens to efficiently manage modifications to remote records. (CKDatabaseSubscription, CKDatabaseNotification, CKFetchDatabaseChangesOperation, CKRecordZoneSubscription, CKRecordZoneNotification)
- CKSyncEngine: An object that manages the synchronization of local and remote record data. (CKSyncEngineConfiguration, CKSyncEngineState, CKSyncEngineDelegate, CKSyncEngineFetchChangesOptions, CKSyncEngineSendChangesOptions)
- Shared Records: Share one or more records with other iCloud users. (CKShare, CKAllowedSharingOptions, CKSystemSharingUIObserver, CKFetchShareMetadataOperation, CKAcceptSharesOperation)
User discovery ¶
- CKUserIdentity: The identity of a user.
- CKUserIdentityLookupInfo: The criteria to use when searching for discoverable iCloud users.
Core objects ¶
- CKContainer: A conduit to your app’s databases. (CKAccountStatus)
- CKDatabase: An object that represents a collection of record zones and subscriptions.
- CKOperationGroup: An explicit association between two or more operations.
- CKRecordValue: The protocol that provides strong type-checking for objects that the CloudKit framework stores on the server.
Privacy ¶
- Encrypting User Data: Deploy industry-standard security technologies using CloudKit encryption.
- Providing User Access to CloudKit Data: Provide users access to the data your app stores on their behalf.
- Changing Access Controls on User Data: Restrict access to or remove restrictions from a user’s data at their request.
- CKFetchWebAuthTokenOperation: An operation that creates an authentication token for use with CloudKit web services.
- Responding to Requests to Delete Data: Provide options for users to delete their CloudKit data from your app.
- Identifying an App’s Containers: Use Xcode’s Project navigator to find the identifiers of active CloudKit containers.
Errors ¶
- CKErrorDomain: The error domain for CloudKit errors.
- CKErrorCode: The error codes that CloudKit returns.
- CKErrorRetryAfterKey: The key to retrieve the number of seconds to wait before you retry a request.
- CKErrorUserDidResetEncryptedDataKey: The key that determines whether CloudKit deletes a record zone because of a user action.
- CKPartialErrorsByItemIDKey: The key to retrieve partial errors.
- Record Changed Error Keys: Constants that represent conflicting records in a save operation.
Classes ¶
- CKShareAccessRequester
- CKShareBlockedIdentity
- CKShareRequestAccessOperation
- CKSyncEngineFetchChangesContext: The context of an attempt to fetch changes from the server.
- CKSyncEngineFetchChangesScope: A scope in which the sync engine will fetch changes from the server.
- CKSyncEngineSendChangesScope: A scope in which the sync engine will send changes to the server.
Macros ¶
- CKSHARE_REQUEST_ACCESS_INTERFACES_AVAILABILITY
- CK_EXTERN
- CK_EXTERN_HIDDEN
- CK_HIDDEN
- CK_NEWLY_UNAVAILABLE
- CK_SHARE_ACCESS_REQUESTER_AVAILABILITY
- CK_SHARE_BLOCKED_IDENTITY_AVAILABILITY
- CK_SUBCLASSING_DEPRECATED
- CK_SUBCLASSING_EXTERNALLY_RESTRICTED
- CK_SUBCLASSING_RESTRICTED
- CK_SWIFT_AVAILABILITY
- CK_SWIFT_DEPRECATED
- CK_UNAVAILABLE
Enumerations ¶
Key Types ¶
- CKShare - A specialized record type that manages a collection of shared records.
- CKContainer - A conduit to your app’s databases.
- CKNotification - The abstract base class for CloudKit notifications.
- CKRecord - A collection of key-value pairs that store your app’s data.
- CKNotificationInfo - An object that describes the configuration of a subscription’s push notifications.
- CKSyncEngineEvent - An event that occurs during a sync operation.
- CKDatabase - An object that represents a collection of record zones and subscriptions.
- CKFetchDatabaseChangesOperation - An operation that fetches database changes.
- CKOperation - The abstract base class for all operations that execute in a database.
- CKModifyRecordsOperation - An operation that modifies one or more records.
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- Variables
- func NewCKAccountStatusErrorBlock(handler CKAccountStatusErrorHandler) (objc.ID, func())
- func NewCKRecordErrorBlock(handler CKRecordErrorHandler) (objc.ID, func())
- func NewCKRecordFloat64Block(handler CKRecordFloat64Handler) (objc.ID, func())
- func NewCKRecordIDBlock(handler CKRecordIDHandler) (objc.ID, func())
- func NewCKRecordIDErrorBlock(handler CKRecordIDErrorHandler) (objc.ID, func())
- func NewCKRecordIDFloat64Block(handler CKRecordIDFloat64Handler) (objc.ID, func())
- func NewCKRecordZoneArrayErrorBlock(handler CKRecordZoneArrayErrorHandler) (objc.ID, func())
- func NewCKRecordZoneErrorBlock(handler CKRecordZoneErrorHandler) (objc.ID, func())
- func NewCKRecordZoneIDBlock(handler CKRecordZoneIDHandler) (objc.ID, func())
- func NewCKRecordZoneIDCKServerChangeTokenDataBlock(handler CKRecordZoneIDCKServerChangeTokenDataHandler) (objc.ID, func())
- func NewCKRecordZoneIDErrorBlock(handler CKRecordZoneIDErrorHandler) (objc.ID, func())
- func NewCKServerChangeTokenBlock(handler CKServerChangeTokenHandler) (objc.ID, func())
- func NewCKShareErrorBlock(handler CKShareErrorHandler) (objc.ID, func())
- func NewCKShareMetadataErrorBlock(handler CKShareMetadataErrorHandler) (objc.ID, func())
- func NewCKShareParticipantErrorBlock(handler CKShareParticipantErrorHandler) (objc.ID, func())
- func NewCKSubscriptionArrayErrorBlock(handler CKSubscriptionArrayErrorHandler) (objc.ID, func())
- func NewCKSubscriptionErrorBlock(handler CKSubscriptionErrorHandler) (objc.ID, func())
- func NewCKUserIdentityArrayErrorBlock(handler CKUserIdentityArrayErrorHandler) (objc.ID, func())
- func NewCKUserIdentityBlock(handler CKUserIdentityHandler) (objc.ID, func())
- func NewCKUserIdentityCKUserIdentityLookupInfoBlock(handler CKUserIdentityCKUserIdentityLookupInfoHandler) (objc.ID, func())
- func NewCKUserIdentityErrorBlock(handler CKUserIdentityErrorHandler) (objc.ID, func())
- func NewErrorBlock(handler ErrorHandler) (objc.ID, func())
- func NewVoidBlock(handler VoidHandler) (objc.ID, func())
- type CKAcceptSharesOperation
- func (c CKAcceptSharesOperation) Autorelease() CKAcceptSharesOperation
- func (c CKAcceptSharesOperation) Init() CKAcceptSharesOperation
- func (c CKAcceptSharesOperation) InitWithShareMetadatas(shareMetadatas []CKShareMetadata) CKAcceptSharesOperation
- func (c CKAcceptSharesOperation) SetShareMetadatas(value []CKShareMetadata)
- func (c CKAcceptSharesOperation) ShareMetadatas() []CKShareMetadata
- type CKAcceptSharesOperationClass
- type CKAccountStatus
- type CKAccountStatusErrorHandler
- type CKAllowedSharingOptions
- func CKAllowedSharingOptionsFromID(id objc.ID) CKAllowedSharingOptions
- func NewCKAllowedSharingOptions() CKAllowedSharingOptions
- func NewCKAllowedSharingOptionsWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions(allowedParticipantPermissionOptions CKSharingParticipantPermissionOption, ...) CKAllowedSharingOptions
- func NewCKAllowedSharingOptionsWithCoder(coder foundation.INSCoder) CKAllowedSharingOptions
- func (c CKAllowedSharingOptions) AllowedParticipantAccessOptions() CKSharingParticipantAccessOption
- func (c CKAllowedSharingOptions) AllowedParticipantPermissionOptions() CKSharingParticipantPermissionOption
- func (c CKAllowedSharingOptions) AllowsAccessRequests() bool
- func (c CKAllowedSharingOptions) AllowsParticipantsToInviteOthers() bool
- func (c CKAllowedSharingOptions) Autorelease() CKAllowedSharingOptions
- func (c CKAllowedSharingOptions) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKAllowedSharingOptions) Init() CKAllowedSharingOptions
- func (c CKAllowedSharingOptions) InitWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions(allowedParticipantPermissionOptions CKSharingParticipantPermissionOption, ...) CKAllowedSharingOptions
- func (c CKAllowedSharingOptions) InitWithCoder(coder foundation.INSCoder) CKAllowedSharingOptions
- func (c CKAllowedSharingOptions) SetAllowedParticipantAccessOptions(value CKSharingParticipantAccessOption)
- func (c CKAllowedSharingOptions) SetAllowedParticipantPermissionOptions(value CKSharingParticipantPermissionOption)
- func (c CKAllowedSharingOptions) SetAllowsAccessRequests(value bool)
- func (c CKAllowedSharingOptions) SetAllowsParticipantsToInviteOthers(value bool)
- type CKAllowedSharingOptionsClass
- type CKApplicationPermissionBlockdeprecated
- type CKApplicationPermissionStatus
- type CKApplicationPermissions
- type CKAsset
- type CKAssetClass
- type CKContainer
- func (c CKContainer) AcceptShareMetadata(ctx context.Context, metadata ICKShareMetadata) (*CKShare, error)
- func (c CKContainer) AcceptShareMetadataCompletionHandler(metadata ICKShareMetadata, completionHandler CKShareErrorHandler)
- func (c CKContainer) AccountStatus(ctx context.Context) (CKAccountStatus, error)
- func (c CKContainer) AccountStatusWithCompletionHandler(completionHandler CKAccountStatusErrorHandler)
- func (c CKContainer) AddOperation(operation ICKOperation)
- func (c CKContainer) Autorelease() CKContainer
- func (c CKContainer) ContainerIdentifier() string
- func (c CKContainer) DatabaseWithDatabaseScope(databaseScope CKDatabaseScope) ICKDatabase
- func (c CKContainer) FetchShareMetadataWithURL(ctx context.Context, url foundation.NSURL) (*CKShareMetadata, error)
- func (c CKContainer) FetchShareMetadataWithURLCompletionHandler(url foundation.NSURL, completionHandler CKShareMetadataErrorHandler)
- func (c CKContainer) FetchShareParticipantWithEmailAddress(ctx context.Context, emailAddress string) (*CKShareParticipant, error)
- func (c CKContainer) FetchShareParticipantWithEmailAddressCompletionHandler(emailAddress string, completionHandler CKShareParticipantErrorHandler)
- func (c CKContainer) FetchShareParticipantWithPhoneNumber(ctx context.Context, phoneNumber string) (*CKShareParticipant, error)
- func (c CKContainer) FetchShareParticipantWithPhoneNumberCompletionHandler(phoneNumber string, completionHandler CKShareParticipantErrorHandler)
- func (c CKContainer) FetchShareParticipantWithUserRecordID(ctx context.Context, userRecordID ICKRecordID) (*CKShareParticipant, error)
- func (c CKContainer) FetchShareParticipantWithUserRecordIDCompletionHandler(userRecordID ICKRecordID, completionHandler CKShareParticipantErrorHandler)
- func (c CKContainer) FetchUserRecordID(ctx context.Context) (*CKRecordID, error)
- func (c CKContainer) FetchUserRecordIDWithCompletionHandler(completionHandler CKRecordIDErrorHandler)
- func (c CKContainer) Init() CKContainer
- func (c CKContainer) PrivateCloudDatabase() ICKDatabase
- func (c CKContainer) PublicCloudDatabase() ICKDatabase
- func (c CKContainer) SharedCloudDatabase() ICKDatabase
- type CKContainerClass
- type CKDatabase
- func (c CKDatabase) AddOperation(operation ICKDatabaseOperation)
- func (c CKDatabase) Autorelease() CKDatabase
- func (c CKDatabase) DatabaseScope() CKDatabaseScope
- func (c CKDatabase) DeleteRecordWithID(ctx context.Context, recordID ICKRecordID) (*CKRecordID, error)
- func (c CKDatabase) DeleteRecordWithIDCompletionHandler(recordID ICKRecordID, completionHandler CKRecordIDErrorHandler)
- func (c CKDatabase) DeleteRecordZoneWithID(ctx context.Context, zoneID ICKRecordZoneID) (*CKRecordZoneID, error)
- func (c CKDatabase) DeleteRecordZoneWithIDCompletionHandler(zoneID ICKRecordZoneID, completionHandler CKRecordZoneIDErrorHandler)
- func (c CKDatabase) FetchAllRecordZones(ctx context.Context) ([]CKRecordZone, error)
- func (c CKDatabase) FetchAllRecordZonesWithCompletionHandler(completionHandler CKRecordZoneArrayErrorHandler)
- func (c CKDatabase) FetchAllSubscriptions(ctx context.Context) ([]CKSubscription, error)
- func (c CKDatabase) FetchAllSubscriptionsWithCompletionHandler(completionHandler CKSubscriptionArrayErrorHandler)
- func (c CKDatabase) FetchRecordWithID(ctx context.Context, recordID ICKRecordID) (*CKRecord, error)
- func (c CKDatabase) FetchRecordWithIDCompletionHandler(recordID ICKRecordID, completionHandler CKRecordErrorHandler)
- func (c CKDatabase) FetchRecordZoneWithID(ctx context.Context, zoneID ICKRecordZoneID) (*CKRecordZone, error)
- func (c CKDatabase) FetchRecordZoneWithIDCompletionHandler(zoneID ICKRecordZoneID, completionHandler CKRecordZoneErrorHandler)
- func (c CKDatabase) Init() CKDatabase
- func (c CKDatabase) SaveRecord(ctx context.Context, record ICKRecord) (*CKRecord, error)
- func (c CKDatabase) SaveRecordCompletionHandler(record ICKRecord, completionHandler CKRecordErrorHandler)
- func (c CKDatabase) SaveRecordZone(ctx context.Context, zone ICKRecordZone) (*CKRecordZone, error)
- func (c CKDatabase) SaveRecordZoneCompletionHandler(zone ICKRecordZone, completionHandler CKRecordZoneErrorHandler)
- func (c CKDatabase) SaveSubscription(ctx context.Context, subscription ICKSubscription) (*CKSubscription, error)
- func (c CKDatabase) SaveSubscriptionCompletionHandler(subscription ICKSubscription, completionHandler CKSubscriptionErrorHandler)
- type CKDatabaseClass
- type CKDatabaseNotification
- type CKDatabaseNotificationClass
- type CKDatabaseOperation
- type CKDatabaseOperationClass
- type CKDatabaseScope
- type CKDatabaseSubscription
- type CKDatabaseSubscriptionClass
- type CKDiscoverAllUserIdentitiesOperation
- func (c CKDiscoverAllUserIdentitiesOperation) Autorelease() CKDiscoverAllUserIdentitiesOperation
- func (c CKDiscoverAllUserIdentitiesOperation) Init() CKDiscoverAllUserIdentitiesOperation
- func (c CKDiscoverAllUserIdentitiesOperation) SetUserIdentityDiscoveredBlock(value CKUserIdentityHandler)
- func (c CKDiscoverAllUserIdentitiesOperation) UserIdentityDiscoveredBlock() CKUserIdentityHandler
- type CKDiscoverAllUserIdentitiesOperationClass
- type CKDiscoverUserIdentitiesOperation
- func CKDiscoverUserIdentitiesOperationFromID(id objc.ID) CKDiscoverUserIdentitiesOperation
- func NewCKDiscoverUserIdentitiesOperation() CKDiscoverUserIdentitiesOperation
- func NewCKDiscoverUserIdentitiesOperationWithUserIdentityLookupInfos(userIdentityLookupInfos []CKUserIdentityLookupInfo) CKDiscoverUserIdentitiesOperation
- func (c CKDiscoverUserIdentitiesOperation) Autorelease() CKDiscoverUserIdentitiesOperation
- func (c CKDiscoverUserIdentitiesOperation) Init() CKDiscoverUserIdentitiesOperation
- func (c CKDiscoverUserIdentitiesOperation) SetUserIdentityDiscoveredBlock(value CKUserIdentityCKUserIdentityLookupInfoHandler)
- func (c CKDiscoverUserIdentitiesOperation) SetUserIdentityLookupInfos(value []CKUserIdentityLookupInfo)
- func (c CKDiscoverUserIdentitiesOperation) UserIdentityDiscoveredBlock() CKUserIdentityCKUserIdentityLookupInfoHandler
- func (c CKDiscoverUserIdentitiesOperation) UserIdentityLookupInfos() []CKUserIdentityLookupInfo
- type CKDiscoverUserIdentitiesOperationClass
- type CKErrorCode
- type CKFetchDatabaseChangesOperation
- func CKFetchDatabaseChangesOperationFromID(id objc.ID) CKFetchDatabaseChangesOperation
- func NewCKFetchDatabaseChangesOperation() CKFetchDatabaseChangesOperation
- func NewCKFetchDatabaseChangesOperationWithPreviousServerChangeToken(previousServerChangeToken ICKServerChangeToken) CKFetchDatabaseChangesOperation
- func (c CKFetchDatabaseChangesOperation) Autorelease() CKFetchDatabaseChangesOperation
- func (c CKFetchDatabaseChangesOperation) ChangeTokenUpdatedBlock() CKServerChangeTokenHandler
- func (c CKFetchDatabaseChangesOperation) FetchAllChanges() bool
- func (c CKFetchDatabaseChangesOperation) Init() CKFetchDatabaseChangesOperation
- func (c CKFetchDatabaseChangesOperation) InitWithPreviousServerChangeToken(previousServerChangeToken ICKServerChangeToken) CKFetchDatabaseChangesOperation
- func (c CKFetchDatabaseChangesOperation) PreviousServerChangeToken() ICKServerChangeToken
- func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDChangedBlock() CKRecordZoneIDHandler
- func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDWasDeletedBlock() CKRecordZoneIDHandler
- func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock() CKRecordZoneIDHandler
- func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDWasPurgedBlock() CKRecordZoneIDHandler
- func (c CKFetchDatabaseChangesOperation) ResultsLimit() uint
- func (c CKFetchDatabaseChangesOperation) SetChangeTokenUpdatedBlock(value CKServerChangeTokenHandler)
- func (c CKFetchDatabaseChangesOperation) SetFetchAllChanges(value bool)
- func (c CKFetchDatabaseChangesOperation) SetPreviousServerChangeToken(value ICKServerChangeToken)
- func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDChangedBlock(value CKRecordZoneIDHandler)
- func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasDeletedBlock(value CKRecordZoneIDHandler)
- func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock(value CKRecordZoneIDHandler)
- func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasPurgedBlock(value CKRecordZoneIDHandler)
- func (c CKFetchDatabaseChangesOperation) SetResultsLimit(value uint)
- type CKFetchDatabaseChangesOperationClass
- type CKFetchRecordZoneChangesConfiguration
- func (c CKFetchRecordZoneChangesConfiguration) Autorelease() CKFetchRecordZoneChangesConfiguration
- func (c CKFetchRecordZoneChangesConfiguration) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKFetchRecordZoneChangesConfiguration) Init() CKFetchRecordZoneChangesConfiguration
- func (c CKFetchRecordZoneChangesConfiguration) PreviousServerChangeToken() ICKServerChangeToken
- func (c CKFetchRecordZoneChangesConfiguration) ResultsLimit() uint
- func (c CKFetchRecordZoneChangesConfiguration) SetPreviousServerChangeToken(value ICKServerChangeToken)
- func (c CKFetchRecordZoneChangesConfiguration) SetResultsLimit(value uint)
- type CKFetchRecordZoneChangesConfigurationClass
- type CKFetchRecordZoneChangesOperation
- func (c CKFetchRecordZoneChangesOperation) Autorelease() CKFetchRecordZoneChangesOperation
- func (c CKFetchRecordZoneChangesOperation) ConfigurationsByRecordZoneID() foundation.INSDictionary
- func (c CKFetchRecordZoneChangesOperation) FetchAllChanges() bool
- func (c CKFetchRecordZoneChangesOperation) Init() CKFetchRecordZoneChangesOperation
- func (c CKFetchRecordZoneChangesOperation) OptionsByRecordZoneID() unsafe.Pointer
- func (c CKFetchRecordZoneChangesOperation) RecordWasChangedBlock() unsafe.Pointer
- func (c CKFetchRecordZoneChangesOperation) RecordWithIDWasDeletedBlock() unsafe.Pointer
- func (c CKFetchRecordZoneChangesOperation) RecordZoneChangeTokensUpdatedBlock() CKRecordZoneIDCKServerChangeTokenDataHandler
- func (c CKFetchRecordZoneChangesOperation) RecordZoneIDs() []CKRecordZoneID
- func (c CKFetchRecordZoneChangesOperation) SetConfigurationsByRecordZoneID(value foundation.INSDictionary)
- func (c CKFetchRecordZoneChangesOperation) SetFetchAllChanges(value bool)
- func (c CKFetchRecordZoneChangesOperation) SetOptionsByRecordZoneID(value kernel.Pointer)
- func (c CKFetchRecordZoneChangesOperation) SetRecordWasChangedBlock(value kernel.Pointer)
- func (c CKFetchRecordZoneChangesOperation) SetRecordWithIDWasDeletedBlock(value kernel.Pointer)
- func (c CKFetchRecordZoneChangesOperation) SetRecordZoneChangeTokensUpdatedBlock(value CKRecordZoneIDCKServerChangeTokenDataHandler)
- func (c CKFetchRecordZoneChangesOperation) SetRecordZoneIDs(value []CKRecordZoneID)
- type CKFetchRecordZoneChangesOperationClass
- type CKFetchRecordZonesOperation
- func (c CKFetchRecordZonesOperation) Autorelease() CKFetchRecordZonesOperation
- func (c CKFetchRecordZonesOperation) Init() CKFetchRecordZonesOperation
- func (c CKFetchRecordZonesOperation) InitWithRecordZoneIDs(zoneIDs []CKRecordZoneID) CKFetchRecordZonesOperation
- func (c CKFetchRecordZonesOperation) RecordZoneIDs() []CKRecordZoneID
- func (c CKFetchRecordZonesOperation) SetRecordZoneIDs(value []CKRecordZoneID)
- type CKFetchRecordZonesOperationClass
- type CKFetchRecordsOperation
- func (c CKFetchRecordsOperation) Autorelease() CKFetchRecordsOperation
- func (c CKFetchRecordsOperation) DesiredKeys() unsafe.Pointer
- func (c CKFetchRecordsOperation) Init() CKFetchRecordsOperation
- func (c CKFetchRecordsOperation) InitWithRecordIDs(recordIDs []CKRecordID) CKFetchRecordsOperation
- func (c CKFetchRecordsOperation) PerRecordProgressBlock() CKRecordIDFloat64Handler
- func (c CKFetchRecordsOperation) RecordIDs() []CKRecordID
- func (c CKFetchRecordsOperation) SetDesiredKeys(value kernel.Pointer)
- func (c CKFetchRecordsOperation) SetPerRecordProgressBlock(value CKRecordIDFloat64Handler)
- func (c CKFetchRecordsOperation) SetRecordIDs(value []CKRecordID)
- type CKFetchRecordsOperationClass
- type CKFetchShareMetadataOperation
- func (c CKFetchShareMetadataOperation) Autorelease() CKFetchShareMetadataOperation
- func (c CKFetchShareMetadataOperation) Init() CKFetchShareMetadataOperation
- func (c CKFetchShareMetadataOperation) InitWithShareURLs(shareURLs []foundation.NSURL) CKFetchShareMetadataOperation
- func (c CKFetchShareMetadataOperation) RootRecordDesiredKeys() unsafe.Pointer
- func (c CKFetchShareMetadataOperation) SetRootRecordDesiredKeys(value kernel.Pointer)
- func (c CKFetchShareMetadataOperation) SetShareURLs(value []foundation.NSURL)
- func (c CKFetchShareMetadataOperation) SetShouldFetchRootRecord(value bool)
- func (c CKFetchShareMetadataOperation) ShareURLs() []foundation.NSURL
- func (c CKFetchShareMetadataOperation) ShouldFetchRootRecord() bool
- type CKFetchShareMetadataOperationClass
- type CKFetchShareParticipantsOperation
- func CKFetchShareParticipantsOperationFromID(id objc.ID) CKFetchShareParticipantsOperation
- func NewCKFetchShareParticipantsOperation() CKFetchShareParticipantsOperation
- func NewCKFetchShareParticipantsOperationWithUserIdentityLookupInfos(userIdentityLookupInfos []CKUserIdentityLookupInfo) CKFetchShareParticipantsOperation
- func (c CKFetchShareParticipantsOperation) Autorelease() CKFetchShareParticipantsOperation
- func (c CKFetchShareParticipantsOperation) Init() CKFetchShareParticipantsOperation
- func (c CKFetchShareParticipantsOperation) InitWithUserIdentityLookupInfos(userIdentityLookupInfos []CKUserIdentityLookupInfo) CKFetchShareParticipantsOperation
- func (c CKFetchShareParticipantsOperation) SetUserIdentityLookupInfos(value []CKUserIdentityLookupInfo)
- func (c CKFetchShareParticipantsOperation) UserIdentityLookupInfos() []CKUserIdentityLookupInfo
- type CKFetchShareParticipantsOperationClass
- type CKFetchSubscriptionsOperation
- func (c CKFetchSubscriptionsOperation) Autorelease() CKFetchSubscriptionsOperation
- func (c CKFetchSubscriptionsOperation) FetchSubscriptionCompletionBlock() objectivec.IObject
- func (c CKFetchSubscriptionsOperation) Init() CKFetchSubscriptionsOperation
- func (c CKFetchSubscriptionsOperation) SetFetchSubscriptionCompletionBlock(value objectivec.IObject)
- func (c CKFetchSubscriptionsOperation) SetSubscriptionIDs(value kernel.Pointer)
- func (c CKFetchSubscriptionsOperation) SubscriptionIDs() unsafe.Pointer
- type CKFetchSubscriptionsOperationClass
- type CKFetchWebAuthTokenOperation
- func (c CKFetchWebAuthTokenOperation) APIToken() string
- func (c CKFetchWebAuthTokenOperation) Autorelease() CKFetchWebAuthTokenOperation
- func (c CKFetchWebAuthTokenOperation) Init() CKFetchWebAuthTokenOperation
- func (c CKFetchWebAuthTokenOperation) InitWithAPIToken(APIToken string) CKFetchWebAuthTokenOperation
- func (c CKFetchWebAuthTokenOperation) SetAPIToken(value string)
- type CKFetchWebAuthTokenOperationClass
- type CKLocationSortDescriptor
- func CKLocationSortDescriptorFromID(id objc.ID) CKLocationSortDescriptor
- func NewCKLocationSortDescriptor() CKLocationSortDescriptor
- func NewCKLocationSortDescriptorWithCoder(aDecoder foundation.INSCoder) CKLocationSortDescriptor
- func NewCKLocationSortDescriptorWithKeyRelativeLocation(key string, relativeLocation unsafe.Pointer) CKLocationSortDescriptor
- func (c CKLocationSortDescriptor) Autorelease() CKLocationSortDescriptor
- func (c CKLocationSortDescriptor) Init() CKLocationSortDescriptor
- func (c CKLocationSortDescriptor) InitWithKeyRelativeLocation(key string, relativeLocation unsafe.Pointer) CKLocationSortDescriptor
- func (c CKLocationSortDescriptor) RelativeLocation() unsafe.Pointer
- type CKLocationSortDescriptorClass
- type CKModifyRecordZonesOperation
- func (c CKModifyRecordZonesOperation) Autorelease() CKModifyRecordZonesOperation
- func (c CKModifyRecordZonesOperation) Init() CKModifyRecordZonesOperation
- func (c CKModifyRecordZonesOperation) PerRecordZoneDeleteBlock() unsafe.Pointer
- func (c CKModifyRecordZonesOperation) PerRecordZoneSaveBlock() unsafe.Pointer
- func (c CKModifyRecordZonesOperation) RecordZoneIDsToDelete() []CKRecordZoneID
- func (c CKModifyRecordZonesOperation) RecordZonesToSave() []CKRecordZone
- func (c CKModifyRecordZonesOperation) SetPerRecordZoneDeleteBlock(value kernel.Pointer)
- func (c CKModifyRecordZonesOperation) SetPerRecordZoneSaveBlock(value kernel.Pointer)
- func (c CKModifyRecordZonesOperation) SetRecordZoneIDsToDelete(value []CKRecordZoneID)
- func (c CKModifyRecordZonesOperation) SetRecordZonesToSave(value []CKRecordZone)
- type CKModifyRecordZonesOperationClass
- type CKModifyRecordsOperation
- func (c CKModifyRecordsOperation) Atomic() bool
- func (c CKModifyRecordsOperation) Autorelease() CKModifyRecordsOperation
- func (c CKModifyRecordsOperation) ClientChangeTokenData() foundation.NSData
- func (c CKModifyRecordsOperation) Init() CKModifyRecordsOperation
- func (c CKModifyRecordsOperation) PerRecordDeleteBlock() unsafe.Pointer
- func (c CKModifyRecordsOperation) PerRecordProgressBlock() CKRecordFloat64Handler
- func (c CKModifyRecordsOperation) PerRecordSaveBlock() unsafe.Pointer
- func (c CKModifyRecordsOperation) RecordIDsToDelete() []CKRecordID
- func (c CKModifyRecordsOperation) RecordsToSave() []CKRecord
- func (c CKModifyRecordsOperation) SavePolicy() CKRecordSavePolicy
- func (c CKModifyRecordsOperation) SetAtomic(value bool)
- func (c CKModifyRecordsOperation) SetClientChangeTokenData(value foundation.NSData)
- func (c CKModifyRecordsOperation) SetPerRecordDeleteBlock(value kernel.Pointer)
- func (c CKModifyRecordsOperation) SetPerRecordProgressBlock(value CKRecordFloat64Handler)
- func (c CKModifyRecordsOperation) SetPerRecordSaveBlock(value kernel.Pointer)
- func (c CKModifyRecordsOperation) SetRecordIDsToDelete(value []CKRecordID)
- func (c CKModifyRecordsOperation) SetRecordsToSave(value []CKRecord)
- func (c CKModifyRecordsOperation) SetSavePolicy(value CKRecordSavePolicy)
- type CKModifyRecordsOperationClass
- type CKModifySubscriptionsOperation
- func (c CKModifySubscriptionsOperation) Autorelease() CKModifySubscriptionsOperation
- func (c CKModifySubscriptionsOperation) Init() CKModifySubscriptionsOperation
- func (c CKModifySubscriptionsOperation) ModifySubscriptionsCompletionBlock() objectivec.IObject
- func (c CKModifySubscriptionsOperation) PerSubscriptionDeleteBlock() unsafe.Pointer
- func (c CKModifySubscriptionsOperation) PerSubscriptionSaveBlock() unsafe.Pointer
- func (c CKModifySubscriptionsOperation) SetModifySubscriptionsCompletionBlock(value objectivec.IObject)
- func (c CKModifySubscriptionsOperation) SetPerSubscriptionDeleteBlock(value kernel.Pointer)
- func (c CKModifySubscriptionsOperation) SetPerSubscriptionSaveBlock(value kernel.Pointer)
- func (c CKModifySubscriptionsOperation) SetSubscriptionIDsToDelete(value kernel.Pointer)
- func (c CKModifySubscriptionsOperation) SetSubscriptionsToSave(value []CKSubscription)
- func (c CKModifySubscriptionsOperation) SubscriptionIDsToDelete() unsafe.Pointer
- func (c CKModifySubscriptionsOperation) SubscriptionsToSave() []CKSubscription
- type CKModifySubscriptionsOperationClass
- type CKNotification
- func (c CKNotification) AlertActionLocalizationKey() string
- func (c CKNotification) AlertBody() string
- func (c CKNotification) AlertLaunchImage() string
- func (c CKNotification) AlertLocalizationArgs() []string
- func (c CKNotification) AlertLocalizationKey() string
- func (c CKNotification) Autorelease() CKNotification
- func (c CKNotification) Badge() foundation.NSNumber
- func (c CKNotification) Category() string
- func (c CKNotification) ContainerIdentifier() string
- func (c CKNotification) Init() CKNotification
- func (c CKNotification) IsPruned() bool
- func (c CKNotification) NotificationID() ICKNotificationID
- func (c CKNotification) NotificationType() CKNotificationType
- func (c CKNotification) SetSubscriptionID(value CKSubscriptionID)
- func (c CKNotification) SoundName() string
- func (c CKNotification) SubscriptionID() CKSubscriptionID
- func (c CKNotification) SubscriptionOwnerUserRecordID() ICKRecordID
- func (c CKNotification) Subtitle() string
- func (c CKNotification) SubtitleLocalizationArgs() []string
- func (c CKNotification) SubtitleLocalizationKey() string
- func (c CKNotification) Title() string
- func (c CKNotification) TitleLocalizationArgs() []string
- func (c CKNotification) TitleLocalizationKey() string
- type CKNotificationClass
- type CKNotificationID
- type CKNotificationIDClass
- type CKNotificationInfo
- func (c CKNotificationInfo) AlertActionLocalizationKey() string
- func (c CKNotificationInfo) AlertBody() string
- func (c CKNotificationInfo) AlertLaunchImage() string
- func (c CKNotificationInfo) AlertLocalizationKey() string
- func (c CKNotificationInfo) Autorelease() CKNotificationInfo
- func (c CKNotificationInfo) Category() string
- func (c CKNotificationInfo) CollapseIDKey() string
- func (c CKNotificationInfo) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKNotificationInfo) Init() CKNotificationInfo
- func (c CKNotificationInfo) SetAlertActionLocalizationKey(value string)
- func (c CKNotificationInfo) SetAlertBody(value string)
- func (c CKNotificationInfo) SetAlertLaunchImage(value string)
- func (c CKNotificationInfo) SetAlertLocalizationKey(value string)
- func (c CKNotificationInfo) SetCategory(value string)
- func (c CKNotificationInfo) SetCollapseIDKey(value string)
- func (c CKNotificationInfo) SetShouldBadge(value bool)
- func (c CKNotificationInfo) SetShouldSendContentAvailable(value bool)
- func (c CKNotificationInfo) SetShouldSendMutableContent(value bool)
- func (c CKNotificationInfo) SetSoundName(value string)
- func (c CKNotificationInfo) SetSubtitle(value string)
- func (c CKNotificationInfo) SetSubtitleLocalizationKey(value string)
- func (c CKNotificationInfo) SetTitle(value string)
- func (c CKNotificationInfo) SetTitleLocalizationKey(value string)
- func (c CKNotificationInfo) ShouldBadge() bool
- func (c CKNotificationInfo) ShouldSendContentAvailable() bool
- func (c CKNotificationInfo) ShouldSendMutableContent() bool
- func (c CKNotificationInfo) SoundName() string
- func (c CKNotificationInfo) Subtitle() string
- func (c CKNotificationInfo) SubtitleLocalizationKey() string
- func (c CKNotificationInfo) Title() string
- func (c CKNotificationInfo) TitleLocalizationKey() string
- type CKNotificationInfoClass
- type CKNotificationType
- type CKOperation
- func (c CKOperation) AllowsCellularAccess() bool
- func (c CKOperation) Autorelease() CKOperation
- func (c CKOperation) Configuration() ICKOperationConfiguration
- func (c CKOperation) Container() ICKContainer
- func (c CKOperation) Group() ICKOperationGroup
- func (c CKOperation) Init() CKOperation
- func (c CKOperation) IsLongLived() bool
- func (c CKOperation) LongLivedOperationWasPersistedBlock() VoidHandler
- func (c CKOperation) OperationID() CKOperationID
- func (c CKOperation) SetAllowsCellularAccess(value bool)
- func (c CKOperation) SetConfiguration(value ICKOperationConfiguration)
- func (c CKOperation) SetContainer(value ICKContainer)
- func (c CKOperation) SetGroup(value ICKOperationGroup)
- func (c CKOperation) SetLongLived(value bool)
- func (c CKOperation) SetLongLivedOperationWasPersistedBlock(value VoidHandler)
- func (c CKOperation) SetOperationID(value CKOperationID)
- func (c CKOperation) SetTimeoutIntervalForRequest(value float64)
- func (c CKOperation) SetTimeoutIntervalForResource(value float64)
- func (c CKOperation) TimeoutIntervalForRequest() float64
- func (c CKOperation) TimeoutIntervalForResource() float64
- type CKOperationClass
- type CKOperationConfiguration
- func (c CKOperationConfiguration) AllowsCellularAccess() bool
- func (c CKOperationConfiguration) Autorelease() CKOperationConfiguration
- func (c CKOperationConfiguration) Container() ICKContainer
- func (c CKOperationConfiguration) Init() CKOperationConfiguration
- func (c CKOperationConfiguration) IsLongLived() bool
- func (c CKOperationConfiguration) QualityOfService() foundation.NSQualityOfService
- func (c CKOperationConfiguration) SetAllowsCellularAccess(value bool)
- func (c CKOperationConfiguration) SetContainer(value ICKContainer)
- func (c CKOperationConfiguration) SetLongLived(value bool)
- func (c CKOperationConfiguration) SetQualityOfService(value foundation.NSQualityOfService)
- func (c CKOperationConfiguration) SetTimeoutIntervalForRequest(value foundation.NSTimeInterval)
- func (c CKOperationConfiguration) SetTimeoutIntervalForResource(value foundation.NSTimeInterval)
- func (c CKOperationConfiguration) TimeoutIntervalForRequest() foundation.NSTimeInterval
- func (c CKOperationConfiguration) TimeoutIntervalForResource() foundation.NSTimeInterval
- type CKOperationConfigurationClass
- type CKOperationGroup
- func (c CKOperationGroup) Autorelease() CKOperationGroup
- func (c CKOperationGroup) DefaultConfiguration() ICKOperationConfiguration
- func (c CKOperationGroup) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKOperationGroup) ExpectedReceiveSize() CKOperationGroupTransferSize
- func (c CKOperationGroup) ExpectedSendSize() CKOperationGroupTransferSize
- func (c CKOperationGroup) Init() CKOperationGroup
- func (c CKOperationGroup) InitWithCoder(aDecoder foundation.INSCoder) CKOperationGroup
- func (c CKOperationGroup) Name() string
- func (c CKOperationGroup) OperationGroupID() string
- func (c CKOperationGroup) Quantity() uint
- func (c CKOperationGroup) SetDefaultConfiguration(value ICKOperationConfiguration)
- func (c CKOperationGroup) SetExpectedReceiveSize(value CKOperationGroupTransferSize)
- func (c CKOperationGroup) SetExpectedSendSize(value CKOperationGroupTransferSize)
- func (c CKOperationGroup) SetName(value string)
- func (c CKOperationGroup) SetQuantity(value uint)
- type CKOperationGroupClass
- type CKOperationGroupTransferSize
- type CKOperationID
- type CKQuery
- func (c CKQuery) Autorelease() CKQuery
- func (c CKQuery) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKQuery) Init() CKQuery
- func (c CKQuery) InitWithCoder(aDecoder foundation.INSCoder) CKQuery
- func (c CKQuery) Predicate() foundation.NSPredicate
- func (c CKQuery) RecordType() unsafe.Pointer
- func (c CKQuery) SetRecordType(value kernel.Pointer)
- func (c CKQuery) SetSortDescriptors(value []foundation.NSSortDescriptor)
- func (c CKQuery) SortDescriptors() []foundation.NSSortDescriptor
- type CKQueryClass
- type CKQueryCursor
- type CKQueryCursorClass
- type CKQueryNotification
- func (c CKQueryNotification) Autorelease() CKQueryNotification
- func (c CKQueryNotification) DatabaseScope() CKDatabaseScope
- func (c CKQueryNotification) Init() CKQueryNotification
- func (c CKQueryNotification) QueryNotificationReason() CKQueryNotificationReason
- func (c CKQueryNotification) RecordFields() foundation.INSDictionary
- func (c CKQueryNotification) RecordID() ICKRecordID
- type CKQueryNotificationClass
- type CKQueryNotificationReason
- type CKQueryOperation
- func (c CKQueryOperation) Autorelease() CKQueryOperation
- func (c CKQueryOperation) Cursor() ICKQueryCursor
- func (c CKQueryOperation) DesiredKeys() unsafe.Pointer
- func (c CKQueryOperation) Init() CKQueryOperation
- func (c CKQueryOperation) InitWithCursor(cursor ICKQueryCursor) CKQueryOperation
- func (c CKQueryOperation) InitWithQuery(query ICKQuery) CKQueryOperation
- func (c CKQueryOperation) Query() ICKQuery
- func (c CKQueryOperation) RecordMatchedBlock() unsafe.Pointer
- func (c CKQueryOperation) ResultsLimit() uint
- func (c CKQueryOperation) SetCursor(value ICKQueryCursor)
- func (c CKQueryOperation) SetDesiredKeys(value kernel.Pointer)
- func (c CKQueryOperation) SetQuery(value ICKQuery)
- func (c CKQueryOperation) SetRecordMatchedBlock(value kernel.Pointer)
- func (c CKQueryOperation) SetResultsLimit(value uint)
- func (c CKQueryOperation) SetZoneID(value ICKRecordZoneID)
- func (c CKQueryOperation) ZoneID() ICKRecordZoneID
- type CKQueryOperationClass
- type CKQuerySubscription
- func (c CKQuerySubscription) Autorelease() CKQuerySubscription
- func (c CKQuerySubscription) Init() CKQuerySubscription
- func (c CKQuerySubscription) Predicate() foundation.NSPredicate
- func (c CKQuerySubscription) QuerySubscriptionOptions() CKQuerySubscriptionOptions
- func (c CKQuerySubscription) RecordType() unsafe.Pointer
- func (c CKQuerySubscription) SetRecordType(value kernel.Pointer)
- func (c CKQuerySubscription) SetZoneID(value ICKRecordZoneID)
- func (c CKQuerySubscription) ZoneID() ICKRecordZoneID
- type CKQuerySubscriptionClass
- type CKQuerySubscriptionOptions
- type CKRecord
- func (c CKRecord) AllKeys() []string
- func (c CKRecord) AllTokens() []string
- func (c CKRecord) Autorelease() CKRecord
- func (c CKRecord) ChangedKeys() []string
- func (c CKRecord) CreationDate() foundation.NSDate
- func (c CKRecord) CreatorUserRecordID() ICKRecordID
- func (c CKRecord) EncodeSystemFieldsWithCoder(coder foundation.INSCoder)
- func (c CKRecord) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKRecord) EncryptedValues() CKRecordKeyValueSetting
- func (c CKRecord) Init() CKRecord
- func (c CKRecord) InitWithCoder(coder foundation.INSCoder) CKRecord
- func (c CKRecord) LastModifiedUserRecordID() ICKRecordID
- func (c CKRecord) ModificationDate() foundation.NSDate
- func (c CKRecord) ObjectForKey(key CKRecordFieldKey) CKRecordValue
- func (c CKRecord) ObjectForKeyedSubscript(key CKRecordFieldKey) CKRecordValue
- func (c CKRecord) Parent() ICKReference
- func (c CKRecord) RecordChangeTag() string
- func (c CKRecord) RecordID() ICKRecordID
- func (c CKRecord) RecordType() unsafe.Pointer
- func (c CKRecord) SetObjectForKey(object CKRecordValue, key CKRecordFieldKey)
- func (c CKRecord) SetParent(value ICKReference)
- func (c CKRecord) SetParentReferenceFromRecord(parentRecord ICKRecord)
- func (c CKRecord) SetParentReferenceFromRecordID(parentRecordID ICKRecordID)
- func (c CKRecord) SetRecordType(value kernel.Pointer)
- func (c CKRecord) Share() ICKReference
- type CKRecordClass
- type CKRecordErrorHandler
- type CKRecordFieldKey
- type CKRecordFloat64Handler
- type CKRecordID
- type CKRecordIDClass
- type CKRecordIDErrorHandler
- type CKRecordIDFloat64Handler
- type CKRecordIDHandler
- type CKRecordKeyValueSetting
- type CKRecordKeyValueSettingObject
- func (o CKRecordKeyValueSettingObject) AllKeys() []string
- func (o CKRecordKeyValueSettingObject) BaseObject() objectivec.Object
- func (o CKRecordKeyValueSettingObject) ChangedKeys() []string
- func (o CKRecordKeyValueSettingObject) ObjectForKey(key CKRecordFieldKey) CKRecordValue
- func (o CKRecordKeyValueSettingObject) ObjectForKeyedSubscript(key CKRecordFieldKey) CKRecordValue
- func (o CKRecordKeyValueSettingObject) SetObjectForKey(object CKRecordValue, key CKRecordFieldKey)
- type CKRecordSavePolicy
- type CKRecordType
- type CKRecordValue
- type CKRecordValueObject
- type CKRecordZone
- func (c CKRecordZone) Autorelease() CKRecordZone
- func (c CKRecordZone) Capabilities() CKRecordZoneCapabilities
- func (c CKRecordZone) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKRecordZone) EncryptionScope() CKRecordZoneEncryptionScope
- func (c CKRecordZone) Init() CKRecordZone
- func (c CKRecordZone) InitWithCoder(coder foundation.INSCoder) CKRecordZone
- func (c CKRecordZone) InitWithZoneID(zoneID ICKRecordZoneID) CKRecordZone
- func (c CKRecordZone) InitWithZoneName(zoneName string) CKRecordZone
- func (c CKRecordZone) SetEncryptionScope(value CKRecordZoneEncryptionScope)
- func (c CKRecordZone) Share() ICKReference
- func (c CKRecordZone) ZoneID() ICKRecordZoneID
- type CKRecordZoneArrayErrorHandler
- type CKRecordZoneCapabilities
- type CKRecordZoneClass
- type CKRecordZoneEncryptionScope
- type CKRecordZoneErrorHandler
- type CKRecordZoneID
- type CKRecordZoneIDCKServerChangeTokenDataHandler
- type CKRecordZoneIDClass
- type CKRecordZoneIDErrorHandler
- type CKRecordZoneIDHandler
- type CKRecordZoneNotification
- type CKRecordZoneNotificationClass
- type CKRecordZoneSubscription
- func (c CKRecordZoneSubscription) Autorelease() CKRecordZoneSubscription
- func (c CKRecordZoneSubscription) Init() CKRecordZoneSubscription
- func (c CKRecordZoneSubscription) RecordType() unsafe.Pointer
- func (c CKRecordZoneSubscription) SetRecordType(value kernel.Pointer)
- func (c CKRecordZoneSubscription) ZoneID() ICKRecordZoneID
- type CKRecordZoneSubscriptionClass
- type CKReference
- func (c CKReference) Autorelease() CKReference
- func (c CKReference) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKReference) Init() CKReference
- func (c CKReference) InitWithRecordAction(record ICKRecord, action CKReferenceAction) CKReference
- func (c CKReference) InitWithRecordIDAction(recordID ICKRecordID, action CKReferenceAction) CKReference
- func (c CKReference) RecordID() ICKRecordID
- func (c CKReference) ReferenceAction() CKReferenceAction
- type CKReferenceAction
- type CKReferenceClass
- type CKServerChangeToken
- type CKServerChangeTokenClass
- type CKServerChangeTokenHandler
- type CKShare
- func CKShareFromID(id objc.ID) CKShare
- func NewCKShare() CKShare
- func NewCKShareWithCoder(aDecoder foundation.INSCoder) CKShare
- func NewCKShareWithRecordZoneID(recordZoneID ICKRecordZoneID) CKShare
- func NewCKShareWithRootRecord(rootRecord ICKRecord) CKShare
- func NewCKShareWithRootRecordShareID(rootRecord ICKRecord, shareID ICKRecordID) CKShare
- func (c CKShare) AddParticipant(participant ICKShareParticipant)
- func (c CKShare) AllowsAccessRequests() bool
- func (c CKShare) Autorelease() CKShare
- func (c CKShare) BlockRequesters(requesters []CKShareAccessRequester)
- func (c CKShare) BlockedIdentities() []CKShareBlockedIdentity
- func (c CKShare) CurrentUserParticipant() ICKShareParticipant
- func (c CKShare) DenyRequesters(requesters []CKShareAccessRequester)
- func (c CKShare) Init() CKShare
- func (c CKShare) InitWithRecordZoneID(recordZoneID ICKRecordZoneID) CKShare
- func (c CKShare) InitWithRootRecord(rootRecord ICKRecord) CKShare
- func (c CKShare) InitWithRootRecordShareID(rootRecord ICKRecord, shareID ICKRecordID) CKShare
- func (c CKShare) Owner() ICKShareParticipant
- func (c CKShare) Participants() []CKShareParticipant
- func (c CKShare) PublicPermission() CKShareParticipantPermission
- func (c CKShare) RemoveParticipant(participant ICKShareParticipant)
- func (c CKShare) Requesters() []CKShareAccessRequester
- func (c CKShare) SetAllowsAccessRequests(value bool)
- func (c CKShare) SetPublicPermission(value CKShareParticipantPermission)
- func (c CKShare) SetUserIdentity(value ICKUserIdentity)
- func (c CKShare) URL() foundation.NSURL
- func (c CKShare) UnblockIdentities(blockedIdentities []CKShareBlockedIdentity)
- func (c CKShare) UserIdentity() ICKUserIdentity
- type CKShareAccessRequester
- func (c CKShareAccessRequester) Autorelease() CKShareAccessRequester
- func (c CKShareAccessRequester) Contact() unsafe.Pointer
- func (c CKShareAccessRequester) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKShareAccessRequester) Init() CKShareAccessRequester
- func (c CKShareAccessRequester) ParticipantLookupInfo() ICKUserIdentityLookupInfo
- func (c CKShareAccessRequester) UserIdentity() ICKUserIdentity
- type CKShareAccessRequesterClass
- type CKShareBlockedIdentity
- func (c CKShareBlockedIdentity) Autorelease() CKShareBlockedIdentity
- func (c CKShareBlockedIdentity) Contact() unsafe.Pointer
- func (c CKShareBlockedIdentity) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKShareBlockedIdentity) Init() CKShareBlockedIdentity
- func (c CKShareBlockedIdentity) UserIdentity() ICKUserIdentity
- type CKShareBlockedIdentityClass
- type CKShareClass
- type CKShareErrorHandler
- type CKShareMetadata
- func (c CKShareMetadata) Autorelease() CKShareMetadata
- func (c CKShareMetadata) ContainerIdentifier() string
- func (c CKShareMetadata) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKShareMetadata) HierarchicalRootRecordID() ICKRecordID
- func (c CKShareMetadata) Init() CKShareMetadata
- func (c CKShareMetadata) OwnerIdentity() ICKUserIdentity
- func (c CKShareMetadata) ParticipantPermission() CKShareParticipantPermission
- func (c CKShareMetadata) ParticipantRole() CKShareParticipantRole
- func (c CKShareMetadata) ParticipantStatus() CKShareParticipantAcceptanceStatus
- func (c CKShareMetadata) ParticipantType() unsafe.Pointer
- func (c CKShareMetadata) RootRecord() ICKRecord
- func (c CKShareMetadata) Share() ICKShare
- type CKShareMetadataClass
- type CKShareMetadataErrorHandler
- type CKShareParticipant
- func (c CKShareParticipant) AcceptanceStatus() CKShareParticipantAcceptanceStatus
- func (c CKShareParticipant) Autorelease() CKShareParticipant
- func (c CKShareParticipant) DateAddedToShare() foundation.NSDate
- func (c CKShareParticipant) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKShareParticipant) Init() CKShareParticipant
- func (c CKShareParticipant) IsApprovedRequester() bool
- func (c CKShareParticipant) Permission() CKShareParticipantPermission
- func (c CKShareParticipant) Role() CKShareParticipantRole
- func (c CKShareParticipant) SetPermission(value CKShareParticipantPermission)
- func (c CKShareParticipant) SetRole(value CKShareParticipantRole)
- func (c CKShareParticipant) UserIdentity() ICKUserIdentity
- type CKShareParticipantAcceptanceStatus
- type CKShareParticipantClass
- type CKShareParticipantErrorHandler
- type CKShareParticipantPermission
- type CKShareParticipantRole
- type CKSharePreparationCompletionHandler
- type CKSharePreparationHandler
- type CKShareRequestAccessOperation
- func (c CKShareRequestAccessOperation) Autorelease() CKShareRequestAccessOperation
- func (c CKShareRequestAccessOperation) Init() CKShareRequestAccessOperation
- func (c CKShareRequestAccessOperation) InitWithShareURLs(shareURLs []foundation.NSURL) CKShareRequestAccessOperation
- func (c CKShareRequestAccessOperation) SetShareURLs(value []foundation.NSURL)
- func (c CKShareRequestAccessOperation) ShareURLs() []foundation.NSURL
- type CKShareRequestAccessOperationClass
- type CKSharingParticipantAccessOption
- type CKSharingParticipantPermissionOption
- type CKSubscription
- func (c CKSubscription) Autorelease() CKSubscription
- func (c CKSubscription) DesiredKeys() unsafe.Pointer
- func (c CKSubscription) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKSubscription) Init() CKSubscription
- func (c CKSubscription) InitWithCoder(coder foundation.INSCoder) CKSubscription
- func (c CKSubscription) NotificationInfo() ICKNotificationInfo
- func (c CKSubscription) SetDesiredKeys(value kernel.Pointer)
- func (c CKSubscription) SetNotificationInfo(value ICKNotificationInfo)
- func (c CKSubscription) SetSubscriptionID(value CKSubscriptionID)
- func (c CKSubscription) SubscriptionID() CKSubscriptionID
- func (c CKSubscription) SubscriptionType() CKSubscriptionType
- type CKSubscriptionArrayErrorHandler
- type CKSubscriptionClass
- type CKSubscriptionErrorHandler
- type CKSubscriptionID
- type CKSubscriptionType
- type CKSyncEngine
- func (c CKSyncEngine) Autorelease() CKSyncEngine
- func (c CKSyncEngine) CancelOperations(ctx context.Context) error
- func (c CKSyncEngine) CancelOperationsWithCompletionHandler(completionHandler VoidHandler)
- func (c CKSyncEngine) Database() ICKDatabase
- func (c CKSyncEngine) FetchChanges(ctx context.Context) error
- func (c CKSyncEngine) FetchChangesWithCompletionHandler(completionHandler ErrorHandler)
- func (c CKSyncEngine) FetchChangesWithOptions(ctx context.Context, options ICKSyncEngineFetchChangesOptions) error
- func (c CKSyncEngine) FetchChangesWithOptionsCompletionHandler(options ICKSyncEngineFetchChangesOptions, completionHandler ErrorHandler)
- func (c CKSyncEngine) Init() CKSyncEngine
- func (c CKSyncEngine) InitWithConfiguration(configuration ICKSyncEngineConfiguration) CKSyncEngine
- func (c CKSyncEngine) SendChanges(ctx context.Context) error
- func (c CKSyncEngine) SendChangesWithCompletionHandler(completionHandler ErrorHandler)
- func (c CKSyncEngine) SendChangesWithOptions(ctx context.Context, options ICKSyncEngineSendChangesOptions) error
- func (c CKSyncEngine) SendChangesWithOptionsCompletionHandler(options ICKSyncEngineSendChangesOptions, completionHandler ErrorHandler)
- func (c CKSyncEngine) State() ICKSyncEngineState
- type CKSyncEngineAccountChangeEvent
- func (c CKSyncEngineAccountChangeEvent) Autorelease() CKSyncEngineAccountChangeEvent
- func (c CKSyncEngineAccountChangeEvent) ChangeType() CKSyncEngineAccountChangeType
- func (c CKSyncEngineAccountChangeEvent) CurrentUser() ICKRecordID
- func (c CKSyncEngineAccountChangeEvent) Init() CKSyncEngineAccountChangeEvent
- func (c CKSyncEngineAccountChangeEvent) PreviousUser() ICKRecordID
- type CKSyncEngineAccountChangeEventClass
- type CKSyncEngineAccountChangeType
- type CKSyncEngineClass
- type CKSyncEngineConfiguration
- func CKSyncEngineConfigurationFromID(id objc.ID) CKSyncEngineConfiguration
- func NewCKSyncEngineConfiguration() CKSyncEngineConfiguration
- func NewCKSyncEngineConfigurationWithDatabaseStateSerializationDelegate(database ICKDatabase, stateSerialization ICKSyncEngineStateSerialization, ...) CKSyncEngineConfiguration
- func (c CKSyncEngineConfiguration) AutomaticallySync() bool
- func (c CKSyncEngineConfiguration) Autorelease() CKSyncEngineConfiguration
- func (c CKSyncEngineConfiguration) Database() ICKDatabase
- func (c CKSyncEngineConfiguration) Delegate() CKSyncEngineDelegate
- func (c CKSyncEngineConfiguration) Init() CKSyncEngineConfiguration
- func (c CKSyncEngineConfiguration) InitWithDatabaseStateSerializationDelegate(database ICKDatabase, stateSerialization ICKSyncEngineStateSerialization, ...) CKSyncEngineConfiguration
- func (c CKSyncEngineConfiguration) SetAutomaticallySync(value bool)
- func (c CKSyncEngineConfiguration) SetDatabase(value ICKDatabase)
- func (c CKSyncEngineConfiguration) SetDelegate(value CKSyncEngineDelegate)
- func (c CKSyncEngineConfiguration) SetStateSerialization(value ICKSyncEngineStateSerialization)
- func (c CKSyncEngineConfiguration) SetSubscriptionID(value CKSubscriptionID)
- func (c CKSyncEngineConfiguration) StateSerialization() ICKSyncEngineStateSerialization
- func (c CKSyncEngineConfiguration) SubscriptionID() CKSubscriptionID
- type CKSyncEngineConfigurationClass
- type CKSyncEngineDelegate
- type CKSyncEngineDelegateConfig
- type CKSyncEngineDelegateObject
- func (o CKSyncEngineDelegateObject) BaseObject() objectivec.Object
- func (o CKSyncEngineDelegateObject) SyncEngineHandleEvent(syncEngine ICKSyncEngine, event ICKSyncEngineEvent)
- func (o CKSyncEngineDelegateObject) SyncEngineNextFetchChangesOptionsForContext(syncEngine ICKSyncEngine, context ICKSyncEngineFetchChangesContext) ICKSyncEngineFetchChangesOptions
- func (o CKSyncEngineDelegateObject) SyncEngineNextRecordZoneChangeBatchForContext(syncEngine ICKSyncEngine, context ICKSyncEngineSendChangesContext) ICKSyncEngineRecordZoneChangeBatch
- type CKSyncEngineDidFetchChangesEvent
- type CKSyncEngineDidFetchChangesEventClass
- type CKSyncEngineDidFetchRecordZoneChangesEvent
- func (c CKSyncEngineDidFetchRecordZoneChangesEvent) Autorelease() CKSyncEngineDidFetchRecordZoneChangesEvent
- func (c CKSyncEngineDidFetchRecordZoneChangesEvent) Error() foundation.NSError
- func (c CKSyncEngineDidFetchRecordZoneChangesEvent) Init() CKSyncEngineDidFetchRecordZoneChangesEvent
- func (c CKSyncEngineDidFetchRecordZoneChangesEvent) ZoneID() ICKRecordZoneID
- type CKSyncEngineDidFetchRecordZoneChangesEventClass
- type CKSyncEngineDidSendChangesEvent
- type CKSyncEngineDidSendChangesEventClass
- type CKSyncEngineEvent
- func (c CKSyncEngineEvent) AccountChangeEvent() ICKSyncEngineAccountChangeEvent
- func (c CKSyncEngineEvent) Autorelease() CKSyncEngineEvent
- func (c CKSyncEngineEvent) DidFetchChangesEvent() ICKSyncEngineDidFetchChangesEvent
- func (c CKSyncEngineEvent) DidFetchRecordZoneChangesEvent() ICKSyncEngineDidFetchRecordZoneChangesEvent
- func (c CKSyncEngineEvent) DidSendChangesEvent() ICKSyncEngineDidSendChangesEvent
- func (c CKSyncEngineEvent) FetchedDatabaseChangesEvent() ICKSyncEngineFetchedDatabaseChangesEvent
- func (c CKSyncEngineEvent) FetchedRecordZoneChangesEvent() ICKSyncEngineFetchedRecordZoneChangesEvent
- func (c CKSyncEngineEvent) Init() CKSyncEngineEvent
- func (c CKSyncEngineEvent) SentDatabaseChangesEvent() ICKSyncEngineSentDatabaseChangesEvent
- func (c CKSyncEngineEvent) SentRecordZoneChangesEvent() ICKSyncEngineSentRecordZoneChangesEvent
- func (c CKSyncEngineEvent) StateUpdateEvent() ICKSyncEngineStateUpdateEvent
- func (c CKSyncEngineEvent) Type() CKSyncEngineEventType
- func (c CKSyncEngineEvent) WillFetchChangesEvent() ICKSyncEngineWillFetchChangesEvent
- func (c CKSyncEngineEvent) WillFetchRecordZoneChangesEvent() ICKSyncEngineWillFetchRecordZoneChangesEvent
- func (c CKSyncEngineEvent) WillSendChangesEvent() ICKSyncEngineWillSendChangesEvent
- type CKSyncEngineEventClass
- type CKSyncEngineEventType
- type CKSyncEngineFailedRecordSave
- type CKSyncEngineFailedRecordSaveClass
- type CKSyncEngineFailedZoneSave
- type CKSyncEngineFailedZoneSaveClass
- type CKSyncEngineFetchChangesContext
- func (c CKSyncEngineFetchChangesContext) Autorelease() CKSyncEngineFetchChangesContext
- func (c CKSyncEngineFetchChangesContext) Init() CKSyncEngineFetchChangesContext
- func (c CKSyncEngineFetchChangesContext) Options() ICKSyncEngineFetchChangesOptions
- func (c CKSyncEngineFetchChangesContext) Reason() CKSyncEngineSyncReason
- type CKSyncEngineFetchChangesContextClass
- type CKSyncEngineFetchChangesOptions
- func (c CKSyncEngineFetchChangesOptions) Autorelease() CKSyncEngineFetchChangesOptions
- func (c CKSyncEngineFetchChangesOptions) Init() CKSyncEngineFetchChangesOptions
- func (c CKSyncEngineFetchChangesOptions) InitWithScope(scope ICKSyncEngineFetchChangesScope) CKSyncEngineFetchChangesOptions
- func (c CKSyncEngineFetchChangesOptions) OperationGroup() ICKOperationGroup
- func (c CKSyncEngineFetchChangesOptions) PrioritizedZoneIDs() []CKRecordZoneID
- func (c CKSyncEngineFetchChangesOptions) Scope() ICKSyncEngineFetchChangesScope
- func (c CKSyncEngineFetchChangesOptions) SetOperationGroup(value ICKOperationGroup)
- func (c CKSyncEngineFetchChangesOptions) SetPrioritizedZoneIDs(value []CKRecordZoneID)
- func (c CKSyncEngineFetchChangesOptions) SetScope(value ICKSyncEngineFetchChangesScope)
- type CKSyncEngineFetchChangesOptionsClass
- type CKSyncEngineFetchChangesScope
- func CKSyncEngineFetchChangesScopeFromID(id objc.ID) CKSyncEngineFetchChangesScope
- func NewCKSyncEngineFetchChangesScope() CKSyncEngineFetchChangesScope
- func NewCKSyncEngineFetchChangesScopeWithExcludedZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
- func NewCKSyncEngineFetchChangesScopeWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
- func (c CKSyncEngineFetchChangesScope) Autorelease() CKSyncEngineFetchChangesScope
- func (c CKSyncEngineFetchChangesScope) ContainsZoneID(zoneID ICKRecordZoneID) bool
- func (c CKSyncEngineFetchChangesScope) ExcludedZoneIDs() foundation.INSSet
- func (c CKSyncEngineFetchChangesScope) Init() CKSyncEngineFetchChangesScope
- func (c CKSyncEngineFetchChangesScope) InitWithExcludedZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
- func (c CKSyncEngineFetchChangesScope) InitWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
- func (c CKSyncEngineFetchChangesScope) ZoneIDs() foundation.INSSet
- type CKSyncEngineFetchChangesScopeClass
- type CKSyncEngineFetchedDatabaseChangesEvent
- func (c CKSyncEngineFetchedDatabaseChangesEvent) Autorelease() CKSyncEngineFetchedDatabaseChangesEvent
- func (c CKSyncEngineFetchedDatabaseChangesEvent) Deletions() []CKSyncEngineFetchedZoneDeletion
- func (c CKSyncEngineFetchedDatabaseChangesEvent) Init() CKSyncEngineFetchedDatabaseChangesEvent
- func (c CKSyncEngineFetchedDatabaseChangesEvent) Modifications() []CKRecordZone
- type CKSyncEngineFetchedDatabaseChangesEventClass
- type CKSyncEngineFetchedRecordDeletion
- func (c CKSyncEngineFetchedRecordDeletion) Autorelease() CKSyncEngineFetchedRecordDeletion
- func (c CKSyncEngineFetchedRecordDeletion) Init() CKSyncEngineFetchedRecordDeletion
- func (c CKSyncEngineFetchedRecordDeletion) RecordID() ICKRecordID
- func (c CKSyncEngineFetchedRecordDeletion) RecordType() CKRecordType
- type CKSyncEngineFetchedRecordDeletionClass
- type CKSyncEngineFetchedRecordZoneChangesEvent
- func (c CKSyncEngineFetchedRecordZoneChangesEvent) Autorelease() CKSyncEngineFetchedRecordZoneChangesEvent
- func (c CKSyncEngineFetchedRecordZoneChangesEvent) Deletions() []CKSyncEngineFetchedRecordDeletion
- func (c CKSyncEngineFetchedRecordZoneChangesEvent) Init() CKSyncEngineFetchedRecordZoneChangesEvent
- func (c CKSyncEngineFetchedRecordZoneChangesEvent) Modifications() []CKRecord
- type CKSyncEngineFetchedRecordZoneChangesEventClass
- type CKSyncEngineFetchedZoneDeletion
- func (c CKSyncEngineFetchedZoneDeletion) Autorelease() CKSyncEngineFetchedZoneDeletion
- func (c CKSyncEngineFetchedZoneDeletion) Init() CKSyncEngineFetchedZoneDeletion
- func (c CKSyncEngineFetchedZoneDeletion) Reason() CKSyncEngineZoneDeletionReason
- func (c CKSyncEngineFetchedZoneDeletion) ZoneID() ICKRecordZoneID
- type CKSyncEngineFetchedZoneDeletionClass
- type CKSyncEnginePendingDatabaseChange
- func (c CKSyncEnginePendingDatabaseChange) Autorelease() CKSyncEnginePendingDatabaseChange
- func (c CKSyncEnginePendingDatabaseChange) Init() CKSyncEnginePendingDatabaseChange
- func (c CKSyncEnginePendingDatabaseChange) Type() CKSyncEnginePendingDatabaseChangeType
- func (c CKSyncEnginePendingDatabaseChange) ZoneID() ICKRecordZoneID
- type CKSyncEnginePendingDatabaseChangeClass
- type CKSyncEnginePendingDatabaseChangeType
- type CKSyncEnginePendingRecordZoneChange
- func CKSyncEnginePendingRecordZoneChangeFromID(id objc.ID) CKSyncEnginePendingRecordZoneChange
- func NewCKSyncEnginePendingRecordZoneChange() CKSyncEnginePendingRecordZoneChange
- func NewCKSyncEnginePendingRecordZoneChangeWithRecordIDType(recordID ICKRecordID, type_ CKSyncEnginePendingRecordZoneChangeType) CKSyncEnginePendingRecordZoneChange
- func (c CKSyncEnginePendingRecordZoneChange) Autorelease() CKSyncEnginePendingRecordZoneChange
- func (c CKSyncEnginePendingRecordZoneChange) Init() CKSyncEnginePendingRecordZoneChange
- func (c CKSyncEnginePendingRecordZoneChange) InitWithRecordIDType(recordID ICKRecordID, type_ CKSyncEnginePendingRecordZoneChangeType) CKSyncEnginePendingRecordZoneChange
- func (c CKSyncEnginePendingRecordZoneChange) RecordID() ICKRecordID
- func (c CKSyncEnginePendingRecordZoneChange) Type() CKSyncEnginePendingRecordZoneChangeType
- type CKSyncEnginePendingRecordZoneChangeClass
- type CKSyncEnginePendingRecordZoneChangeType
- type CKSyncEnginePendingZoneDelete
- type CKSyncEnginePendingZoneDeleteClass
- type CKSyncEnginePendingZoneSave
- func (c CKSyncEnginePendingZoneSave) Autorelease() CKSyncEnginePendingZoneSave
- func (c CKSyncEnginePendingZoneSave) Init() CKSyncEnginePendingZoneSave
- func (c CKSyncEnginePendingZoneSave) InitWithZone(zone ICKRecordZone) CKSyncEnginePendingZoneSave
- func (c CKSyncEnginePendingZoneSave) Zone() ICKRecordZone
- type CKSyncEnginePendingZoneSaveClass
- type CKSyncEngineRecordZoneChangeBatch
- func CKSyncEngineRecordZoneChangeBatchFromID(id objc.ID) CKSyncEngineRecordZoneChangeBatch
- func NewCKSyncEngineRecordZoneChangeBatch() CKSyncEngineRecordZoneChangeBatch
- func NewCKSyncEngineRecordZoneChangeBatchWithRecordsToSaveRecordIDsToDeleteAtomicByZone(recordsToSave []CKRecord, recordIDsToDelete []CKRecordID, atomicByZone bool) CKSyncEngineRecordZoneChangeBatch
- func (c CKSyncEngineRecordZoneChangeBatch) AtomicByZone() bool
- func (c CKSyncEngineRecordZoneChangeBatch) Autorelease() CKSyncEngineRecordZoneChangeBatch
- func (c CKSyncEngineRecordZoneChangeBatch) Init() CKSyncEngineRecordZoneChangeBatch
- func (c CKSyncEngineRecordZoneChangeBatch) InitWithPendingChangesRecordProvider(pendingChanges []CKSyncEnginePendingRecordZoneChange, ...) CKSyncEngineRecordZoneChangeBatch
- func (c CKSyncEngineRecordZoneChangeBatch) InitWithRecordsToSaveRecordIDsToDeleteAtomicByZone(recordsToSave []CKRecord, recordIDsToDelete []CKRecordID, atomicByZone bool) CKSyncEngineRecordZoneChangeBatch
- func (c CKSyncEngineRecordZoneChangeBatch) RecordIDsToDelete() []CKRecordID
- func (c CKSyncEngineRecordZoneChangeBatch) RecordsToSave() []CKRecord
- func (c CKSyncEngineRecordZoneChangeBatch) SetAtomicByZone(value bool)
- type CKSyncEngineRecordZoneChangeBatchClass
- type CKSyncEngineSendChangesContext
- func (c CKSyncEngineSendChangesContext) Autorelease() CKSyncEngineSendChangesContext
- func (c CKSyncEngineSendChangesContext) Init() CKSyncEngineSendChangesContext
- func (c CKSyncEngineSendChangesContext) Options() ICKSyncEngineSendChangesOptions
- func (c CKSyncEngineSendChangesContext) Reason() CKSyncEngineSyncReason
- type CKSyncEngineSendChangesContextClass
- type CKSyncEngineSendChangesOptions
- func (c CKSyncEngineSendChangesOptions) Autorelease() CKSyncEngineSendChangesOptions
- func (c CKSyncEngineSendChangesOptions) Init() CKSyncEngineSendChangesOptions
- func (c CKSyncEngineSendChangesOptions) InitWithScope(scope ICKSyncEngineSendChangesScope) CKSyncEngineSendChangesOptions
- func (c CKSyncEngineSendChangesOptions) OperationGroup() ICKOperationGroup
- func (c CKSyncEngineSendChangesOptions) Scope() ICKSyncEngineSendChangesScope
- func (c CKSyncEngineSendChangesOptions) SetOperationGroup(value ICKOperationGroup)
- func (c CKSyncEngineSendChangesOptions) SetScope(value ICKSyncEngineSendChangesScope)
- type CKSyncEngineSendChangesOptionsClass
- type CKSyncEngineSendChangesScope
- func CKSyncEngineSendChangesScopeFromID(id objc.ID) CKSyncEngineSendChangesScope
- func NewCKSyncEngineSendChangesScope() CKSyncEngineSendChangesScope
- func NewCKSyncEngineSendChangesScopeWithExcludedZoneIDs(excludedZoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
- func NewCKSyncEngineSendChangesScopeWithRecordIDs(recordIDs foundation.INSSet) CKSyncEngineSendChangesScope
- func NewCKSyncEngineSendChangesScopeWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
- func (c CKSyncEngineSendChangesScope) Autorelease() CKSyncEngineSendChangesScope
- func (c CKSyncEngineSendChangesScope) ContainsPendingRecordZoneChange(pendingRecordZoneChange ICKSyncEnginePendingRecordZoneChange) bool
- func (c CKSyncEngineSendChangesScope) ContainsRecordID(recordID ICKRecordID) bool
- func (c CKSyncEngineSendChangesScope) ExcludedZoneIDs() foundation.INSSet
- func (c CKSyncEngineSendChangesScope) Init() CKSyncEngineSendChangesScope
- func (c CKSyncEngineSendChangesScope) InitWithExcludedZoneIDs(excludedZoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
- func (c CKSyncEngineSendChangesScope) InitWithRecordIDs(recordIDs foundation.INSSet) CKSyncEngineSendChangesScope
- func (c CKSyncEngineSendChangesScope) InitWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
- func (c CKSyncEngineSendChangesScope) RecordIDs() foundation.INSSet
- func (c CKSyncEngineSendChangesScope) ZoneIDs() foundation.INSSet
- type CKSyncEngineSendChangesScopeClass
- type CKSyncEngineSentDatabaseChangesEvent
- func (c CKSyncEngineSentDatabaseChangesEvent) Autorelease() CKSyncEngineSentDatabaseChangesEvent
- func (c CKSyncEngineSentDatabaseChangesEvent) DeletedZoneIDs() []CKRecordZoneID
- func (c CKSyncEngineSentDatabaseChangesEvent) FailedZoneDeletes() foundation.INSDictionary
- func (c CKSyncEngineSentDatabaseChangesEvent) FailedZoneSaves() []CKSyncEngineFailedZoneSave
- func (c CKSyncEngineSentDatabaseChangesEvent) Init() CKSyncEngineSentDatabaseChangesEvent
- func (c CKSyncEngineSentDatabaseChangesEvent) SavedZones() []CKRecordZone
- type CKSyncEngineSentDatabaseChangesEventClass
- type CKSyncEngineSentRecordZoneChangesEvent
- func (c CKSyncEngineSentRecordZoneChangesEvent) Autorelease() CKSyncEngineSentRecordZoneChangesEvent
- func (c CKSyncEngineSentRecordZoneChangesEvent) DeletedRecordIDs() []CKRecordID
- func (c CKSyncEngineSentRecordZoneChangesEvent) FailedRecordDeletes() foundation.INSDictionary
- func (c CKSyncEngineSentRecordZoneChangesEvent) FailedRecordSaves() []CKSyncEngineFailedRecordSave
- func (c CKSyncEngineSentRecordZoneChangesEvent) Init() CKSyncEngineSentRecordZoneChangesEvent
- func (c CKSyncEngineSentRecordZoneChangesEvent) SavedRecords() []CKRecord
- type CKSyncEngineSentRecordZoneChangesEventClass
- type CKSyncEngineState
- func (c CKSyncEngineState) AddPendingDatabaseChanges(changes []CKSyncEnginePendingDatabaseChange)
- func (c CKSyncEngineState) AddPendingRecordZoneChanges(changes []CKSyncEnginePendingRecordZoneChange)
- func (c CKSyncEngineState) Autorelease() CKSyncEngineState
- func (c CKSyncEngineState) HasPendingUntrackedChanges() bool
- func (c CKSyncEngineState) Init() CKSyncEngineState
- func (c CKSyncEngineState) PendingDatabaseChanges() []CKSyncEnginePendingDatabaseChange
- func (c CKSyncEngineState) PendingRecordZoneChanges() []CKSyncEnginePendingRecordZoneChange
- func (c CKSyncEngineState) RemovePendingDatabaseChanges(changes []CKSyncEnginePendingDatabaseChange)
- func (c CKSyncEngineState) RemovePendingRecordZoneChanges(changes []CKSyncEnginePendingRecordZoneChange)
- func (c CKSyncEngineState) SetHasPendingUntrackedChanges(value bool)
- func (c CKSyncEngineState) ZoneIDsWithUnfetchedServerChanges() []CKRecordZoneID
- type CKSyncEngineStateClass
- type CKSyncEngineStateSerialization
- type CKSyncEngineStateSerializationClass
- type CKSyncEngineStateUpdateEvent
- type CKSyncEngineStateUpdateEventClass
- type CKSyncEngineSyncReason
- type CKSyncEngineWillFetchChangesEvent
- type CKSyncEngineWillFetchChangesEventClass
- type CKSyncEngineWillFetchRecordZoneChangesEvent
- type CKSyncEngineWillFetchRecordZoneChangesEventClass
- type CKSyncEngineWillSendChangesEvent
- type CKSyncEngineWillSendChangesEventClass
- type CKSyncEngineZoneDeletionReason
- type CKSystemSharingUIObserver
- func (c CKSystemSharingUIObserver) Autorelease() CKSystemSharingUIObserver
- func (c CKSystemSharingUIObserver) Init() CKSystemSharingUIObserver
- func (c CKSystemSharingUIObserver) InitWithContainer(container ICKContainer) CKSystemSharingUIObserver
- func (c CKSystemSharingUIObserver) SetSystemSharingUIDidSaveShareBlock(value kernel.Pointer)
- func (c CKSystemSharingUIObserver) SetSystemSharingUIDidStopSharingBlock(value kernel.Pointer)
- func (c CKSystemSharingUIObserver) SystemSharingUIDidSaveShareBlock() unsafe.Pointer
- func (c CKSystemSharingUIObserver) SystemSharingUIDidStopSharingBlock() unsafe.Pointer
- type CKSystemSharingUIObserverClass
- type CKUserIdentity
- func (c CKUserIdentity) Autorelease() CKUserIdentity
- func (c CKUserIdentity) ContactIdentifiers() []string
- func (c CKUserIdentity) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKUserIdentity) HasiCloudAccount() bool
- func (c CKUserIdentity) Init() CKUserIdentity
- func (c CKUserIdentity) InitWithCoder(coder foundation.INSCoder) CKUserIdentity
- func (c CKUserIdentity) LookupInfo() ICKUserIdentityLookupInfo
- func (c CKUserIdentity) NameComponents() foundation.NSPersonNameComponents
- func (c CKUserIdentity) UserRecordID() ICKRecordID
- type CKUserIdentityArrayErrorHandler
- type CKUserIdentityCKUserIdentityLookupInfoHandler
- type CKUserIdentityClass
- type CKUserIdentityErrorHandler
- type CKUserIdentityHandler
- type CKUserIdentityLookupInfo
- func CKUserIdentityLookupInfoFromID(id objc.ID) CKUserIdentityLookupInfo
- func NewCKUserIdentityLookupInfo() CKUserIdentityLookupInfo
- func NewCKUserIdentityLookupInfoWithEmailAddress(emailAddress string) CKUserIdentityLookupInfo
- func NewCKUserIdentityLookupInfoWithPhoneNumber(phoneNumber string) CKUserIdentityLookupInfo
- func NewCKUserIdentityLookupInfoWithUserRecordID(userRecordID ICKRecordID) CKUserIdentityLookupInfo
- func (c CKUserIdentityLookupInfo) Autorelease() CKUserIdentityLookupInfo
- func (c CKUserIdentityLookupInfo) EmailAddress() string
- func (c CKUserIdentityLookupInfo) EncodeWithCoder(coder foundation.INSCoder)
- func (c CKUserIdentityLookupInfo) Init() CKUserIdentityLookupInfo
- func (c CKUserIdentityLookupInfo) InitWithEmailAddress(emailAddress string) CKUserIdentityLookupInfo
- func (c CKUserIdentityLookupInfo) InitWithPhoneNumber(phoneNumber string) CKUserIdentityLookupInfo
- func (c CKUserIdentityLookupInfo) InitWithUserRecordID(userRecordID ICKRecordID) CKUserIdentityLookupInfo
- func (c CKUserIdentityLookupInfo) PhoneNumber() string
- func (c CKUserIdentityLookupInfo) UserRecordID() ICKRecordID
- type CKUserIdentityLookupInfoClass
- func (cc CKUserIdentityLookupInfoClass) Alloc() CKUserIdentityLookupInfo
- func (cc CKUserIdentityLookupInfoClass) Class() objc.Class
- func (_CKUserIdentityLookupInfoClass CKUserIdentityLookupInfoClass) LookupInfosWithEmails(emails []string) []CKUserIdentityLookupInfo
- func (_CKUserIdentityLookupInfoClass CKUserIdentityLookupInfoClass) LookupInfosWithPhoneNumbers(phoneNumbers []string) []CKUserIdentityLookupInfo
- func (_CKUserIdentityLookupInfoClass CKUserIdentityLookupInfoClass) LookupInfosWithRecordIDs(recordIDs []CKRecordID) []CKUserIdentityLookupInfo
- type ErrorHandler
- type ICKAcceptSharesOperation
- type ICKAllowedSharingOptions
- type ICKAsset
- type ICKContainer
- type ICKDatabase
- type ICKDatabaseNotification
- type ICKDatabaseOperation
- type ICKDatabaseSubscription
- type ICKDiscoverAllUserIdentitiesOperation
- type ICKDiscoverUserIdentitiesOperation
- type ICKFetchDatabaseChangesOperation
- type ICKFetchRecordZoneChangesConfiguration
- type ICKFetchRecordZoneChangesOperation
- type ICKFetchRecordZonesOperation
- type ICKFetchRecordsOperation
- type ICKFetchShareMetadataOperation
- type ICKFetchShareParticipantsOperation
- type ICKFetchSubscriptionsOperation
- type ICKFetchWebAuthTokenOperation
- type ICKLocationSortDescriptor
- type ICKModifyRecordZonesOperation
- type ICKModifyRecordsOperation
- type ICKModifySubscriptionsOperation
- type ICKNotification
- type ICKNotificationID
- type ICKNotificationInfo
- type ICKOperation
- type ICKOperationConfiguration
- type ICKOperationGroup
- type ICKQuery
- type ICKQueryCursor
- type ICKQueryNotification
- type ICKQueryOperation
- type ICKQuerySubscription
- type ICKRecord
- type ICKRecordID
- type ICKRecordZone
- type ICKRecordZoneID
- type ICKRecordZoneNotification
- type ICKRecordZoneSubscription
- type ICKReference
- type ICKServerChangeToken
- type ICKShare
- type ICKShareAccessRequester
- type ICKShareBlockedIdentity
- type ICKShareMetadata
- type ICKShareParticipant
- type ICKShareRequestAccessOperation
- type ICKSubscription
- type ICKSyncEngine
- type ICKSyncEngineAccountChangeEvent
- type ICKSyncEngineConfiguration
- type ICKSyncEngineDidFetchChangesEvent
- type ICKSyncEngineDidFetchRecordZoneChangesEvent
- type ICKSyncEngineDidSendChangesEvent
- type ICKSyncEngineEvent
- type ICKSyncEngineFailedRecordSave
- type ICKSyncEngineFailedZoneSave
- type ICKSyncEngineFetchChangesContext
- type ICKSyncEngineFetchChangesOptions
- type ICKSyncEngineFetchChangesScope
- type ICKSyncEngineFetchedDatabaseChangesEvent
- type ICKSyncEngineFetchedRecordDeletion
- type ICKSyncEngineFetchedRecordZoneChangesEvent
- type ICKSyncEngineFetchedZoneDeletion
- type ICKSyncEnginePendingDatabaseChange
- type ICKSyncEnginePendingRecordZoneChange
- type ICKSyncEnginePendingZoneDelete
- type ICKSyncEnginePendingZoneSave
- type ICKSyncEngineRecordZoneChangeBatch
- type ICKSyncEngineSendChangesContext
- type ICKSyncEngineSendChangesOptions
- type ICKSyncEngineSendChangesScope
- type ICKSyncEngineSentDatabaseChangesEvent
- type ICKSyncEngineSentRecordZoneChangesEvent
- type ICKSyncEngineState
- type ICKSyncEngineStateSerialization
- type ICKSyncEngineStateUpdateEvent
- type ICKSyncEngineWillFetchChangesEvent
- type ICKSyncEngineWillFetchRecordZoneChangesEvent
- type ICKSyncEngineWillSendChangesEvent
- type ICKSystemSharingUIObserver
- type ICKUserIdentity
- type ICKUserIdentityLookupInfo
- type VoidHandler
Constants ¶
This section is empty.
Variables ¶
var ( // CKAccountChangedNotification is a notification that a container posts when the status of an iCloud account changes. // // See: https://developer.apple.com/documentation/CloudKit/CKAccountChangedNotification CKAccountChangedNotification string // CKCurrentUserDefaultName is a constant that provides the current user’s default name. // // See: https://developer.apple.com/documentation/CloudKit/CKCurrentUserDefaultName CKCurrentUserDefaultName string // CKErrorDomain is the error domain for CloudKit errors. // // See: https://developer.apple.com/documentation/CloudKit/CKErrorDomain CKErrorDomain string // CKErrorRetryAfterKey is the key to retrieve the number of seconds to wait before you retry a request. // // See: https://developer.apple.com/documentation/CloudKit/CKErrorRetryAfterKey CKErrorRetryAfterKey string // CKErrorUserDidResetEncryptedDataKey is the key that determines whether CloudKit deletes a record zone because of a user action. // // See: https://developer.apple.com/documentation/CloudKit/CKErrorUserDidResetEncryptedDataKey CKErrorUserDidResetEncryptedDataKey string // CKPartialErrorsByItemIDKey is the key to retrieve partial errors. // // See: https://developer.apple.com/documentation/CloudKit/CKPartialErrorsByItemIDKey CKPartialErrorsByItemIDKey string // CKRecordChangedErrorAncestorRecordKey is the key to retrieve the original version of the record. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordChangedErrorAncestorRecordKey CKRecordChangedErrorAncestorRecordKey string // CKRecordChangedErrorClientRecordKey is the key to retrieve the local version of the record. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordChangedErrorClientRecordKey CKRecordChangedErrorClientRecordKey string // CKRecordChangedErrorServerRecordKey is the key to retrieve the server’s version of the record. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordChangedErrorServerRecordKey CKRecordChangedErrorServerRecordKey string // // See: https://developer.apple.com/documentation/CloudKit/CKRecordNameZoneWideShare CKRecordNameZoneWideShare string // CKRecordZoneDefaultName is the default record zone’s name. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneDefaultName-8mfij CKRecordZoneDefaultName string )
var ( // CKQueryOperationMaximumResults is a constant value that represents the maximum number of results CloudKit retrieves. // // See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/maximumResults CKQueryOperationMaximumResults uint )
var CKRecordTypes struct { // Share: The system type that identifies a share record. Share CKRecordType // UserRecord: The system type that identifies a user record. UserRecord CKRecordType }
CKRecordTypes provides typed accessors for CKRecordType constants.
Functions ¶
func NewCKAccountStatusErrorBlock ¶
func NewCKAccountStatusErrorBlock(handler CKAccountStatusErrorHandler) (objc.ID, func())
NewCKAccountStatusErrorBlock wraps a Go CKAccountStatusErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKRecordErrorBlock ¶
func NewCKRecordErrorBlock(handler CKRecordErrorHandler) (objc.ID, func())
NewCKRecordErrorBlock wraps a Go CKRecordErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKRecordFloat64Block ¶ added in v0.6.10
func NewCKRecordFloat64Block(handler CKRecordFloat64Handler) (objc.ID, func())
NewCKRecordFloat64Block wraps a Go CKRecordFloat64Handler as an Objective-C block. The caller must defer the returned cleanup function.
func NewCKRecordIDBlock ¶
func NewCKRecordIDBlock(handler CKRecordIDHandler) (objc.ID, func())
NewCKRecordIDBlock wraps a Go CKRecordIDHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKRecordIDErrorBlock ¶
func NewCKRecordIDErrorBlock(handler CKRecordIDErrorHandler) (objc.ID, func())
NewCKRecordIDErrorBlock wraps a Go CKRecordIDErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKRecordIDFloat64Block ¶ added in v0.6.10
func NewCKRecordIDFloat64Block(handler CKRecordIDFloat64Handler) (objc.ID, func())
NewCKRecordIDFloat64Block wraps a Go CKRecordIDFloat64Handler as an Objective-C block. The caller must defer the returned cleanup function.
func NewCKRecordZoneArrayErrorBlock ¶ added in v0.6.10
func NewCKRecordZoneArrayErrorBlock(handler CKRecordZoneArrayErrorHandler) (objc.ID, func())
NewCKRecordZoneArrayErrorBlock wraps a Go CKRecordZoneArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKRecordZoneErrorBlock ¶
func NewCKRecordZoneErrorBlock(handler CKRecordZoneErrorHandler) (objc.ID, func())
NewCKRecordZoneErrorBlock wraps a Go CKRecordZoneErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKRecordZoneIDBlock ¶
func NewCKRecordZoneIDBlock(handler CKRecordZoneIDHandler) (objc.ID, func())
NewCKRecordZoneIDBlock wraps a Go CKRecordZoneIDHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewCKRecordZoneIDCKServerChangeTokenDataBlock ¶
func NewCKRecordZoneIDCKServerChangeTokenDataBlock(handler CKRecordZoneIDCKServerChangeTokenDataHandler) (objc.ID, func())
NewCKRecordZoneIDCKServerChangeTokenDataBlock wraps a Go CKRecordZoneIDCKServerChangeTokenDataHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewCKRecordZoneIDErrorBlock ¶
func NewCKRecordZoneIDErrorBlock(handler CKRecordZoneIDErrorHandler) (objc.ID, func())
NewCKRecordZoneIDErrorBlock wraps a Go CKRecordZoneIDErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKServerChangeTokenBlock ¶
func NewCKServerChangeTokenBlock(handler CKServerChangeTokenHandler) (objc.ID, func())
NewCKServerChangeTokenBlock wraps a Go CKServerChangeTokenHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewCKShareErrorBlock ¶
func NewCKShareErrorBlock(handler CKShareErrorHandler) (objc.ID, func())
NewCKShareErrorBlock wraps a Go CKShareErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKShareMetadataErrorBlock ¶
func NewCKShareMetadataErrorBlock(handler CKShareMetadataErrorHandler) (objc.ID, func())
NewCKShareMetadataErrorBlock wraps a Go CKShareMetadataErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKShareParticipantErrorBlock ¶
func NewCKShareParticipantErrorBlock(handler CKShareParticipantErrorHandler) (objc.ID, func())
NewCKShareParticipantErrorBlock wraps a Go CKShareParticipantErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKSubscriptionArrayErrorBlock ¶ added in v0.6.10
func NewCKSubscriptionArrayErrorBlock(handler CKSubscriptionArrayErrorHandler) (objc.ID, func())
NewCKSubscriptionArrayErrorBlock wraps a Go CKSubscriptionArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKSubscriptionErrorBlock ¶
func NewCKSubscriptionErrorBlock(handler CKSubscriptionErrorHandler) (objc.ID, func())
NewCKSubscriptionErrorBlock wraps a Go CKSubscriptionErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewCKUserIdentityArrayErrorBlock ¶ added in v0.6.10
func NewCKUserIdentityArrayErrorBlock(handler CKUserIdentityArrayErrorHandler) (objc.ID, func())
NewCKUserIdentityArrayErrorBlock wraps a Go CKUserIdentityArrayErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [CKContainer.DiscoverAllIdentitiesWithCompletionHandler]
func NewCKUserIdentityBlock ¶
func NewCKUserIdentityBlock(handler CKUserIdentityHandler) (objc.ID, func())
NewCKUserIdentityBlock wraps a Go CKUserIdentityHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewCKUserIdentityCKUserIdentityLookupInfoBlock ¶
func NewCKUserIdentityCKUserIdentityLookupInfoBlock(handler CKUserIdentityCKUserIdentityLookupInfoHandler) (objc.ID, func())
NewCKUserIdentityCKUserIdentityLookupInfoBlock wraps a Go CKUserIdentityCKUserIdentityLookupInfoHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewCKUserIdentityErrorBlock ¶
func NewCKUserIdentityErrorBlock(handler CKUserIdentityErrorHandler) (objc.ID, func())
NewCKUserIdentityErrorBlock wraps a Go CKUserIdentityErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [CKContainer.DiscoverUserIdentityWithEmailAddressCompletionHandler]
- [CKContainer.DiscoverUserIdentityWithPhoneNumberCompletionHandler]
- [CKContainer.DiscoverUserIdentityWithUserRecordIDCompletionHandler]
func NewErrorBlock ¶
func NewErrorBlock(handler ErrorHandler) (objc.ID, func())
NewErrorBlock wraps a Go ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [CKContainer.RequestApplicationPermissionCompletionHandler]
- [CKContainer.StatusForApplicationPermissionCompletionHandler]
- CKSyncEngine.FetchChangesWithCompletionHandler
- CKSyncEngine.FetchChangesWithOptionsCompletionHandler
- CKSyncEngine.SendChangesWithCompletionHandler
- CKSyncEngine.SendChangesWithOptionsCompletionHandler
func NewVoidBlock ¶
func NewVoidBlock(handler VoidHandler) (objc.ID, func())
NewVoidBlock wraps a Go VoidHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
Types ¶
type CKAcceptSharesOperation ¶
type CKAcceptSharesOperation struct {
}
An operation that confirms a user’s participation in a share.
Overview ¶
Use this operation to accept participation in one or more shares. You create the operation with an array of share metadatas, which CloudKit provides to your app when the user taps or clicks a share’s CKShare.URL. The method CloudKit calls varies by platform and app configuration. For more information, see CKShareMetadata. You can also fetch a share’s metadata using CKFetchShareMetadataOperation.
If there are several metadatas, group them by their CKShareMetadata.ContainerIdentifier and create an operation for each container. Then add the operation to each container’s operation queue to run it. The operation executes its callbacks on a private serial queue.
The operation calls perShareCompletionBlock once for each metadata you provide. CloudKit returns the metadata and its related share, or an error if it can’t accept the share. CloudKit also batches per-metadata errors. If the operation completes with errors, it returns a partialFailure error. The error stores individual errors in its userInfo dictionary. Use the CKPartialErrorsByItemIDKey key to extract them.
After CloudKit applies all record changes, the operation calls acceptSharesCompletionBlock. When the closure executes, the server may continue processing residual tasks of the operation, such as creating the record zone in the user’s private database.
The following example demonstrates how to accept a share that CloudKit provides to your window scene delegate. It shows how to create the operation, configure it, and execute it in the correct container:
Creating a Share Accept Operation ¶
- CKAcceptSharesOperation.InitWithShareMetadatas: Creates an operation for accepting the specified shares.
Processing the Share Accept Results ¶
- CKAcceptSharesOperation.ShareMetadatas: The share metadatas to process.
- CKAcceptSharesOperation.SetShareMetadatas
See: https://developer.apple.com/documentation/CloudKit/CKAcceptSharesOperation
func CKAcceptSharesOperationFromID ¶
func CKAcceptSharesOperationFromID(id objc.ID) CKAcceptSharesOperation
CKAcceptSharesOperationFromID constructs a CKAcceptSharesOperation from an objc.ID.
An operation that confirms a user’s participation in a share.
func NewCKAcceptSharesOperation ¶
func NewCKAcceptSharesOperation() CKAcceptSharesOperation
NewCKAcceptSharesOperation creates a new CKAcceptSharesOperation instance.
func NewCKAcceptSharesOperationWithShareMetadatas ¶
func NewCKAcceptSharesOperationWithShareMetadatas(shareMetadatas []CKShareMetadata) CKAcceptSharesOperation
Creates an operation for accepting the specified shares.
shareMetadatas: The share metadatas to accept. If you specify `nil`, you must assign a value to the CKAcceptSharesOperation.ShareMetadatas property before you execute the operation.
Discussion ¶
After initializing the operation, assign a handler to the acceptSharesCompletionBlock property to process the results.
See: https://developer.apple.com/documentation/CloudKit/CKAcceptSharesOperation/init(shareMetadatas:)
func (CKAcceptSharesOperation) Autorelease ¶
func (c CKAcceptSharesOperation) Autorelease() CKAcceptSharesOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKAcceptSharesOperation) Init ¶
func (c CKAcceptSharesOperation) Init() CKAcceptSharesOperation
Init initializes the instance.
func (CKAcceptSharesOperation) InitWithShareMetadatas ¶
func (c CKAcceptSharesOperation) InitWithShareMetadatas(shareMetadatas []CKShareMetadata) CKAcceptSharesOperation
Creates an operation for accepting the specified shares.
shareMetadatas: The share metadatas to accept. If you specify `nil`, you must assign a value to the CKAcceptSharesOperation.ShareMetadatas property before you execute the operation.
Discussion ¶
After initializing the operation, assign a handler to the acceptSharesCompletionBlock property to process the results.
See: https://developer.apple.com/documentation/CloudKit/CKAcceptSharesOperation/init(shareMetadatas:)
func (CKAcceptSharesOperation) SetShareMetadatas ¶
func (c CKAcceptSharesOperation) SetShareMetadatas(value []CKShareMetadata)
func (CKAcceptSharesOperation) ShareMetadatas ¶
func (c CKAcceptSharesOperation) ShareMetadatas() []CKShareMetadata
The share metadatas to process.
Discussion ¶
Use this property to view or change the metadata of the shares you want to process. If you intend to specify or change the value of this property, do so before you execute the operation or submit it to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKAcceptSharesOperation/shareMetadatas
type CKAcceptSharesOperationClass ¶
type CKAcceptSharesOperationClass struct {
// contains filtered or unexported fields
}
func GetCKAcceptSharesOperationClass ¶
func GetCKAcceptSharesOperationClass() CKAcceptSharesOperationClass
GetCKAcceptSharesOperationClass returns the class object for CKAcceptSharesOperation.
func (CKAcceptSharesOperationClass) Alloc ¶
func (cc CKAcceptSharesOperationClass) Alloc() CKAcceptSharesOperation
Alloc allocates memory for a new instance of the class.
func (CKAcceptSharesOperationClass) Class ¶
func (cc CKAcceptSharesOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKAccountStatus ¶
type CKAccountStatus int
See: https://developer.apple.com/documentation/CloudKit/CKAccountStatus
const ( // CKAccountStatusAvailable: The user’s iCloud account is available. CKAccountStatusAvailable CKAccountStatus = 1 // CKAccountStatusCouldNotDetermine: CloudKit can’t determine the status of the user’s iCloud account. CKAccountStatusCouldNotDetermine CKAccountStatus = 0 // CKAccountStatusNoAccount: The device doesn’t have an iCloud account. CKAccountStatusNoAccount CKAccountStatus = 3 // CKAccountStatusRestricted: The system denies access to the user’s iCloud account. CKAccountStatusRestricted CKAccountStatus = 2 CKAccountStatusTemporarilyUnavailable CKAccountStatus = 4 )
func (CKAccountStatus) String ¶
func (e CKAccountStatus) String() string
type CKAccountStatusErrorHandler ¶
type CKAccountStatusErrorHandler = func(CKAccountStatus, error)
CKAccountStatusErrorHandler handles The handler to execute when the call completes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKAllowedSharingOptions ¶
type CKAllowedSharingOptions struct {
objectivec.Object
}
An object that controls participant access and permission options.
Overview ¶
Register an instance of this class with an NSItemProvider or when preparing a CKShareTransferRepresentation.ExportedShare before your app invokes the share sheet. The share sheet uses the registered CKAllowedSharingOptions object to let the user choose between the allowed options when sharing.
Creating sharing options ¶
- CKAllowedSharingOptions.InitWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions: Creates and initializes an allowed sharing options object.
Configuring the options ¶
- CKAllowedSharingOptions.AllowedParticipantAccessOptions: The permission option the system uses to control whether a user can share publicly or privately.
- CKAllowedSharingOptions.SetAllowedParticipantAccessOptions
- CKAllowedSharingOptions.AllowedParticipantPermissionOptions: The permission option the system uses to control whether a user can grant read-only or write access.
- CKAllowedSharingOptions.SetAllowedParticipantPermissionOptions
Initializers ¶
Instance Properties ¶
- CKAllowedSharingOptions.AllowsAccessRequests: Default value is [NO]. If set, the system sharing UI will allow the user to configure whether access requests are enabled on the share.
- CKAllowedSharingOptions.SetAllowsAccessRequests
- CKAllowedSharingOptions.AllowsParticipantsToInviteOthers: Default value is [NO]. If set, the system sharing UI will allow the user to choose whether added participants can invite others to the share. Shares with [CKShare.ParticipantRole.administrator](<doc://com.apple.cloudkit/documentation/CloudKit/CKShare/ParticipantRole/administrator>) participants will be returned as read-only to devices running OS versions prior to this role being introduced. Administrator participants on these read-only shares will be returned as [CKShare.ParticipantRole.privateUser](<doc://com.apple.cloudkit/documentation/CloudKit/CKShare/ParticipantRole/privateUser>).
- CKAllowedSharingOptions.SetAllowsParticipantsToInviteOthers
See: https://developer.apple.com/documentation/CloudKit/CKAllowedSharingOptions
func CKAllowedSharingOptionsFromID ¶
func CKAllowedSharingOptionsFromID(id objc.ID) CKAllowedSharingOptions
CKAllowedSharingOptionsFromID constructs a CKAllowedSharingOptions from an objc.ID.
An object that controls participant access and permission options.
func NewCKAllowedSharingOptions ¶
func NewCKAllowedSharingOptions() CKAllowedSharingOptions
NewCKAllowedSharingOptions creates a new CKAllowedSharingOptions instance.
func NewCKAllowedSharingOptionsWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions ¶
func NewCKAllowedSharingOptionsWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions(allowedParticipantPermissionOptions CKSharingParticipantPermissionOption, allowedParticipantAccessOptions CKSharingParticipantAccessOption) CKAllowedSharingOptions
Creates and initializes an allowed sharing options object.
allowedParticipantPermissionOptions: The CKSharingParticipantPermissionOption setting.
allowedParticipantAccessOptions: The CKSharingParticipantAccessOption setting.
func NewCKAllowedSharingOptionsWithCoder ¶ added in v0.6.10
func NewCKAllowedSharingOptionsWithCoder(coder foundation.INSCoder) CKAllowedSharingOptions
See: https://developer.apple.com/documentation/CloudKit/CKAllowedSharingOptions/init(coder:)
func (CKAllowedSharingOptions) AllowedParticipantAccessOptions ¶
func (c CKAllowedSharingOptions) AllowedParticipantAccessOptions() CKSharingParticipantAccessOption
The permission option the system uses to control whether a user can share publicly or privately.
func (CKAllowedSharingOptions) AllowedParticipantPermissionOptions ¶
func (c CKAllowedSharingOptions) AllowedParticipantPermissionOptions() CKSharingParticipantPermissionOption
The permission option the system uses to control whether a user can grant read-only or write access.
func (CKAllowedSharingOptions) AllowsAccessRequests ¶
func (c CKAllowedSharingOptions) AllowsAccessRequests() bool
Default value is [NO]. If set, the system sharing UI will allow the user to configure whether access requests are enabled on the share.
See: https://developer.apple.com/documentation/CloudKit/CKAllowedSharingOptions/allowsAccessRequests
func (CKAllowedSharingOptions) AllowsParticipantsToInviteOthers ¶
func (c CKAllowedSharingOptions) AllowsParticipantsToInviteOthers() bool
Default value is [NO]. If set, the system sharing UI will allow the user to choose whether added participants can invite others to the share. Shares with CKShare.ParticipantRole.administrator participants will be returned as read-only to devices running OS versions prior to this role being introduced. Administrator participants on these read-only shares will be returned as CKShare.ParticipantRole.privateUser.
func (CKAllowedSharingOptions) Autorelease ¶
func (c CKAllowedSharingOptions) Autorelease() CKAllowedSharingOptions
Autorelease adds the receiver to the current autorelease pool.
func (CKAllowedSharingOptions) EncodeWithCoder ¶
func (c CKAllowedSharingOptions) EncodeWithCoder(coder foundation.INSCoder)
func (CKAllowedSharingOptions) Init ¶
func (c CKAllowedSharingOptions) Init() CKAllowedSharingOptions
Init initializes the instance.
func (CKAllowedSharingOptions) InitWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions ¶
func (c CKAllowedSharingOptions) InitWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions(allowedParticipantPermissionOptions CKSharingParticipantPermissionOption, allowedParticipantAccessOptions CKSharingParticipantAccessOption) CKAllowedSharingOptions
Creates and initializes an allowed sharing options object.
allowedParticipantPermissionOptions: The CKSharingParticipantPermissionOption setting.
allowedParticipantAccessOptions: The CKSharingParticipantAccessOption setting.
func (CKAllowedSharingOptions) InitWithCoder ¶ added in v0.6.10
func (c CKAllowedSharingOptions) InitWithCoder(coder foundation.INSCoder) CKAllowedSharingOptions
See: https://developer.apple.com/documentation/CloudKit/CKAllowedSharingOptions/init(coder:)
func (CKAllowedSharingOptions) SetAllowedParticipantAccessOptions ¶
func (c CKAllowedSharingOptions) SetAllowedParticipantAccessOptions(value CKSharingParticipantAccessOption)
func (CKAllowedSharingOptions) SetAllowedParticipantPermissionOptions ¶
func (c CKAllowedSharingOptions) SetAllowedParticipantPermissionOptions(value CKSharingParticipantPermissionOption)
func (CKAllowedSharingOptions) SetAllowsAccessRequests ¶
func (c CKAllowedSharingOptions) SetAllowsAccessRequests(value bool)
func (CKAllowedSharingOptions) SetAllowsParticipantsToInviteOthers ¶
func (c CKAllowedSharingOptions) SetAllowsParticipantsToInviteOthers(value bool)
type CKAllowedSharingOptionsClass ¶
type CKAllowedSharingOptionsClass struct {
// contains filtered or unexported fields
}
func GetCKAllowedSharingOptionsClass ¶
func GetCKAllowedSharingOptionsClass() CKAllowedSharingOptionsClass
GetCKAllowedSharingOptionsClass returns the class object for CKAllowedSharingOptions.
func (CKAllowedSharingOptionsClass) Alloc ¶
func (cc CKAllowedSharingOptionsClass) Alloc() CKAllowedSharingOptions
Alloc allocates memory for a new instance of the class.
func (CKAllowedSharingOptionsClass) Class ¶
func (cc CKAllowedSharingOptionsClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKAllowedSharingOptionsClass) StandardOptions ¶
func (_CKAllowedSharingOptionsClass CKAllowedSharingOptionsClass) StandardOptions() CKAllowedSharingOptions
An object set to the most permissive sharing options.
Discussion ¶
The `standardOptions` has CKAllowedSharingOptions.AllowedParticipantPermissionOptions set to CKSharingParticipantPermissionOptionAny and CKAllowedSharingOptions.AllowedParticipantAccessOptions set to CKSharingParticipantAccessOptionAny.
See: https://developer.apple.com/documentation/CloudKit/CKAllowedSharingOptions/standard
type CKApplicationPermissionBlock
deprecated
type CKApplicationPermissionBlock = func(CKApplicationPermissionStatus, foundation.NSError)
CKApplicationPermissionBlock is a closure that processes the outcome of a permissions request.
Deprecated: Deprecated since macOS 14.0. No longer supported. Please see Sharing CloudKit Data with Other iCloud Users.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/ApplicationPermissionBlock
type CKApplicationPermissionStatus ¶
type CKApplicationPermissionStatus int
See: https://developer.apple.com/documentation/CloudKit/CKContainer/ApplicationPermissionStatus
const ( // CKApplicationPermissionStatusCouldNotComplete: An error that occurs while processing the permission request. CKApplicationPermissionStatusCouldNotComplete CKApplicationPermissionStatus = 1 // CKApplicationPermissionStatusDenied: The user denies the permission. CKApplicationPermissionStatusDenied CKApplicationPermissionStatus = 2 // CKApplicationPermissionStatusGranted: The user grants the permission. CKApplicationPermissionStatusGranted CKApplicationPermissionStatus = 3 // CKApplicationPermissionStatusInitialState: The app is yet to request the permission. CKApplicationPermissionStatusInitialState CKApplicationPermissionStatus = 0 )
func (CKApplicationPermissionStatus) String ¶
func (e CKApplicationPermissionStatus) String() string
type CKApplicationPermissions ¶
type CKApplicationPermissions uint
See: https://developer.apple.com/documentation/CloudKit/CKContainer/ApplicationPermissions
const ( // Deprecated. CKApplicationPermissionUserDiscoverability CKApplicationPermissions = 1 )
func (CKApplicationPermissions) String ¶
func (e CKApplicationPermissions) String() string
type CKAsset ¶
type CKAsset struct {
objectivec.Object
}
An external file that belongs to a record.
Overview ¶
Use assets to incorporate external files into your app’s records, such as photos, videos, and binary files. Alternatively, use assets when a field’s value is more than a few kilobytes in size. To associate an instance of CKAsset with a record, assign it to one of its fields.
CloudKit stores an asset’s data separately from a record that references it, but maintains an association with that record. When you save a record that has an asset, CloudKit saves both the record and the asset to the server. Similarly, when you fetch the record, the server returns the record and the asset.
When you fetch a record that contains an asset, CloudKit stores the asset’s data in a staging area accessible to your app. Use the asset’s CKAsset.FileURL property to access its staged location. The system regularly deletes files in the staging area to reclaim disk space. To avoid this behavior, move the data into your app’s container as soon as you fetch it.
If you don’t require the asset when retrieving records, use the operation’s `desiredKeys` property to exclude the field. For more information, see CKFetchRecordsOperation, CKQueryOperation, and CKFetchRecordZoneChangesOperation.
If you no longer require an asset that’s on the server, you don’t delete it. Instead, orphan the asset by setting any fields that contain the asset to `nil` and then saving the record. CloudKit periodically deletes orphaned assets from the server.
Creating an Asset ¶
- CKAsset.InitWithFileURL: Creates an asset that references a file.
Getting the URL of the Asset ¶
- CKAsset.FileURL: The URL for accessing the asset.
See: https://developer.apple.com/documentation/CloudKit/CKAsset
func CKAssetFromID ¶
CKAssetFromID constructs a CKAsset from an objc.ID.
An external file that belongs to a record.
func NewCKAssetWithFileURL ¶
func NewCKAssetWithFileURL(fileURL foundation.NSURL) CKAsset
Creates an asset that references a file.
fileURL: The URL of the file that you want to store in CloudKit. The URL must be a file URL, and must not be `nil`.
Return Value ¶
An asset object that represents the specified file, or `nil` if the system can’t create the asset.
Discussion ¶
Use this method to initialize new file-based assets that you want to transfer to iCloud. After saving an asset to the server, CloudKit doesn’t delete the file at the specified URL. If you no longer need the file, you must delete it yourself. When you subsequently download a record that contains an asset, CloudKit downloads its own copy of the asset data to the local device and provides you with a URL to that file.
You can assign only one record to the asset that this method returns. If you want multiple records to point to the same file, you must create separate assets for each one.
See: https://developer.apple.com/documentation/CloudKit/CKAsset/init(fileURL:)
func (CKAsset) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (CKAsset) FileURL ¶
func (c CKAsset) FileURL() foundation.NSURL
The URL for accessing the asset.
Discussion ¶
After you create an asset, use the URL in this property to access the asset’s contents. The URL in this property is different from the one you specify when creating the asset.
See: https://developer.apple.com/documentation/CloudKit/CKAsset/fileURL
func (CKAsset) InitWithFileURL ¶
func (c CKAsset) InitWithFileURL(fileURL foundation.NSURL) CKAsset
Creates an asset that references a file.
fileURL: The URL of the file that you want to store in CloudKit. The URL must be a file URL, and must not be `nil`.
Return Value ¶
An asset object that represents the specified file, or `nil` if the system can’t create the asset.
Discussion ¶
Use this method to initialize new file-based assets that you want to transfer to iCloud. After saving an asset to the server, CloudKit doesn’t delete the file at the specified URL. If you no longer need the file, you must delete it yourself. When you subsequently download a record that contains an asset, CloudKit downloads its own copy of the asset data to the local device and provides you with a URL to that file.
You can assign only one record to the asset that this method returns. If you want multiple records to point to the same file, you must create separate assets for each one.
See: https://developer.apple.com/documentation/CloudKit/CKAsset/init(fileURL:)
type CKAssetClass ¶
type CKAssetClass struct {
// contains filtered or unexported fields
}
func GetCKAssetClass ¶
func GetCKAssetClass() CKAssetClass
GetCKAssetClass returns the class object for CKAsset.
func (CKAssetClass) Alloc ¶
func (cc CKAssetClass) Alloc() CKAsset
Alloc allocates memory for a new instance of the class.
func (CKAssetClass) Class ¶
func (cc CKAssetClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKContainer ¶
type CKContainer struct {
objectivec.Object
}
A conduit to your app’s databases.
Overview ¶
A container manages all explicit and implicit attempts to access its contents.
Every app has a default container that manages its own content. If you develop a suite of apps, you can access any containers that you have the appropriate entitlements for. Each new container distinguishes between public and private data. CloudKit always stores private data in the appropriate container directory in the user’s iCloud account.
Interacting with a Container ¶
A container coordinates all interactions between your app and the server. Most of these interactions involve the following tasks:
- Determining whether the user has an iCloud account, which lets you know if you can write data to the user’s personal storage. - With the user’s permission, discovering other users who the current user knows, and making the current user’s information discoverable. - Getting the container or one of its databases to use with an operation.
Public and Private Databases ¶
Each container provides a public and a private database for storing data. The contents of the public database are accessible to all users of the app, whereas the contents of the private database are, by default, visible only to the current user. Content that is specific to a single user usually belongs in that user’s private database, whereas app-related content that you provide (or that users want to share) belongs in the public database.
The public database is always available, regardless of whether the device has an active iCloud account. When there isn’t an iCloud account, your app can fetch records from and query the public database, but it can’t save changes. Saving records to the public database requires an active iCloud account to identify the owner of those records. Access to the private database always requires an active iCloud account on the device.
Using iCloud ¶
Whenever possible, design your app to run gracefully with or without an active iCloud account. Even without an active iCloud account, apps can fetch records from the public database and display that information to the user. If your app requires the ability to write to the public database or requires access to the private database, notify the user of the reason and encourage them to enable iCloud. You can even provide a button that takes the user directly to Settings so that they can enable iCloud. To implement such a button, have the button’s action open the URL that the openSettingsURLString constant provides.
User Records and Permissions ¶
When a user accesses a container for the first time, CloudKit assigns them a unique identifier and uses it to create two user records — one in the app’s public database and another in that user’s private database. By default, these records don’t contain any identifying personal information, but you can use the record in the user’s private database to store additional, nonsensitive information about that user. Because the public database’s user record is accessible to all users of your app, don’t use it to store information about the user.
While a user record isn’t the same as the user’s CKUserIdentity, the identity does provide the identifier of their user record that you can use to fetch that record from either the public database or the user’s private database. For more information, see CKUserIdentity.UserRecordID.
Testing Your Code Using the Development Container ¶
At runtime, CloudKit uses your app’s `com.AppleXCUIElementTypeDeveloperXCUIElementTypeIcloud()-container-environment` entitlement to discover whether you’re using a [Development] or [Production] version of your provisioning profile. When you configure the entitlement for development, CloudKit configures the app’s containers to use the development server. The development environment is a safe place to make changes during the development process without disrupting users of your app. You can add new fields to records programmatically, and you can delete or modify fields using iCloud Dashboard.
Before shipping your app, always test your app’s behavior in the production environment. The production server generates errors when your app tries to add record types or add new fields to existing record types. Testing in the production environment helps you find and fix the places in your code where you’re making those types of changes. You can use CloudKit Dashboard to modify record types in the development environment, and then migrate those changes to the production environment.
Getting the Public and Private Databases ¶
- CKContainer.PrivateCloudDatabase: The user’s private database.
- CKContainer.PublicCloudDatabase: The app’s public database.
- CKContainer.SharedCloudDatabase: The database that contains shared data.
- CKContainer.DatabaseWithDatabaseScope: Returns the database with the specified scope.
Getting the Container’s Identifier ¶
- CKContainer.ContainerIdentifier: The container’s unique identifier.
Determining the User’s iCloud Access Status ¶
- CKContainer.AccountStatusWithCompletionHandler: Determines whether the system can access the user’s iCloud account.
Performing Operations on the Container ¶
- CKContainer.AddOperation: Adds an operation to the container’s queue.
Discovering User Records ¶
- CKContainer.FetchShareParticipantWithEmailAddressCompletionHandler: Fetches the share participant with the specified email address.
- CKContainer.FetchShareParticipantWithPhoneNumberCompletionHandler: Fetches the share participant with the specified phone number.
- CKContainer.FetchShareParticipantWithUserRecordIDCompletionHandler: Fetches the share participant with the specified user record ID.
- CKContainer.FetchUserRecordIDWithCompletionHandler: Fetches the user record ID of the current user.
Accessing Container Metadata ¶
- CKContainer.FetchShareMetadataWithURLCompletionHandler: Fetches the share metadata for the specified share URL.
- CKContainer.AcceptShareMetadataCompletionHandler: Accepts the specified share metadata.
See: https://developer.apple.com/documentation/CloudKit/CKContainer
func CKContainerFromID ¶
func CKContainerFromID(id objc.ID) CKContainer
CKContainerFromID constructs a CKContainer from an objc.ID.
A conduit to your app’s databases.
func NewCKContainer ¶
func NewCKContainer() CKContainer
NewCKContainer creates a new CKContainer instance.
func NewCKContainerWithIdentifier ¶
func NewCKContainerWithIdentifier(containerIdentifier string) CKContainer
Creates a container for the specified identifier.
containerIdentifier: The bundle identifier of the app with the container that you want to access. The bundle identifier must be in the app’s `com.AppleXCUIElementTypeDeveloperXCUIElementTypeIcloud()-container-identifiers` entitlement. This parameter must not be `nil`.
Discussion ¶
The specified identifier must correspond to one of the ubiquity containers in the iCloud capabilities section of your Xcode project. Including the identifier with your app’s capabilities adds the corresponding entitlements to your app. To access your app’s default container, use the CKContainerClass.DefaultContainer method instead.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/init(identifier:)
func (CKContainer) AcceptShareMetadata ¶
func (c CKContainer) AcceptShareMetadata(ctx context.Context, metadata ICKShareMetadata) (*CKShare, error)
AcceptShareMetadata is a synchronous wrapper around CKContainer.AcceptShareMetadataCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKContainer) AcceptShareMetadataCompletionHandler ¶
func (c CKContainer) AcceptShareMetadataCompletionHandler(metadata ICKShareMetadata, completionHandler CKShareErrorHandler)
Accepts the specified share metadata.
metadata: The metadata of the share to accept.
completionHandler: The handler to execute when the process finishes.
Discussion ¶
The closure doesn’t return a value and takes the following parameters:
- The corresponding share, or `nil` if CloudKit can’t accept the metadata. - An error if a problem occurs, or `nil` if CloudKit successfully accepts the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/accept(_:completionHandler:)-949ea
func (CKContainer) AccountStatus ¶
func (c CKContainer) AccountStatus(ctx context.Context) (CKAccountStatus, error)
AccountStatus is a synchronous wrapper around CKContainer.AccountStatusWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKContainer) AccountStatusWithCompletionHandler ¶
func (c CKContainer) AccountStatusWithCompletionHandler(completionHandler CKAccountStatusErrorHandler)
Determines whether the system can access the user’s iCloud account.
completionHandler: The handler to execute when the call completes.
Discussion ¶
The closure has no return value and takes the following parameters:
- The status of the user’s iCloud account. - An error that describes the failure, or `nil` if the system successfully determines the status.
This method determines the status of the user’s iCloud account asynchronously, passing the results to the closure that you provide. Call this method before accessing the private database to determine whether that database is available. While your app is running, use the CKAccountChanged notification to detect account changes, and call this method again to determine the status of the new account.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/accountStatus(completionHandler:)
func (CKContainer) AddOperation ¶
func (c CKContainer) AddOperation(operation ICKOperation)
Adds an operation to the container’s queue.
operation: The operation to add to the queue. Make sure you fully configure the operation and have it ready to execute. Don’t change the operation’s configuration after you queue it.
Discussion ¶
This method adds the operation to a queue that the container manages. The queue’s operations execute on background threads concurrently, and with default priorities. When you add an operation to the queue, its container becomes the current container.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/add(_:)
func (CKContainer) Autorelease ¶
func (c CKContainer) Autorelease() CKContainer
Autorelease adds the receiver to the current autorelease pool.
func (CKContainer) ContainerIdentifier ¶
func (c CKContainer) ContainerIdentifier() string
The container’s unique identifier.
Discussion ¶
Use this property’s value to distinguish different containers in your app.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/containerIdentifier
func (CKContainer) DatabaseWithDatabaseScope ¶
func (c CKContainer) DatabaseWithDatabaseScope(databaseScope CKDatabaseScope) ICKDatabase
Returns the database with the specified scope.
databaseScope: The database’s scope. See CKDatabase.Scope for the available options.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/database(with:)
func (CKContainer) FetchShareMetadataWithURL ¶
func (c CKContainer) FetchShareMetadataWithURL(ctx context.Context, url foundation.NSURL) (*CKShareMetadata, error)
FetchShareMetadataWithURL is a synchronous wrapper around CKContainer.FetchShareMetadataWithURLCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKContainer) FetchShareMetadataWithURLCompletionHandler ¶
func (c CKContainer) FetchShareMetadataWithURLCompletionHandler(url foundation.NSURL, completionHandler CKShareMetadataErrorHandler)
Fetches the share metadata for the specified share URL.
url: The share URL that CloudKit uses to locate the metadata.
completionHandler: The handler to execute with the fetch results.
Discussion ¶
The closure doesn’t return a value and takes the following parameters:
- The share metadata, or `nil` if CloudKit can’t find the metadata. - An error if a problem occurs, or `nil` if CloudKit successfully retrieves the metadata.
func (CKContainer) FetchShareParticipantWithEmailAddress ¶
func (c CKContainer) FetchShareParticipantWithEmailAddress(ctx context.Context, emailAddress string) (*CKShareParticipant, error)
FetchShareParticipantWithEmailAddress is a synchronous wrapper around CKContainer.FetchShareParticipantWithEmailAddressCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKContainer) FetchShareParticipantWithEmailAddressCompletionHandler ¶
func (c CKContainer) FetchShareParticipantWithEmailAddressCompletionHandler(emailAddress string, completionHandler CKShareParticipantErrorHandler)
Fetches the share participant with the specified email address.
emailAddress: The share participant’s email address.
completionHandler: The handler to execute with the fetch results.
Discussion ¶
The closure doesn’t return a value and takes the following parameters:
- The share participant, or `nil` if CloudKit can’t find the participant. - An error if a problem occurs, or `nil` if CloudKit successfully retrieves the participant.
CloudKit can translate any valid email address into a share participant. If the email address doesn’t correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the email address to an iCloud account.
This method searches for the share participant asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of CKFetchShareParticipantsOperation and configure it to use the necessary priority.
func (CKContainer) FetchShareParticipantWithPhoneNumber ¶
func (c CKContainer) FetchShareParticipantWithPhoneNumber(ctx context.Context, phoneNumber string) (*CKShareParticipant, error)
FetchShareParticipantWithPhoneNumber is a synchronous wrapper around CKContainer.FetchShareParticipantWithPhoneNumberCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKContainer) FetchShareParticipantWithPhoneNumberCompletionHandler ¶
func (c CKContainer) FetchShareParticipantWithPhoneNumberCompletionHandler(phoneNumber string, completionHandler CKShareParticipantErrorHandler)
Fetches the share participant with the specified phone number.
phoneNumber: The share participant’s phone number.
completionHandler: The handler to execute with the fetch results.
Discussion ¶
The closure doesn’t return a value and takes the following parameters:
- The share participant, or `nil` if CloudKit can’t find the participant. - An error if a problem occurs, or `nil` if CloudKit successfully retrieves the participant.
CloudKit can translate any valid phone number into a share participant. If the phone number doesn’t correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the phone number to an iCloud account.
This method searches for the share participant asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of CKFetchShareParticipantsOperation and configure it to use the necessary priority.
func (CKContainer) FetchShareParticipantWithUserRecordID ¶
func (c CKContainer) FetchShareParticipantWithUserRecordID(ctx context.Context, userRecordID ICKRecordID) (*CKShareParticipant, error)
FetchShareParticipantWithUserRecordID is a synchronous wrapper around CKContainer.FetchShareParticipantWithUserRecordIDCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKContainer) FetchShareParticipantWithUserRecordIDCompletionHandler ¶
func (c CKContainer) FetchShareParticipantWithUserRecordIDCompletionHandler(userRecordID ICKRecordID, completionHandler CKShareParticipantErrorHandler)
Fetches the share participant with the specified user record ID.
userRecordID: The share participant’s user record ID.
completionHandler: The handler to execute with the fetch results.
Discussion ¶
The closure doesn’t return a value and takes the following parameters:
- The share participant, or `nil` if CloudKit can’t find the participant. - An error if a problem occurs, or `nil` if CloudKit successfully retrieves the participant.
This method searches for the share participant asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of CKFetchShareParticipantsOperation and configure it to use the necessary priority.
func (CKContainer) FetchUserRecordID ¶
func (c CKContainer) FetchUserRecordID(ctx context.Context) (*CKRecordID, error)
FetchUserRecordID is a synchronous wrapper around CKContainer.FetchUserRecordIDWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKContainer) FetchUserRecordIDWithCompletionHandler ¶
func (c CKContainer) FetchUserRecordIDWithCompletionHandler(completionHandler CKRecordIDErrorHandler)
Fetches the user record ID of the current user.
completionHandler: The handler to execute with the fetch results.
Discussion ¶
The closure doesn’t return a value and takes the following parameters:
- The user record ID, or `nil` if the user disables iCloud or the device doesn’t have an iCloud account. - An error if a problem occurs, or `nil` if CloudKit successfully retrieves the user record ID.
CloudKit returns a CKError.Code.notAuthenticated error when any of the following conditions are met:
- The device has an iCloud account but the user disables iCloud. - The device has an iCloud account with restricted access. - The device doesn’t have an iCloud account.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/fetchUserRecordID(completionHandler:)
func (CKContainer) PrivateCloudDatabase ¶
func (c CKContainer) PrivateCloudDatabase() ICKDatabase
The user’s private database.
Discussion ¶
The user’s private database is only available if the device has an iCloud account. Only the user can access their private database, by default. They own all of the database’s content and can view and modify that content. Data in the private database isn’t visible in the developer portal.
Data in the private database counts toward the user’s iCloud storage quota.
If there isn’t an iCloud account on the user’s device, this property still returns a database, but any attempt to use it results in an error. To determine if there is an iCloud account on the device, use the CKContainer.AccountStatusWithCompletionHandler method.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/privateCloudDatabase
func (CKContainer) PublicCloudDatabase ¶
func (c CKContainer) PublicCloudDatabase() ICKDatabase
The app’s public database.
Discussion ¶
This database is available regardless of whether the user’s device has an iCloud account. The contents of the public database are readable by all users of the app, and users have write access to the records, and other objects, they create. The public database’s contents are visible in the developer portal, where you can assign roles to users and restrict access as necessary.
Data in the public database counts toward your app’s iCloud storage quota.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/publicCloudDatabase
func (CKContainer) SharedCloudDatabase ¶
func (c CKContainer) SharedCloudDatabase() ICKDatabase
The database that contains shared data.
Discussion ¶
This database is only available if the device has an iCloud account. Permissions on the database are available only to the user according to the permissions of the enclosing CKShare instance, which represents the shared record. The current user doesn’t own the content in the shared database, and can view and modify that content only if the necessary permissions exist. Data in the shared database isn’t visible in the developer portal or to any user who doesn’t have access.
Data in the shared database counts toward your app’s iCloud storage quota.
If there isn’t an iCloud account on the user’s device, this property still returns a database, but any attempt to use it results in an error. To determine if there is an iCloud account on the device, use the CKContainer.AccountStatusWithCompletionHandler method.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/sharedCloudDatabase
type CKContainerClass ¶
type CKContainerClass struct {
// contains filtered or unexported fields
}
func GetCKContainerClass ¶
func GetCKContainerClass() CKContainerClass
GetCKContainerClass returns the class object for CKContainer.
func (CKContainerClass) Alloc ¶
func (cc CKContainerClass) Alloc() CKContainer
Alloc allocates memory for a new instance of the class.
func (CKContainerClass) Class ¶
func (cc CKContainerClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKContainerClass) DefaultContainer ¶
func (_CKContainerClass CKContainerClass) DefaultContainer() CKContainer
Returns the app’s default container.
Discussion ¶
Use this method to retrieve your app’s default container. This is the one you typically use to store your app’s data. If you want the container for a different app, create a container using the [CKContainerClass.ContainerWithIdentifier] method.
During development, the container uses the development environment. When you release your app, the container uses the production environment.
See: https://developer.apple.com/documentation/CloudKit/CKContainer/default()
type CKDatabase ¶
type CKDatabase struct {
objectivec.Object
}
An object that represents a collection of record zones and subscriptions.
Overview ¶
A database takes requests and operations and applies them to the objects it contains, whether that’s record zones, records, or subscriptions. Each of your app’s users has access to the three separate databases:
- A public database that’s accessible to all users of your app. - A private database that’s accessible only to the user of the current device. - A shared database that’s accessible only to the user of the current device, which contains records that other iCloud users share with them.
The public database is always available, even when the device doesn’t have an active iCloud account. In this scenario, your app can fetch specific records and perform searches, but it can’t create or modify records. CloudKit requires an iCloud account for writing to the public database so it can identify the authors of any changes. All access to the private and shared databases requires an iCloud account.
You don’t create instances of CKDatabase, nor do you subclass it. Instead, you access the required database using one of your app’s containers. For more information, see CKContainer.
By default, CloudKit executes the methods in this class with a low-priority quality of service (QoS). To use a higher-priority QoS, perform the following:
- Create an instance of CKOperationConfiguration and set its CKOperationConfiguration.QualityOfService property to the preferred value. - Call the databaseʼs configuredWith(configuration:group:body:) method and provide the configuration and a trailing closure. - In the closure, use the provided database to execute the relevant methods at the preferred QoS.
Fetching Records ¶
- CKDatabase.FetchRecordWithIDCompletionHandler: Fetches a specific record.
Modifying Records ¶
- CKDatabase.SaveRecordCompletionHandler: Saves a specific record.
- CKDatabase.DeleteRecordWithIDCompletionHandler: Deletes a specific record.
Fetching Record Zones ¶
- CKDatabase.FetchAllRecordZonesWithCompletionHandler: Fetches all record zones from the current database.
- CKDatabase.FetchRecordZoneWithIDCompletionHandler: Fetches a specific record zone.
Modifying Record Zones ¶
- CKDatabase.SaveRecordZoneCompletionHandler: Saves a specific record zone.
- CKDatabase.DeleteRecordZoneWithIDCompletionHandler: Deletes a specific record zone.
Fetching Subscriptions ¶
- CKDatabase.FetchAllSubscriptionsWithCompletionHandler: Fetches all subscriptions from the current database.
Modifying Subscriptions ¶
- CKDatabase.SaveSubscriptionCompletionHandler: Saves a specific subscription.
Running Operations ¶
- CKDatabase.AddOperation: Executes the specified operation in the current database.
Getting the Database Type ¶
- CKDatabase.DatabaseScope: The type of database.
See: https://developer.apple.com/documentation/CloudKit/CKDatabase
func CKDatabaseFromID ¶
func CKDatabaseFromID(id objc.ID) CKDatabase
CKDatabaseFromID constructs a CKDatabase from an objc.ID.
An object that represents a collection of record zones and subscriptions.
func NewCKDatabase ¶
func NewCKDatabase() CKDatabase
NewCKDatabase creates a new CKDatabase instance.
func (CKDatabase) AddOperation ¶
func (c CKDatabase) AddOperation(operation ICKDatabaseOperation)
Executes the specified operation in the current database.
operation: The operation to execute.
Discussion ¶
Configure the operation fully before you call this method. Prior to the operation executing, CloudKit sets its CKDatabaseOperation.Database property to the current database. The operation executes at the priority and quality of service (QoS) that you specify using the queuePriority and qualityOfService properties.
See: https://developer.apple.com/documentation/CloudKit/CKDatabase/add(_:)
func (CKDatabase) Autorelease ¶
func (c CKDatabase) Autorelease() CKDatabase
Autorelease adds the receiver to the current autorelease pool.
func (CKDatabase) DatabaseScope ¶
func (c CKDatabase) DatabaseScope() CKDatabaseScope
The type of database.
Discussion ¶
For possible values, see CKDatabase.Scope.
See: https://developer.apple.com/documentation/CloudKit/CKDatabase/databaseScope
func (CKDatabase) DeleteRecordWithID ¶
func (c CKDatabase) DeleteRecordWithID(ctx context.Context, recordID ICKRecordID) (*CKRecordID, error)
DeleteRecordWithID is a synchronous wrapper around CKDatabase.DeleteRecordWithIDCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) DeleteRecordWithIDCompletionHandler ¶
func (c CKDatabase) DeleteRecordWithIDCompletionHandler(recordID ICKRecordID, completionHandler CKRecordIDErrorHandler)
Deletes a specific record.
recordID: The identifier of the record to delete.
completionHandler: The closure to execute after CloudKit deletes the record.
Discussion ¶
The completion handler takes the following parameters:
- The identifier of the deleted record, or `nil` if there’s an error. - An error if a problem occurs, or `nil` if CloudKit successfully deletes the record.
Deleting a record may cause additional deletions if other records in the database reference the deleted record. CloudKit doesn’t provide the identifiers of any additional records it deletes.
For information on a more convenient way to delete records, see modifyRecords(saving:deleting:savePolicy:atomically:).
func (CKDatabase) DeleteRecordZoneWithID ¶
func (c CKDatabase) DeleteRecordZoneWithID(ctx context.Context, zoneID ICKRecordZoneID) (*CKRecordZoneID, error)
DeleteRecordZoneWithID is a synchronous wrapper around CKDatabase.DeleteRecordZoneWithIDCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) DeleteRecordZoneWithIDCompletionHandler ¶
func (c CKDatabase) DeleteRecordZoneWithIDCompletionHandler(zoneID ICKRecordZoneID, completionHandler CKRecordZoneIDErrorHandler)
Deletes a specific record zone.
zoneID: The identifier of the record zone to delete.
completionHandler: The closure to execute after CloudKit deletes the record zone.
Discussion ¶
The completion handler takes the following parameters:
- The identifier of the deleted record zone, or `nil` if there’s an error. - An error if a problem occurs, or `nil` if CloudKit successfully deletes the record zone.
For information on a more convenient way to delete record zones, see modifyRecordZones(saving:deleting:).
func (CKDatabase) FetchAllRecordZones ¶ added in v0.6.10
func (c CKDatabase) FetchAllRecordZones(ctx context.Context) ([]CKRecordZone, error)
FetchAllRecordZones is a synchronous wrapper around CKDatabase.FetchAllRecordZonesWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) FetchAllRecordZonesWithCompletionHandler ¶ added in v0.6.10
func (c CKDatabase) FetchAllRecordZonesWithCompletionHandler(completionHandler CKRecordZoneArrayErrorHandler)
Fetches all record zones from the current database.
completionHandler: The closure to execute with the fetch results.
Discussion ¶
The completion handler takes the following parameters:
- An array of fetched record zones, or `nil` if there’s an error. When present, the array contains at least one record zone, the default zone. - An error if a problem occurs, or `nil` if CloudKit successfully fetches all record zones.
func (CKDatabase) FetchAllSubscriptions ¶ added in v0.6.10
func (c CKDatabase) FetchAllSubscriptions(ctx context.Context) ([]CKSubscription, error)
FetchAllSubscriptions is a synchronous wrapper around CKDatabase.FetchAllSubscriptionsWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) FetchAllSubscriptionsWithCompletionHandler ¶ added in v0.6.10
func (c CKDatabase) FetchAllSubscriptionsWithCompletionHandler(completionHandler CKSubscriptionArrayErrorHandler)
Fetches all subscriptions from the current database.
completionHandler: The closure to execute with the fetch results.
Discussion ¶
The completion handler takes the following parameters:
- The database’s subscriptions, or `nil` if CloudKit can’t provide the subscriptions. - An error if a problem occurs, or `nil` if the fetch completes successfully.
For information on a more configurable way to fetch all subscriptions from a specific database, see CKFetchSubscriptionsOperationClass.FetchAllSubscriptionsOperation.
func (CKDatabase) FetchRecordWithID ¶
func (c CKDatabase) FetchRecordWithID(ctx context.Context, recordID ICKRecordID) (*CKRecord, error)
FetchRecordWithID is a synchronous wrapper around CKDatabase.FetchRecordWithIDCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) FetchRecordWithIDCompletionHandler ¶
func (c CKDatabase) FetchRecordWithIDCompletionHandler(recordID ICKRecordID, completionHandler CKRecordErrorHandler)
Fetches a specific record.
recordID: The identifier of the record to fetch.
completionHandler: The closure to execute with the fetch results.
Discussion ¶
The completion handler takes the following parameters:
- The requested record, or `nil` if CloudKit can’t provide that record. - An error if a problem occurs, or `nil` if the fetch completes successfully.
For information on a more convenient way to fetch specific records, see records(for:desiredKeys:).
See: https://developer.apple.com/documentation/CloudKit/CKDatabase/fetch(withRecordID:completionHandler:)
func (CKDatabase) FetchRecordZoneWithID ¶
func (c CKDatabase) FetchRecordZoneWithID(ctx context.Context, zoneID ICKRecordZoneID) (*CKRecordZone, error)
FetchRecordZoneWithID is a synchronous wrapper around CKDatabase.FetchRecordZoneWithIDCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) FetchRecordZoneWithIDCompletionHandler ¶
func (c CKDatabase) FetchRecordZoneWithIDCompletionHandler(zoneID ICKRecordZoneID, completionHandler CKRecordZoneErrorHandler)
Fetches a specific record zone.
zoneID: The identifier of the record zone to fetch.
completionHandler: The closure to execute with the fetch results.
Discussion ¶
The completion handler takes the following parameters:
- The fetched record zone, or `nil` if there’s an error. - An error if a problem occurs, or `nil` if CloudKit successfully fetches the specified record zone.
For information on a more convenient way to fetch specific record zones, see recordZones(for:) in Swift or CKFetchRecordZonesOperation in Objective-C.
func (CKDatabase) SaveRecord ¶
SaveRecord is a synchronous wrapper around CKDatabase.SaveRecordCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) SaveRecordCompletionHandler ¶
func (c CKDatabase) SaveRecordCompletionHandler(record ICKRecord, completionHandler CKRecordErrorHandler)
Saves a specific record.
record: The record to save.
completionHandler: The closure to execute after CloudKit saves the record.
Discussion ¶
The completion handler takes the following parameters:
- The saved record (as it appears on the server), or `nil` if there’s an error. - An error if a problem occurs, or `nil` if CloudKit successfully saves the record.
The save succeeds only when the specified record is new, or is a more recent version than the one on the server.
For information on a more convenient way to save records, see modifyRecords(saving:deleting:savePolicy:atomically:).
See: https://developer.apple.com/documentation/CloudKit/CKDatabase/save(_:completionHandler:)-3tatz
func (CKDatabase) SaveRecordZone ¶
func (c CKDatabase) SaveRecordZone(ctx context.Context, zone ICKRecordZone) (*CKRecordZone, error)
SaveRecordZone is a synchronous wrapper around CKDatabase.SaveRecordZoneCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) SaveRecordZoneCompletionHandler ¶
func (c CKDatabase) SaveRecordZoneCompletionHandler(zone ICKRecordZone, completionHandler CKRecordZoneErrorHandler)
Saves a specific record zone.
zone: The record zone to save.
completionHandler: The closure to execute after CloudKit saves the record.
Discussion ¶
The completion handler takes the following parameters:
- The saved record zone (as it appears on the server), or `nil` if there’s an error. - An error if a problem occurs, or `nil` if CloudKit successfully saves the record zone.
For information on a more convenient way to save record zones, see modifyRecordZones(saving:deleting:).
See: https://developer.apple.com/documentation/CloudKit/CKDatabase/save(_:completionHandler:)-32ffr
func (CKDatabase) SaveSubscription ¶
func (c CKDatabase) SaveSubscription(ctx context.Context, subscription ICKSubscription) (*CKSubscription, error)
SaveSubscription is a synchronous wrapper around CKDatabase.SaveSubscriptionCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKDatabase) SaveSubscriptionCompletionHandler ¶
func (c CKDatabase) SaveSubscriptionCompletionHandler(subscription ICKSubscription, completionHandler CKSubscriptionErrorHandler)
Saves a specific subscription.
subscription: The subscription to save.
completionHandler: The closure to execute after CloudKit saves the subscription.
Discussion ¶
The completion handler takes the following parameters:
- The saved subscription (as it appears on the server), or `nil` if there’s an error. - An error if a problem occurs, or `nil` if CloudKit successfully saves the subscription.
For information on a more convenient way to save subscriptions, see modifySubscriptions(saving:deleting:).
See: https://developer.apple.com/documentation/CloudKit/CKDatabase/save(_:completionHandler:)-9pona
type CKDatabaseClass ¶
type CKDatabaseClass struct {
// contains filtered or unexported fields
}
func GetCKDatabaseClass ¶
func GetCKDatabaseClass() CKDatabaseClass
GetCKDatabaseClass returns the class object for CKDatabase.
func (CKDatabaseClass) Alloc ¶
func (cc CKDatabaseClass) Alloc() CKDatabase
Alloc allocates memory for a new instance of the class.
func (CKDatabaseClass) Class ¶
func (cc CKDatabaseClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKDatabaseNotification ¶
type CKDatabaseNotification struct {
CKNotification
}
A notification that triggers when the contents of a database change.
Overview ¶
Database subscriptions execute when changes happen in any of a database’s record zones, for example, when CloudKit saves a new record. When the subscription registers a change, it sends push notifications to the user’s devices to inform your app about the change. You can then fetch the changes and cache them on-device. When appropriate, CloudKit excludes the device where the change originates.
You configure a subscription’s notifications by setting it’s CKSubscription.NotificationInfo property. Do this before you save it to the server. A subscription generates either high-priority or medium-priority push notifications. CloudKit delivers medium-priority notifications to your app in the background. High-priority notifications are visual and the system displays them to the user. Visual notifications need the user’s permission. For more information, see Asking permission to use notifications.
A subscription uses CKNotificationInfo to configure its notifications. For background delivery, set only its CKNotificationInfo.ShouldSendContentAvailable property to true. If you set any other property, CloudKit treats the notification as high-priority.
Don’t rely on push notifications for specific changes because the system can coalesce them. CloudKit can omit data to keep the notification’s payload size under the APNs size limit. Consider notifications an indication of remote changes. Use CKDatabaseNotification.DatabaseScope to determine which database has changes, and then CKFetchDatabaseChangesOperation to fetch those changes. A notification’s CKNotification.IsPruned property is true if CloudKit omits data.
You don’t instantiate this class. Instead, implement application(_:didReceiveRemoteNotification:fetchCompletionHandler:) in your app delegate. Initialize CKNotification with the `userInfo` dictionary that CloudKit passes to the method. This returns an instance of the appropriate subclass. Use the CKNotification.NotificationType property to determine the type. Then cast to that type to access type-specific properties and methods.
Getting the Database Scope ¶
- CKDatabaseNotification.DatabaseScope: The type of database.
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseNotification
func CKDatabaseNotificationFromID ¶
func CKDatabaseNotificationFromID(id objc.ID) CKDatabaseNotification
CKDatabaseNotificationFromID constructs a CKDatabaseNotification from an objc.ID.
A notification that triggers when the contents of a database change.
func NewCKDatabaseNotification ¶
func NewCKDatabaseNotification() CKDatabaseNotification
NewCKDatabaseNotification creates a new CKDatabaseNotification instance.
func NewCKDatabaseNotificationFromRemoteNotificationDictionary ¶
func NewCKDatabaseNotificationFromRemoteNotificationDictionary(notificationDictionary foundation.INSDictionary) CKDatabaseNotification
Creates a new notification using the specified payload data.
notificationDictionary: The push notification’s payload data. Use the dictionary that the system provides to your app delegate’s application(_:didReceiveRemoteNotification:fetchCompletionHandler:) method. This parameter must not be `nil`.
func (CKDatabaseNotification) Autorelease ¶
func (c CKDatabaseNotification) Autorelease() CKDatabaseNotification
Autorelease adds the receiver to the current autorelease pool.
func (CKDatabaseNotification) DatabaseScope ¶
func (c CKDatabaseNotification) DatabaseScope() CKDatabaseScope
The type of database.
Discussion ¶
This property’s value is one of the constants that CKDatabase.Scope defines.
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseNotification/databaseScope
func (CKDatabaseNotification) Init ¶
func (c CKDatabaseNotification) Init() CKDatabaseNotification
Init initializes the instance.
type CKDatabaseNotificationClass ¶
type CKDatabaseNotificationClass struct {
// contains filtered or unexported fields
}
func GetCKDatabaseNotificationClass ¶
func GetCKDatabaseNotificationClass() CKDatabaseNotificationClass
GetCKDatabaseNotificationClass returns the class object for CKDatabaseNotification.
func (CKDatabaseNotificationClass) Alloc ¶
func (cc CKDatabaseNotificationClass) Alloc() CKDatabaseNotification
Alloc allocates memory for a new instance of the class.
func (CKDatabaseNotificationClass) Class ¶
func (cc CKDatabaseNotificationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKDatabaseOperation ¶
type CKDatabaseOperation struct {
CKOperation
}
The abstract base class for operations that act upon databases in CloudKit.
Overview ¶
Database operations typically involve fetching and saving records and other database objects, as well as executing queries on the contents of the database. Use this class’s CKDatabaseOperation.Database property to tell the operation which database to use when you execute it. Don’t subclass this class or create instances of it. Instead, create instances of one of its concrete subclasses.
Accessing the Database ¶
- CKDatabaseOperation.Database: The database that the operation uses.
- CKDatabaseOperation.SetDatabase
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseOperation
func CKDatabaseOperationFromID ¶
func CKDatabaseOperationFromID(id objc.ID) CKDatabaseOperation
CKDatabaseOperationFromID constructs a CKDatabaseOperation from an objc.ID.
The abstract base class for operations that act upon databases in CloudKit.
func NewCKDatabaseOperation ¶
func NewCKDatabaseOperation() CKDatabaseOperation
NewCKDatabaseOperation creates a new CKDatabaseOperation instance.
func (CKDatabaseOperation) Autorelease ¶
func (c CKDatabaseOperation) Autorelease() CKDatabaseOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKDatabaseOperation) Database ¶
func (c CKDatabaseOperation) Database() ICKDatabase
The database that the operation uses.
Discussion ¶
For operations that you execute in a custom queue, use this property to specify the target database. Setting the database also sets the corresponding container, which it inherits from CKOperation. If this property’s value is `nil`, the operation targets the user’s private database.
The default value is `nil`.
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseOperation/database
func (CKDatabaseOperation) Init ¶
func (c CKDatabaseOperation) Init() CKDatabaseOperation
Init initializes the instance.
func (CKDatabaseOperation) SetDatabase ¶
func (c CKDatabaseOperation) SetDatabase(value ICKDatabase)
type CKDatabaseOperationClass ¶
type CKDatabaseOperationClass struct {
// contains filtered or unexported fields
}
func GetCKDatabaseOperationClass ¶
func GetCKDatabaseOperationClass() CKDatabaseOperationClass
GetCKDatabaseOperationClass returns the class object for CKDatabaseOperation.
func (CKDatabaseOperationClass) Alloc ¶
func (cc CKDatabaseOperationClass) Alloc() CKDatabaseOperation
Alloc allocates memory for a new instance of the class.
func (CKDatabaseOperationClass) Class ¶
func (cc CKDatabaseOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKDatabaseScope ¶
type CKDatabaseScope int
See: https://developer.apple.com/documentation/CloudKit/CKDatabase/Scope
const ( // CKDatabaseScopePrivate: The private database. CKDatabaseScopePrivate CKDatabaseScope = 2 // CKDatabaseScopePublic: The public database. CKDatabaseScopePublic CKDatabaseScope = 1 CKDatabaseScopeShared CKDatabaseScope = 3 )
func (CKDatabaseScope) String ¶
func (e CKDatabaseScope) String() string
type CKDatabaseSubscription ¶
type CKDatabaseSubscription struct {
CKSubscription
}
A subscription that generates push notifications when CloudKit modifies records in a database.
Overview ¶
Subscriptions track the creation, modification, and deletion of records in a database, and are fundamental in keeping data on the user’s device up to date. A subscription applies only to the user that creates it. When a subscription registers a change, such as CloudKit saving a new record, it sends push notifications to the user’s devices to inform your app about the change. You can then fetch the changes and cache them on-device. When appropriate, the server excludes the device where the change originates.
A database subscription executes whenever a change occurs in a custom record zone that resides in the database where you save the subscription. This is important for the shared database because you don’t know what record zones exist in advance. The only exception to this is the default record zone in the user’s private database, which doesn’t participate in database subscriptions.
You can further specialize a database subscription by setting its CKDatabaseSubscription.RecordType property to a specific record type. This limits the scope of the subscription to only track changes to records of that type and reduces the number of notifications it generates.
Create any subscriptions on your app’s first launch. After you initialize a subscription, save it to the server using CKModifySubscriptionsOperation. After the operation completes, record that state on-device (in UserDefaults, for example). You can then check that state on subsequent launches to prevent unnecessary trips to the server.
To configure the notification that the subscription generates, set the subscription’s CKSubscription.NotificationInfo property. Because the system coalesces notifications, don’t rely on them for specific changes. CloudKit can omit data to keep the payload size under the APNs size limit. Consider notifications an indication of remote changes, and use CKFetchDatabaseChangesOperation to fetch the record zones that contain those changes. After you have the record zones, use CKFetchRecordZoneChangesOperation to fetch the changed records in each zone. Server change tokens allow you to limit the fetch results to just the changes since your previous fetch.
The example below shows how to create a database subscription in the user’s private database, configure the notifications it generates — in this case, silent push notifications — and then save that subscription to the server:
Accessing the Subscription Metadata ¶
- CKDatabaseSubscription.RecordType: The type of record that the subscription queries.
- CKDatabaseSubscription.SetRecordType
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseSubscription
func CKDatabaseSubscriptionFromID ¶
func CKDatabaseSubscriptionFromID(id objc.ID) CKDatabaseSubscription
CKDatabaseSubscriptionFromID constructs a CKDatabaseSubscription from an objc.ID.
A subscription that generates push notifications when CloudKit modifies records in a database.
func NewCKDatabaseSubscription ¶
func NewCKDatabaseSubscription() CKDatabaseSubscription
NewCKDatabaseSubscription creates a new CKDatabaseSubscription instance.
func NewCKDatabaseSubscriptionWithCoder ¶
func NewCKDatabaseSubscriptionWithCoder(aDecoder foundation.INSCoder) CKDatabaseSubscription
Creates a database subscription from a serialized instance.
aDecoder: The object that decodes the serialized database subscription.
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseSubscription/init(coder:)
func (CKDatabaseSubscription) Autorelease ¶
func (c CKDatabaseSubscription) Autorelease() CKDatabaseSubscription
Autorelease adds the receiver to the current autorelease pool.
func (CKDatabaseSubscription) Init ¶
func (c CKDatabaseSubscription) Init() CKDatabaseSubscription
Init initializes the instance.
func (CKDatabaseSubscription) RecordType ¶
func (c CKDatabaseSubscription) RecordType() unsafe.Pointer
The type of record that the subscription queries.
See: https://developer.apple.com/documentation/cloudkit/ckdatabasesubscription/recordtype-46v7a
func (CKDatabaseSubscription) SetRecordType ¶
func (c CKDatabaseSubscription) SetRecordType(value kernel.Pointer)
type CKDatabaseSubscriptionClass ¶
type CKDatabaseSubscriptionClass struct {
// contains filtered or unexported fields
}
func GetCKDatabaseSubscriptionClass ¶
func GetCKDatabaseSubscriptionClass() CKDatabaseSubscriptionClass
GetCKDatabaseSubscriptionClass returns the class object for CKDatabaseSubscription.
func (CKDatabaseSubscriptionClass) Alloc ¶
func (cc CKDatabaseSubscriptionClass) Alloc() CKDatabaseSubscription
Alloc allocates memory for a new instance of the class.
func (CKDatabaseSubscriptionClass) Class ¶
func (cc CKDatabaseSubscriptionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKDiscoverAllUserIdentitiesOperation ¶
type CKDiscoverAllUserIdentitiesOperation struct {
CKOperation
}
An operation that uses the device’s contacts to search for discoverable iCloud users.
Overview ¶
Use this operation to discover iCloud users that match entries in the device’s Contacts database. CloudKit uses the email addresses and phone numbers in each Contact record to search for a matching iCloud account.
Although your app doesn’t need authorization to use the Contacts database to execute this operation, if it has authorization, you can use the CKUserIdentity.ContactIdentifiers property on any returned user identity to fetch the corresponding Contact record from the database.
Before CloudKit can return a user’s identity, you must ask for their permission by calling [CKContainer.RequestApplicationPermissionCompletionHandler]. Do this as part of any onboarding where you can highlight the benefits of being discoverable within the context of your app.
The operation executes the handlers you provide on an internal queue it manages. You must provide handlers capable of executing on a background queue. Tasks that need access to the main queue must redirect as appropriate.
The operation calls discoverAllUserIdentitiesCompletionBlock after it executes and returns results. Use the completion handler to perform housekeeping tasks for the operation. It should also manage any failures, whether due to an error or an explicit cancellation.
CloudKit operations have a default QoS of QualityOfService.default. Operations with this service level are discretionary. The system schedules their execution at an optimal time according to battery level and network conditions, among other factors. Use the qualityOfService property to set a more appropriate QoS for the operation.
The following example shows how to create the operation, configure its callbacks, and execute it using the default container’s queue:
Processing the Operation Results ¶
- CKDiscoverAllUserIdentitiesOperation.UserIdentityDiscoveredBlock: The closure to execute for each user identity.
- CKDiscoverAllUserIdentitiesOperation.SetUserIdentityDiscoveredBlock
See: https://developer.apple.com/documentation/CloudKit/CKDiscoverAllUserIdentitiesOperation
func CKDiscoverAllUserIdentitiesOperationFromID ¶
func CKDiscoverAllUserIdentitiesOperationFromID(id objc.ID) CKDiscoverAllUserIdentitiesOperation
CKDiscoverAllUserIdentitiesOperationFromID constructs a CKDiscoverAllUserIdentitiesOperation from an objc.ID.
An operation that uses the device’s contacts to search for discoverable iCloud users.
func NewCKDiscoverAllUserIdentitiesOperation ¶
func NewCKDiscoverAllUserIdentitiesOperation() CKDiscoverAllUserIdentitiesOperation
NewCKDiscoverAllUserIdentitiesOperation creates a new CKDiscoverAllUserIdentitiesOperation instance.
func (CKDiscoverAllUserIdentitiesOperation) Autorelease ¶
func (c CKDiscoverAllUserIdentitiesOperation) Autorelease() CKDiscoverAllUserIdentitiesOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKDiscoverAllUserIdentitiesOperation) SetUserIdentityDiscoveredBlock ¶
func (c CKDiscoverAllUserIdentitiesOperation) SetUserIdentityDiscoveredBlock(value CKUserIdentityHandler)
func (CKDiscoverAllUserIdentitiesOperation) UserIdentityDiscoveredBlock ¶
func (c CKDiscoverAllUserIdentitiesOperation) UserIdentityDiscoveredBlock() CKUserIdentityHandler
The closure to execute for each user identity.
Discussion ¶
The closure doesn’t return a value and takes the following parameter:
- The user identity that matches an entry in the device’s Contacts.
The operation executes this closure one or more times for each user identity it discovers. Each time the closure executes, it executes serially with respect to the other closures of the operation.
If you intend to use this closure to process results, set it before you execute the operation or add the operation to a queue.
type CKDiscoverAllUserIdentitiesOperationClass ¶
type CKDiscoverAllUserIdentitiesOperationClass struct {
// contains filtered or unexported fields
}
func GetCKDiscoverAllUserIdentitiesOperationClass ¶
func GetCKDiscoverAllUserIdentitiesOperationClass() CKDiscoverAllUserIdentitiesOperationClass
GetCKDiscoverAllUserIdentitiesOperationClass returns the class object for CKDiscoverAllUserIdentitiesOperation.
func (CKDiscoverAllUserIdentitiesOperationClass) Alloc ¶
Alloc allocates memory for a new instance of the class.
func (CKDiscoverAllUserIdentitiesOperationClass) Class ¶
func (cc CKDiscoverAllUserIdentitiesOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKDiscoverUserIdentitiesOperation ¶
type CKDiscoverUserIdentitiesOperation struct {
CKOperation
}
An operation that uses the provided criteria to search for discoverable iCloud users.
Overview ¶
Use this operation to discover one or more iCloud users that match identity information you provide, such as email addresses and phone numbers.
Before CloudKit can return a user’s identity, you must ask for their permission by calling [CKContainer.RequestApplicationPermissionCompletionHandler]. Do this as part of any onboarding where you can highlight the benefits of being discoverable within the context of your app.
The operation executes the handlers you provide on an internal queue it manages. You must provide handlers capable of executing on a background queue. Tasks that need access to the main queue must redirect as appropriate.
The operation calls discoverUserIdentitiesCompletionBlock after it executes and returns results. Use the completion handler to perform housekeeping tasks for the operation. It should also manage any failures, whether due to an error or an explicit cancellation.
CloudKit operations have a default QoS of QualityOfService.default. Operations with this service level are discretionary. The system schedules their execution at an optimal time according to battery level and network conditions, among other factors. Use the qualityOfService property to set a more appropriate QoS for the operation.
The following example shows how to create the operation, configure its callbacks, and execute it using the default container’s queue:
Configuring the Operation ¶
- CKDiscoverUserIdentitiesOperation.UserIdentityLookupInfos: The lookup info for discovering user identities.
- CKDiscoverUserIdentitiesOperation.SetUserIdentityLookupInfos
Processing the Results ¶
- CKDiscoverUserIdentitiesOperation.UserIdentityDiscoveredBlock: The closure to execute for each user identity.
- CKDiscoverUserIdentitiesOperation.SetUserIdentityDiscoveredBlock
See: https://developer.apple.com/documentation/CloudKit/CKDiscoverUserIdentitiesOperation
func CKDiscoverUserIdentitiesOperationFromID ¶
func CKDiscoverUserIdentitiesOperationFromID(id objc.ID) CKDiscoverUserIdentitiesOperation
CKDiscoverUserIdentitiesOperationFromID constructs a CKDiscoverUserIdentitiesOperation from an objc.ID.
An operation that uses the provided criteria to search for discoverable iCloud users.
func NewCKDiscoverUserIdentitiesOperation ¶
func NewCKDiscoverUserIdentitiesOperation() CKDiscoverUserIdentitiesOperation
NewCKDiscoverUserIdentitiesOperation creates a new CKDiscoverUserIdentitiesOperation instance.
func NewCKDiscoverUserIdentitiesOperationWithUserIdentityLookupInfos ¶
func NewCKDiscoverUserIdentitiesOperationWithUserIdentityLookupInfos(userIdentityLookupInfos []CKUserIdentityLookupInfo) CKDiscoverUserIdentitiesOperation
Creates an operation for discovering the user identities of the specified lookup infos.
userIdentityLookupInfos: An array that contains instances of CKUserIdentityLookupInfo. CloudKit uses this parameter as the default value for the CKDiscoverUserIdentitiesOperation.UserIdentityLookupInfos property. If you specify `nil`, you must assign a value to that property before you execute the operation.
Discussion ¶
After you create the operation, assign a handler to discoverUserIdentitiesCompletionBlock so that you can process the search results.
func (CKDiscoverUserIdentitiesOperation) Autorelease ¶
func (c CKDiscoverUserIdentitiesOperation) Autorelease() CKDiscoverUserIdentitiesOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKDiscoverUserIdentitiesOperation) Init ¶
func (c CKDiscoverUserIdentitiesOperation) Init() CKDiscoverUserIdentitiesOperation
Init initializes the instance.
func (CKDiscoverUserIdentitiesOperation) SetUserIdentityDiscoveredBlock ¶
func (c CKDiscoverUserIdentitiesOperation) SetUserIdentityDiscoveredBlock(value CKUserIdentityCKUserIdentityLookupInfoHandler)
func (CKDiscoverUserIdentitiesOperation) SetUserIdentityLookupInfos ¶
func (c CKDiscoverUserIdentitiesOperation) SetUserIdentityLookupInfos(value []CKUserIdentityLookupInfo)
func (CKDiscoverUserIdentitiesOperation) UserIdentityDiscoveredBlock ¶
func (c CKDiscoverUserIdentitiesOperation) UserIdentityDiscoveredBlock() CKUserIdentityCKUserIdentityLookupInfoHandler
The closure to execute for each user identity.
Discussion ¶
The closure doesn’t return a value and takes the following parameters:
- The user identity. - The lookup info that corresponds to the user identity.
The operation executes this closure one or more times for each user identity it discovers. Each time the closure executes, it executes serially with respect to the other closures of the operation.
If you intend to use this closure to process results, set it before you execute the operation or add the operation to a queue.
func (CKDiscoverUserIdentitiesOperation) UserIdentityLookupInfos ¶
func (c CKDiscoverUserIdentitiesOperation) UserIdentityLookupInfos() []CKUserIdentityLookupInfo
The lookup info for discovering user identities.
Discussion ¶
Use this property to view or change the lookup info that CloudKit uses to discover user identities. If you intend to modify this property’s value, do so before you execute the operation or submit it to a queue.
type CKDiscoverUserIdentitiesOperationClass ¶
type CKDiscoverUserIdentitiesOperationClass struct {
// contains filtered or unexported fields
}
func GetCKDiscoverUserIdentitiesOperationClass ¶
func GetCKDiscoverUserIdentitiesOperationClass() CKDiscoverUserIdentitiesOperationClass
GetCKDiscoverUserIdentitiesOperationClass returns the class object for CKDiscoverUserIdentitiesOperation.
func (CKDiscoverUserIdentitiesOperationClass) Alloc ¶
func (cc CKDiscoverUserIdentitiesOperationClass) Alloc() CKDiscoverUserIdentitiesOperation
Alloc allocates memory for a new instance of the class.
func (CKDiscoverUserIdentitiesOperationClass) Class ¶
func (cc CKDiscoverUserIdentitiesOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKErrorCode ¶
type CKErrorCode int
See: https://developer.apple.com/documentation/CloudKit/CKError/Code
const ( CKErrorAccountTemporarilyUnavailable CKErrorCode = 36 CKErrorAlreadyShared CKErrorCode = 30 // CKErrorAssetFileModified: An error that occurs when the system modifies an asset while saving it. CKErrorAssetFileModified CKErrorCode = 17 // CKErrorAssetFileNotFound: An error that occurs when the system can’t find the specified asset. CKErrorAssetFileNotFound CKErrorCode = 16 // CKErrorAssetNotAvailable: An error that occurs when the system can’t access the specified asset. CKErrorAssetNotAvailable CKErrorCode = 35 // CKErrorBadContainer: An error that occurs when you use an unknown or unauthorized container. CKErrorBadContainer CKErrorCode = 5 // CKErrorBadDatabase: An error that occurs when the operation can’t complete for the specified database. CKErrorBadDatabase CKErrorCode = 24 // CKErrorBatchRequestFailed: An error that occurs when the system rejects the entire batch of changes. CKErrorBatchRequestFailed CKErrorCode = 22 // CKErrorChangeTokenExpired: An error that occurs when the change token expires. CKErrorChangeTokenExpired CKErrorCode = 21 // CKErrorConstraintViolation: An error that occurs when the server rejects the request because of a unique constraint violation. CKErrorConstraintViolation CKErrorCode = 19 // CKErrorIncompatibleVersion: An error that occurs when the current app version is older than the oldest allowed version. CKErrorIncompatibleVersion CKErrorCode = 18 // CKErrorInternalError: A nonrecoverable error that CloudKit encounters. CKErrorInternalError CKErrorCode = 1 // CKErrorInvalidArguments: An error that occurs when the request contains invalid information. CKErrorInvalidArguments CKErrorCode = 12 // CKErrorLimitExceeded: An error that occurs when a request’s size exceeds the limit. CKErrorLimitExceeded CKErrorCode = 27 // CKErrorManagedAccountRestricted: An error that occurs when CloudKit rejects a request due to a managed-account restriction. CKErrorManagedAccountRestricted CKErrorCode = 32 // CKErrorMissingEntitlement: An error that occurs when the app is missing a required entitlement. CKErrorMissingEntitlement CKErrorCode = 8 // CKErrorNetworkFailure: An error that occurs when a network is available, but CloudKit is inaccessible. CKErrorNetworkFailure CKErrorCode = 4 CKErrorNetworkUnavailable CKErrorCode = 3 // CKErrorNotAuthenticated: An error that occurs when the user is unauthenticated. CKErrorNotAuthenticated CKErrorCode = 9 // CKErrorOperationCancelled: An error that occurs when an operation cancels. CKErrorOperationCancelled CKErrorCode = 20 // CKErrorPartialFailure: An error that occurs when an operation completes with partial failures. CKErrorPartialFailure CKErrorCode = 2 // CKErrorParticipantAlreadyInvited: The user is already an invited participant on this share. CKErrorParticipantAlreadyInvited CKErrorCode = 37 // CKErrorParticipantMayNeedVerification: An error that occurs when the user isn’t a participant of the share. CKErrorParticipantMayNeedVerification CKErrorCode = 33 // CKErrorPermissionFailure: An error that occurs when the user doesn’t have permission to save or fetch data. CKErrorPermissionFailure CKErrorCode = 10 // CKErrorQuotaExceeded: An error that occurs when saving a record exceeds the user’s storage quota. CKErrorQuotaExceeded CKErrorCode = 25 // CKErrorReferenceViolation: An error that occurs when CloudKit can’t find the target of a reference. CKErrorReferenceViolation CKErrorCode = 31 // CKErrorRequestRateLimited: An error that occurs when CloudKit rate-limits requests. CKErrorRequestRateLimited CKErrorCode = 7 // CKErrorResultsTruncated: An error that occurs when CloudKit truncates a query’s results. CKErrorResultsTruncated CKErrorCode = 13 // CKErrorServerRecordChanged: An error that occurs when CloudKit rejects a record because the server’s version is different. CKErrorServerRecordChanged CKErrorCode = 14 // CKErrorServerRejectedRequest: An error that occurs when CloudKit rejects the request. CKErrorServerRejectedRequest CKErrorCode = 15 // CKErrorServerResponseLost: An error that occurs when CloudKit is unable to maintain the network connection and provide a response. CKErrorServerResponseLost CKErrorCode = 34 CKErrorServiceUnavailable CKErrorCode = 6 // CKErrorTooManyParticipants: An error that occurs when a share has too many participants. CKErrorTooManyParticipants CKErrorCode = 29 // CKErrorUnknownItem: An error that occurs when the specified record doesn’t exist. CKErrorUnknownItem CKErrorCode = 11 // CKErrorUserDeletedZone: An error that occurs when the user deletes a record zone using the Settings app. CKErrorUserDeletedZone CKErrorCode = 28 // CKErrorZoneBusy: An error that occurs when the server is too busy to handle the record zone operation. CKErrorZoneBusy CKErrorCode = 23 // CKErrorZoneNotFound: An error that occurs when the specified record zone doesn’t exist. CKErrorZoneNotFound CKErrorCode = 26 )
func (CKErrorCode) String ¶
func (e CKErrorCode) String() string
type CKFetchDatabaseChangesOperation ¶
type CKFetchDatabaseChangesOperation struct {
CKDatabaseOperation
}
An operation that fetches database changes.
Overview ¶
Use this operation to fetch all record zone changes in a database. This includes new record zones, changed zones — including deleted or purged zones — and zones that contain record changes. When you create the operation, you provide a server change token, which is an opaque token that represents a specific point in the database’s history. CloudKit returns only the changes that occur after that point. For your app’s first fetch, or to refetch every change in the database’s history, use `nil` instead.
The operation yields new change tokens during its execution, and issues a final change token when it completes without error. The change tokens conform to NSSecureCoding and are safe to cache on-disk. This operation’s tokens aren’t compatible with CKFetchRecordZoneChangesOperation so you should segregate them in your cache. Don’t infer any behavior or order from the tokens’ contents.
When your app launches for the first time, use this operation to fetch all the database’s changes. Cache the results on-device and use CKDatabaseSubscription to subscribe to future changes. Fetch those changes on receipt of the push notifications the subscription generates. It’s not necessary to perform a fetch each time your app launches, or to schedule fetches at regular intervals.
The operation calls CKFetchDatabaseChangesOperation.RecordZoneWithIDChangedBlock for each zone that contains record changes. It also calls it for new and modified record zones. Store the IDs that CloudKit provides to this callback. Use those IDs with CKFetchRecordZoneChangesOperation to fetch the corresponding changes. There are similar callbacks for deleted and purged record zones.
To run the operation, add it to the corresponding database’s operation queue. The operation executes its callbacks on a private serial queue.
The following example shows how to create the operation, configure its callbacks, and execute it. For brevity, it omits the delete, and purge callbacks.
Creating an Operation ¶
- CKFetchDatabaseChangesOperation.InitWithPreviousServerChangeToken: Creates an operation for fetching database changes.
Configuring the Operation ¶
- CKFetchDatabaseChangesOperation.FetchAllChanges: A Boolean value that indicates whether to send repeated requests to the server.
- CKFetchDatabaseChangesOperation.SetFetchAllChanges
- CKFetchDatabaseChangesOperation.PreviousServerChangeToken: The server change token.
- CKFetchDatabaseChangesOperation.SetPreviousServerChangeToken
- CKFetchDatabaseChangesOperation.ResultsLimit: The maximum number of results that the operation fetches.
- CKFetchDatabaseChangesOperation.SetResultsLimit
Processing the Operation’s Results ¶
- CKFetchDatabaseChangesOperation.RecordZoneWithIDChangedBlock: The closure to execute with a single record zone change.
- CKFetchDatabaseChangesOperation.SetRecordZoneWithIDChangedBlock
- CKFetchDatabaseChangesOperation.RecordZoneWithIDWasDeletedBlock: The closure to execute when a record zone no longer exists.
- CKFetchDatabaseChangesOperation.SetRecordZoneWithIDWasDeletedBlock
- CKFetchDatabaseChangesOperation.RecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock: The closure to execute when a user-invoked account reset deletes a record zone.
- CKFetchDatabaseChangesOperation.SetRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock
- CKFetchDatabaseChangesOperation.RecordZoneWithIDWasPurgedBlock: The closure to execute when CloudKit purges a record zone.
- CKFetchDatabaseChangesOperation.SetRecordZoneWithIDWasPurgedBlock
- CKFetchDatabaseChangesOperation.ChangeTokenUpdatedBlock: The closure to execute when the change token updates.
- CKFetchDatabaseChangesOperation.SetChangeTokenUpdatedBlock
See: https://developer.apple.com/documentation/CloudKit/CKFetchDatabaseChangesOperation
func CKFetchDatabaseChangesOperationFromID ¶
func CKFetchDatabaseChangesOperationFromID(id objc.ID) CKFetchDatabaseChangesOperation
CKFetchDatabaseChangesOperationFromID constructs a CKFetchDatabaseChangesOperation from an objc.ID.
An operation that fetches database changes.
func NewCKFetchDatabaseChangesOperation ¶
func NewCKFetchDatabaseChangesOperation() CKFetchDatabaseChangesOperation
NewCKFetchDatabaseChangesOperation creates a new CKFetchDatabaseChangesOperation instance.
func NewCKFetchDatabaseChangesOperationWithPreviousServerChangeToken ¶
func NewCKFetchDatabaseChangesOperationWithPreviousServerChangeToken(previousServerChangeToken ICKServerChangeToken) CKFetchDatabaseChangesOperation
Creates an operation for fetching database changes.
previousServerChangeToken: The change token that CloudKit uses to determine which database changes to return.
Discussion ¶
After creating the operation, assign a handler to the fetchDatabaseChangesCompletionBlock property so that you can process the operation’s results.
If this is your first fetch, or if you want to refetch all zones, pass `nil` for the change token. If you provide a change token from a previous CKFetchDatabaseChangesOperation, CloudKit returns only the zones with changes since that token. The per-database CKServerChangeToken isn’t the same as the per-record zone CKServerChangeToken from CKFetchRecordZoneChangesOperation.
func (CKFetchDatabaseChangesOperation) Autorelease ¶
func (c CKFetchDatabaseChangesOperation) Autorelease() CKFetchDatabaseChangesOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchDatabaseChangesOperation) ChangeTokenUpdatedBlock ¶
func (c CKFetchDatabaseChangesOperation) ChangeTokenUpdatedBlock() CKServerChangeTokenHandler
The closure to execute when the change token updates.
Discussion ¶
The closure executes periodically, and provides a new change token so that you don’t need to refetch previously fetched record zone changes in a subsequent operation.
func (CKFetchDatabaseChangesOperation) FetchAllChanges ¶
func (c CKFetchDatabaseChangesOperation) FetchAllChanges() bool
A Boolean value that indicates whether to send repeated requests to the server.
Discussion ¶
If true, the operation sends repeat requests to the server until it fetches all changes. CloudKit executes the handler you set on the CKFetchDatabaseChangesOperation.ChangeTokenUpdatedBlock property with a change token after each request.
The default value is true.
See: https://developer.apple.com/documentation/CloudKit/CKFetchDatabaseChangesOperation/fetchAllChanges
func (CKFetchDatabaseChangesOperation) Init ¶
func (c CKFetchDatabaseChangesOperation) Init() CKFetchDatabaseChangesOperation
Init initializes the instance.
func (CKFetchDatabaseChangesOperation) InitWithPreviousServerChangeToken ¶
func (c CKFetchDatabaseChangesOperation) InitWithPreviousServerChangeToken(previousServerChangeToken ICKServerChangeToken) CKFetchDatabaseChangesOperation
Creates an operation for fetching database changes.
previousServerChangeToken: The change token that CloudKit uses to determine which database changes to return.
Discussion ¶
After creating the operation, assign a handler to the fetchDatabaseChangesCompletionBlock property so that you can process the operation’s results.
If this is your first fetch, or if you want to refetch all zones, pass `nil` for the change token. If you provide a change token from a previous CKFetchDatabaseChangesOperation, CloudKit returns only the zones with changes since that token. The per-database CKServerChangeToken isn’t the same as the per-record zone CKServerChangeToken from CKFetchRecordZoneChangesOperation.
func (CKFetchDatabaseChangesOperation) PreviousServerChangeToken ¶
func (c CKFetchDatabaseChangesOperation) PreviousServerChangeToken() ICKServerChangeToken
The server change token.
Discussion ¶
Assign the token you receive from the fetchDatabaseChangesCompletionBlock to this property. Doing so yields only the changes that occur after your most recent fetch operation. If you specify `nil` for this parameter, the operation fetches all changes.
func (CKFetchDatabaseChangesOperation) RecordZoneWithIDChangedBlock ¶
func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDChangedBlock() CKRecordZoneIDHandler
The closure to execute with a single record zone change.
Discussion ¶
The closure returns no value and takes the following parameter:
`zoneID`: The ID of the record zone that contains changes.
func (CKFetchDatabaseChangesOperation) RecordZoneWithIDWasDeletedBlock ¶
func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDWasDeletedBlock() CKRecordZoneIDHandler
The closure to execute when a record zone no longer exists.
Discussion ¶
The closure returns no value and takes the following parameter:
`zoneID`: The deleted record zone’s ID.
func (CKFetchDatabaseChangesOperation) RecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock ¶
func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock() CKRecordZoneIDHandler
The closure to execute when a user-invoked account reset deletes a record zone.
Discussion ¶
The closure returns no value and takes a single parameter: the deleted record zone’s ID.
The operation executes this closure, instead of CKFetchDatabaseChangesOperation.RecordZoneWithIDWasDeletedBlock, after a user action causes CloudKit to delete the record zone. Reupload any locally cached data to iCloud to minimize data loss.
func (CKFetchDatabaseChangesOperation) RecordZoneWithIDWasPurgedBlock ¶
func (c CKFetchDatabaseChangesOperation) RecordZoneWithIDWasPurgedBlock() CKRecordZoneIDHandler
The closure to execute when CloudKit purges a record zone.
Discussion ¶
The closure returns no value and takes the following parameter:
`zoneID`: The purged record zone’s ID.
func (CKFetchDatabaseChangesOperation) ResultsLimit ¶
func (c CKFetchDatabaseChangesOperation) ResultsLimit() uint
The maximum number of results that the operation fetches.
Discussion ¶
Use this property to limit the number of changes this operation returns. When the operation reaches the limit, it updates the change token and returns it to indicate that more results are available.
See: https://developer.apple.com/documentation/CloudKit/CKFetchDatabaseChangesOperation/resultsLimit
func (CKFetchDatabaseChangesOperation) SetChangeTokenUpdatedBlock ¶
func (c CKFetchDatabaseChangesOperation) SetChangeTokenUpdatedBlock(value CKServerChangeTokenHandler)
func (CKFetchDatabaseChangesOperation) SetFetchAllChanges ¶
func (c CKFetchDatabaseChangesOperation) SetFetchAllChanges(value bool)
func (CKFetchDatabaseChangesOperation) SetPreviousServerChangeToken ¶
func (c CKFetchDatabaseChangesOperation) SetPreviousServerChangeToken(value ICKServerChangeToken)
func (CKFetchDatabaseChangesOperation) SetRecordZoneWithIDChangedBlock ¶
func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDChangedBlock(value CKRecordZoneIDHandler)
func (CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasDeletedBlock ¶
func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasDeletedBlock(value CKRecordZoneIDHandler)
func (CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock ¶
func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock(value CKRecordZoneIDHandler)
func (CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasPurgedBlock ¶
func (c CKFetchDatabaseChangesOperation) SetRecordZoneWithIDWasPurgedBlock(value CKRecordZoneIDHandler)
func (CKFetchDatabaseChangesOperation) SetResultsLimit ¶
func (c CKFetchDatabaseChangesOperation) SetResultsLimit(value uint)
type CKFetchDatabaseChangesOperationClass ¶
type CKFetchDatabaseChangesOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchDatabaseChangesOperationClass ¶
func GetCKFetchDatabaseChangesOperationClass() CKFetchDatabaseChangesOperationClass
GetCKFetchDatabaseChangesOperationClass returns the class object for CKFetchDatabaseChangesOperation.
func (CKFetchDatabaseChangesOperationClass) Alloc ¶
func (cc CKFetchDatabaseChangesOperationClass) Alloc() CKFetchDatabaseChangesOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchDatabaseChangesOperationClass) Class ¶
func (cc CKFetchDatabaseChangesOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKFetchRecordZoneChangesConfiguration ¶
type CKFetchRecordZoneChangesConfiguration struct {
objectivec.Object
}
A configuration object that describes the information to fetch from a record zone.
Accessing a Zone Change Configuration ¶
- CKFetchRecordZoneChangesConfiguration.PreviousServerChangeToken: The server change token.
- CKFetchRecordZoneChangesConfiguration.SetPreviousServerChangeToken
- CKFetchRecordZoneChangesConfiguration.ResultsLimit: The maximum number of records that CloudKit retrieves when fetching zone changes.
- CKFetchRecordZoneChangesConfiguration.SetResultsLimit
func CKFetchRecordZoneChangesConfigurationFromID ¶
func CKFetchRecordZoneChangesConfigurationFromID(id objc.ID) CKFetchRecordZoneChangesConfiguration
CKFetchRecordZoneChangesConfigurationFromID constructs a CKFetchRecordZoneChangesConfiguration from an objc.ID.
A configuration object that describes the information to fetch from a record zone.
func NewCKFetchRecordZoneChangesConfiguration ¶
func NewCKFetchRecordZoneChangesConfiguration() CKFetchRecordZoneChangesConfiguration
NewCKFetchRecordZoneChangesConfiguration creates a new CKFetchRecordZoneChangesConfiguration instance.
func (CKFetchRecordZoneChangesConfiguration) Autorelease ¶
func (c CKFetchRecordZoneChangesConfiguration) Autorelease() CKFetchRecordZoneChangesConfiguration
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchRecordZoneChangesConfiguration) EncodeWithCoder ¶
func (c CKFetchRecordZoneChangesConfiguration) EncodeWithCoder(coder foundation.INSCoder)
func (CKFetchRecordZoneChangesConfiguration) PreviousServerChangeToken ¶
func (c CKFetchRecordZoneChangesConfiguration) PreviousServerChangeToken() ICKServerChangeToken
The server change token.
func (CKFetchRecordZoneChangesConfiguration) ResultsLimit ¶
func (c CKFetchRecordZoneChangesConfiguration) ResultsLimit() uint
The maximum number of records that CloudKit retrieves when fetching zone changes.
func (CKFetchRecordZoneChangesConfiguration) SetPreviousServerChangeToken ¶
func (c CKFetchRecordZoneChangesConfiguration) SetPreviousServerChangeToken(value ICKServerChangeToken)
func (CKFetchRecordZoneChangesConfiguration) SetResultsLimit ¶
func (c CKFetchRecordZoneChangesConfiguration) SetResultsLimit(value uint)
type CKFetchRecordZoneChangesConfigurationClass ¶
type CKFetchRecordZoneChangesConfigurationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchRecordZoneChangesConfigurationClass ¶
func GetCKFetchRecordZoneChangesConfigurationClass() CKFetchRecordZoneChangesConfigurationClass
GetCKFetchRecordZoneChangesConfigurationClass returns the class object for CKFetchRecordZoneChangesConfiguration.
func (CKFetchRecordZoneChangesConfigurationClass) Alloc ¶
Alloc allocates memory for a new instance of the class.
func (CKFetchRecordZoneChangesConfigurationClass) Class ¶
func (cc CKFetchRecordZoneChangesConfigurationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKFetchRecordZoneChangesOperation ¶
type CKFetchRecordZoneChangesOperation struct {
CKDatabaseOperation
}
An operation that fetches record zone changes.
Overview ¶
Use this operation to fetch record changes in one or more record zones, such as those that occur during record creation, modification, and deletion. You provide a configuration object for each record zone to query for changes. The configuration contains a server change token, which is an opaque pointer to a specific change in the zone’s history. CloudKit returns only the changes that occur after that point. For the first time you fetch a record zone’s changes, or to refetch all changes in a zone’s history, use `nil` instead.
CloudKit processes the record zones in succession, and returns the changes for each zone in batches. Each batch yields a new change token. If all batches return without error, the operation issues a final change token for that zone. The change tokens conform to NSSecureCoding and are safe to cache on-disk. This operation’s tokens aren’t compatible with CKFetchDatabaseChangesOperation so you should segregate them in your app’s cache. Don’t infer behavior or order from the tokens’ contents.
If you create record zones in the private database, fetch all changes the first time the app launches. Cache the results on-device and use CKRecordZoneSubscription to subscribe to future changes. Fetch those changes on receipt of the push notifications the subscription generates. If you use the shared database, subscribe to changes with CKDatabaseSubscription instead. When a user participates in sharing, CloudKit adds and removes record zones. This means you don’t know in advance which zones exist in the shared database. Use CKFetchDatabaseChangesOperation to fetch shared record zones on receipt of the subscription’s push notifications. Then fetch the changes in those zones using this operation. Regardless of which database you use, it’s not necessary to perform fetches each time your app launches, or to schedule fetches at regular intervals.
To run the operation, add it to the corresponding database’s operation queue. The operation executes its callbacks on a private serial queue.
The following example demonstrates how to create the operation, configure its callbacks, and execute it. For brevity, it omits the delete and operation completion callbacks.
Configuring the Zone Change Operation ¶
- CKFetchRecordZoneChangesOperation.ConfigurationsByRecordZoneID: A dictionary of configurations for fetching change operations by zone identifier.
- CKFetchRecordZoneChangesOperation.SetConfigurationsByRecordZoneID
- CKFetchRecordZoneChangesOperation.FetchAllChanges: A Boolean value that indicates whether to send repeated requests to the server.
- CKFetchRecordZoneChangesOperation.SetFetchAllChanges
- CKFetchRecordZoneChangesOperation.RecordZoneIDs: The IDs of the record zones that contain the records to fetch.
- CKFetchRecordZoneChangesOperation.SetRecordZoneIDs
Processing the Zone Change Operation Results ¶
- CKFetchRecordZoneChangesOperation.RecordWithIDWasDeletedBlock: The closure to execute when a record no longer exists.
- CKFetchRecordZoneChangesOperation.SetRecordWithIDWasDeletedBlock
- CKFetchRecordZoneChangesOperation.RecordZoneChangeTokensUpdatedBlock: The closure to execute when the change token updates.
- CKFetchRecordZoneChangesOperation.SetRecordZoneChangeTokensUpdatedBlock
Instance Properties ¶
- CKFetchRecordZoneChangesOperation.RecordWasChangedBlock: The closure to execute with the results of retrieving a record change.
- CKFetchRecordZoneChangesOperation.SetRecordWasChangedBlock
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZoneChangesOperation
func CKFetchRecordZoneChangesOperationFromID ¶
func CKFetchRecordZoneChangesOperationFromID(id objc.ID) CKFetchRecordZoneChangesOperation
CKFetchRecordZoneChangesOperationFromID constructs a CKFetchRecordZoneChangesOperation from an objc.ID.
An operation that fetches record zone changes.
func NewCKFetchRecordZoneChangesOperation ¶
func NewCKFetchRecordZoneChangesOperation() CKFetchRecordZoneChangesOperation
NewCKFetchRecordZoneChangesOperation creates a new CKFetchRecordZoneChangesOperation instance.
func (CKFetchRecordZoneChangesOperation) Autorelease ¶
func (c CKFetchRecordZoneChangesOperation) Autorelease() CKFetchRecordZoneChangesOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchRecordZoneChangesOperation) ConfigurationsByRecordZoneID ¶
func (c CKFetchRecordZoneChangesOperation) ConfigurationsByRecordZoneID() foundation.INSDictionary
A dictionary of configurations for fetching change operations by zone identifier.
func (CKFetchRecordZoneChangesOperation) FetchAllChanges ¶
func (c CKFetchRecordZoneChangesOperation) FetchAllChanges() bool
A Boolean value that indicates whether to send repeated requests to the server.
Discussion ¶
If true, the operation sends repeat requests to the server until it fetches all changes. CloudKit executes the handler you set on the recordZoneFetchCompletionBlock property with a change token after each request.
The default value is true.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZoneChangesOperation/fetchAllChanges
func (CKFetchRecordZoneChangesOperation) Init ¶
func (c CKFetchRecordZoneChangesOperation) Init() CKFetchRecordZoneChangesOperation
Init initializes the instance.
func (CKFetchRecordZoneChangesOperation) OptionsByRecordZoneID ¶
func (c CKFetchRecordZoneChangesOperation) OptionsByRecordZoneID() unsafe.Pointer
Configuration options for each record zone that the operation retrieves.
func (CKFetchRecordZoneChangesOperation) RecordWasChangedBlock ¶
func (c CKFetchRecordZoneChangesOperation) RecordWasChangedBlock() unsafe.Pointer
The closure to execute with the results of retrieving a record change.
func (CKFetchRecordZoneChangesOperation) RecordWithIDWasDeletedBlock ¶
func (c CKFetchRecordZoneChangesOperation) RecordWithIDWasDeletedBlock() unsafe.Pointer
The closure to execute when a record no longer exists.
func (CKFetchRecordZoneChangesOperation) RecordZoneChangeTokensUpdatedBlock ¶
func (c CKFetchRecordZoneChangesOperation) RecordZoneChangeTokensUpdatedBlock() CKRecordZoneIDCKServerChangeTokenDataHandler
The closure to execute when the change token updates.
Discussion ¶
The closure returns no value and takes the following parameters:
- The record zone’s ID. - The new change token from the server. You can store this token locally and use it during subsequent fetch operations to limit the results to records that change after this operation executes. - The most recent client change token from the device. If the change token isn’t the most recent change token you provided, the server might not have received the associated changes.
The operation executes this closure once for each record zone. Each time the closure executes, it executes serially with respect to the other blocks of the operation.
Set this property before you execute the operation or submit it to a queue.
func (CKFetchRecordZoneChangesOperation) RecordZoneIDs ¶
func (c CKFetchRecordZoneChangesOperation) RecordZoneIDs() []CKRecordZoneID
The IDs of the record zones that contain the records to fetch.
Discussion ¶
Typically, you set the value of this property when you create the operation. If you intend to change the record zone IDs, update the value before you execute the operation or submit it to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZoneChangesOperation/recordZoneIDs
func (CKFetchRecordZoneChangesOperation) SetConfigurationsByRecordZoneID ¶
func (c CKFetchRecordZoneChangesOperation) SetConfigurationsByRecordZoneID(value foundation.INSDictionary)
func (CKFetchRecordZoneChangesOperation) SetFetchAllChanges ¶
func (c CKFetchRecordZoneChangesOperation) SetFetchAllChanges(value bool)
func (CKFetchRecordZoneChangesOperation) SetOptionsByRecordZoneID ¶
func (c CKFetchRecordZoneChangesOperation) SetOptionsByRecordZoneID(value kernel.Pointer)
func (CKFetchRecordZoneChangesOperation) SetRecordWasChangedBlock ¶
func (c CKFetchRecordZoneChangesOperation) SetRecordWasChangedBlock(value kernel.Pointer)
func (CKFetchRecordZoneChangesOperation) SetRecordWithIDWasDeletedBlock ¶
func (c CKFetchRecordZoneChangesOperation) SetRecordWithIDWasDeletedBlock(value kernel.Pointer)
func (CKFetchRecordZoneChangesOperation) SetRecordZoneChangeTokensUpdatedBlock ¶
func (c CKFetchRecordZoneChangesOperation) SetRecordZoneChangeTokensUpdatedBlock(value CKRecordZoneIDCKServerChangeTokenDataHandler)
func (CKFetchRecordZoneChangesOperation) SetRecordZoneIDs ¶
func (c CKFetchRecordZoneChangesOperation) SetRecordZoneIDs(value []CKRecordZoneID)
type CKFetchRecordZoneChangesOperationClass ¶
type CKFetchRecordZoneChangesOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchRecordZoneChangesOperationClass ¶
func GetCKFetchRecordZoneChangesOperationClass() CKFetchRecordZoneChangesOperationClass
GetCKFetchRecordZoneChangesOperationClass returns the class object for CKFetchRecordZoneChangesOperation.
func (CKFetchRecordZoneChangesOperationClass) Alloc ¶
func (cc CKFetchRecordZoneChangesOperationClass) Alloc() CKFetchRecordZoneChangesOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchRecordZoneChangesOperationClass) Class ¶
func (cc CKFetchRecordZoneChangesOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKFetchRecordZonesOperation ¶
type CKFetchRecordZonesOperation struct {
CKDatabaseOperation
}
An operation for retrieving record zones from a database.
Overview ¶
Use this operation object to fetch record zones so that you can ascertain their capabilities.
If you assign a handler to the completionBlock property of the operation, CloudKit calls it after the operation executes and returns its results. You can use the handler to perform any housekeeping tasks that relate to the operation, but don’t use it to process the results of the operation. The handler you specify should manage any failures, whether due to an error or an explicit cancellation.
Initializing the Zone Fetch Operation ¶
- CKFetchRecordZonesOperation.InitWithRecordZoneIDs: Creates an operation for fetching the specified record zones.
Configuring a Zone Fetch Operation ¶
- CKFetchRecordZonesOperation.RecordZoneIDs: The IDs of the record zones to retrieve.
- CKFetchRecordZonesOperation.SetRecordZoneIDs
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZonesOperation
func CKFetchRecordZonesOperationFromID ¶
func CKFetchRecordZonesOperationFromID(id objc.ID) CKFetchRecordZonesOperation
CKFetchRecordZonesOperationFromID constructs a CKFetchRecordZonesOperation from an objc.ID.
An operation for retrieving record zones from a database.
func NewCKFetchRecordZonesOperation ¶
func NewCKFetchRecordZonesOperation() CKFetchRecordZonesOperation
NewCKFetchRecordZonesOperation creates a new CKFetchRecordZonesOperation instance.
func NewCKFetchRecordZonesOperationWithRecordZoneIDs ¶
func NewCKFetchRecordZonesOperationWithRecordZoneIDs(zoneIDs []CKRecordZoneID) CKFetchRecordZonesOperation
Creates an operation for fetching the specified record zones.
zoneIDs: An array of[CKRecordZoneID] objects that represents the zones you want to retrieve. If you provide an empty array, you must set the CKFetchRecordZonesOperation.RecordZoneIDs property before you execute the operation.
Discussion ¶
After creating the operation, assign a value to the fetchRecordZonesCompletionBlock property so you can process the results.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZonesOperation/init(recordZoneIDs:)
func (CKFetchRecordZonesOperation) Autorelease ¶
func (c CKFetchRecordZonesOperation) Autorelease() CKFetchRecordZonesOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchRecordZonesOperation) Init ¶
func (c CKFetchRecordZonesOperation) Init() CKFetchRecordZonesOperation
Init initializes the instance.
func (CKFetchRecordZonesOperation) InitWithRecordZoneIDs ¶
func (c CKFetchRecordZonesOperation) InitWithRecordZoneIDs(zoneIDs []CKRecordZoneID) CKFetchRecordZonesOperation
Creates an operation for fetching the specified record zones.
zoneIDs: An array of[CKRecordZoneID] objects that represents the zones you want to retrieve. If you provide an empty array, you must set the CKFetchRecordZonesOperation.RecordZoneIDs property before you execute the operation.
Discussion ¶
After creating the operation, assign a value to the fetchRecordZonesCompletionBlock property so you can process the results.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZonesOperation/init(recordZoneIDs:)
func (CKFetchRecordZonesOperation) RecordZoneIDs ¶
func (c CKFetchRecordZonesOperation) RecordZoneIDs() []CKRecordZoneID
The IDs of the record zones to retrieve.
Discussion ¶
Use this property to view or change the IDs of the record zones you want to retrieve. If you intend to change the value of this property, do so before you execute the operation or submit the operation to a queue.
If you use the operation that CKFetchRecordZonesOperationClass.FetchAllRecordZonesOperation returns, CloudKit ignores the contents of this property and sets its value to `nil`.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZonesOperation/recordZoneIDs
func (CKFetchRecordZonesOperation) SetRecordZoneIDs ¶
func (c CKFetchRecordZonesOperation) SetRecordZoneIDs(value []CKRecordZoneID)
type CKFetchRecordZonesOperationClass ¶
type CKFetchRecordZonesOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchRecordZonesOperationClass ¶
func GetCKFetchRecordZonesOperationClass() CKFetchRecordZonesOperationClass
GetCKFetchRecordZonesOperationClass returns the class object for CKFetchRecordZonesOperation.
func (CKFetchRecordZonesOperationClass) Alloc ¶
func (cc CKFetchRecordZonesOperationClass) Alloc() CKFetchRecordZonesOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchRecordZonesOperationClass) Class ¶
func (cc CKFetchRecordZonesOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKFetchRecordZonesOperationClass) FetchAllRecordZonesOperation ¶
func (_CKFetchRecordZonesOperationClass CKFetchRecordZonesOperationClass) FetchAllRecordZonesOperation() CKFetchRecordZonesOperation
Returns an operation for fetching all record zones in the current database.
Discussion ¶
Assign a value to the fetchRecordZonesCompletionBlock property of the operation that this method returns so that you can process the results.
type CKFetchRecordsOperation ¶
type CKFetchRecordsOperation struct {
CKDatabaseOperation
}
An operation for retrieving records from a database.
Overview ¶
Use this operation to retrieve the entire contents of each record or only a subset of its contained values. As records become available, the operation object reports progress about the state of the operation to several different blocks, which you can use to process the results.
Fetching records is a common use of CloudKit, even if your app doesn’t cache record IDs locally. For example, when you fetch a record related to the current record through a CKReference object, you use the ID in the reference to perform the fetch.
The handlers you assign to process the fetched records execute serially on an internal queue that the fetch operation manages. You must provide handlers capable of executing on a background thread, so any tasks that require access to the main thread must redirect accordingly.
In addition to data records, a fetch records operation can fetch the current user record. The CKFetchRecordsOperationClass.FetchCurrentUserRecordOperation method returns a specially configured operation object that retrieves the current user record. That record is a standard CKRecord object that has no content initially. You can add data to the user record and save it as necessary. Don’t store sensitive personal information, such as passwords, in the user record because other users of your app can access the discoverable user record in a public database. If you must store sensitive information about a user, do so in a separate record that is accessible only to that user.
If you assign a closure to the completionBlock property of the operation object, CloudKit calls it after the operation executes and returns its results. Use a closure to perform any housekeeping tasks for the operation, but don’t use it to process the results of the operation. The closure you specify should handle the failure of the operation to complete its task, whether due to an error or an explicit cancellation.
Creating a Record Fetch Operation ¶
- CKFetchRecordsOperation.InitWithRecordIDs: Creates a fetch operation for retrieving the records with the specified IDs.
Configuring a Record Fetch Operation ¶
- CKFetchRecordsOperation.RecordIDs: The record IDs of the records to fetch.
- CKFetchRecordsOperation.SetRecordIDs
- CKFetchRecordsOperation.DesiredKeys: The fields of the records to fetch.
- CKFetchRecordsOperation.SetDesiredKeys
Processing Record Fetch Results ¶
- CKFetchRecordsOperation.PerRecordProgressBlock: The closure to execute with progress information for individual records.
- CKFetchRecordsOperation.SetPerRecordProgressBlock
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordsOperation
func CKFetchRecordsOperationFromID ¶
func CKFetchRecordsOperationFromID(id objc.ID) CKFetchRecordsOperation
CKFetchRecordsOperationFromID constructs a CKFetchRecordsOperation from an objc.ID.
An operation for retrieving records from a database.
func NewCKFetchRecordsOperation ¶
func NewCKFetchRecordsOperation() CKFetchRecordsOperation
NewCKFetchRecordsOperation creates a new CKFetchRecordsOperation instance.
func NewCKFetchRecordsOperationWithRecordIDs ¶
func NewCKFetchRecordsOperationWithRecordIDs(recordIDs []CKRecordID) CKFetchRecordsOperation
Creates a fetch operation for retrieving the records with the specified IDs.
recordIDs: An array of CKRecordID objects that represents the records you want to retrieve. If you provide an empty array, you must set the CKFetchRecordsOperation.RecordIDs property before you execute the operation.
Discussion ¶
A fetch operation retrieves all of a record’s fields, including any assets that those fields reference. If you want to minimize the amount of data that the operation returns, configure the desiredKeys property with only the keys that contain the values that you have an interest in.
After initializing the operation, you must associate at least one progress handler with the operation (excluding the completion handler) to process the results.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordsOperation/init(recordIDs:)
func (CKFetchRecordsOperation) Autorelease ¶
func (c CKFetchRecordsOperation) Autorelease() CKFetchRecordsOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchRecordsOperation) DesiredKeys ¶
func (c CKFetchRecordsOperation) DesiredKeys() unsafe.Pointer
The fields of the records to fetch.
See: https://developer.apple.com/documentation/cloudkit/ckfetchrecordsoperation/desiredkeys-31bbq
func (CKFetchRecordsOperation) Init ¶
func (c CKFetchRecordsOperation) Init() CKFetchRecordsOperation
Init initializes the instance.
func (CKFetchRecordsOperation) InitWithRecordIDs ¶
func (c CKFetchRecordsOperation) InitWithRecordIDs(recordIDs []CKRecordID) CKFetchRecordsOperation
Creates a fetch operation for retrieving the records with the specified IDs.
recordIDs: An array of CKRecordID objects that represents the records you want to retrieve. If you provide an empty array, you must set the CKFetchRecordsOperation.RecordIDs property before you execute the operation.
Discussion ¶
A fetch operation retrieves all of a record’s fields, including any assets that those fields reference. If you want to minimize the amount of data that the operation returns, configure the desiredKeys property with only the keys that contain the values that you have an interest in.
After initializing the operation, you must associate at least one progress handler with the operation (excluding the completion handler) to process the results.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordsOperation/init(recordIDs:)
func (CKFetchRecordsOperation) PerRecordProgressBlock ¶
func (c CKFetchRecordsOperation) PerRecordProgressBlock() CKRecordIDFloat64Handler
The closure to execute with progress information for individual records.
Discussion ¶
This property is a closure that returns no value and has the following parameters:
- The ID of the record to retrieve. - The amount of data, as a percentage, that CloudKit downloads for the record. The range is `0.0` to `1.0`, where `0.0` indicates that CloudKit hasn’t downloaded anything, and `1.0` means the download is complete.
The fetch operation executes this closure one or more times for each record ID in the CKFetchRecordsOperation.RecordIDs property. Each time the closure executes, it executes serially with respect to the other progress closures of the operation. You can use this closure to track the ongoing progress of the download operation.
If you intend to use this closure to process results, set it before you execute the operation or add the operation to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordsOperation/perRecordProgressBlock
func (CKFetchRecordsOperation) RecordIDs ¶
func (c CKFetchRecordsOperation) RecordIDs() []CKRecordID
The record IDs of the records to fetch.
Discussion ¶
Use this property to view or change the IDs of the records you want to retrieve. If you use the operation that CKFetchRecordsOperationClass.FetchCurrentUserRecordOperation returns, CloudKit ignores the contents of this property and sets its value to `nil`.
If you intend to specify a value other than `nil`, do so before you execute the operation or add the operation to a queue. The records you fetch don’t need to be in the same record zone. The record ID for each record provides the zone information that CloudKit needs to fetch the corresponding record.
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordsOperation/recordIDs
func (CKFetchRecordsOperation) SetDesiredKeys ¶
func (c CKFetchRecordsOperation) SetDesiredKeys(value kernel.Pointer)
func (CKFetchRecordsOperation) SetPerRecordProgressBlock ¶
func (c CKFetchRecordsOperation) SetPerRecordProgressBlock(value CKRecordIDFloat64Handler)
func (CKFetchRecordsOperation) SetRecordIDs ¶
func (c CKFetchRecordsOperation) SetRecordIDs(value []CKRecordID)
type CKFetchRecordsOperationClass ¶
type CKFetchRecordsOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchRecordsOperationClass ¶
func GetCKFetchRecordsOperationClass() CKFetchRecordsOperationClass
GetCKFetchRecordsOperationClass returns the class object for CKFetchRecordsOperation.
func (CKFetchRecordsOperationClass) Alloc ¶
func (cc CKFetchRecordsOperationClass) Alloc() CKFetchRecordsOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchRecordsOperationClass) Class ¶
func (cc CKFetchRecordsOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKFetchRecordsOperationClass) FetchCurrentUserRecordOperation ¶
func (_CKFetchRecordsOperationClass CKFetchRecordsOperationClass) FetchCurrentUserRecordOperation() CKFetchRecordsOperation
Returns a fetch operation for retrieving the current user record.
Discussion ¶
The returned operation object searches for the single record that corresponds to the current user record. You must associate at least one progress handler with the operation object (excluding the completion handler) to process the results.
type CKFetchShareMetadataOperation ¶
type CKFetchShareMetadataOperation struct {
}
An operation that fetches metadata for one or more shares.
Overview ¶
Use this operation to fetch the metadata for one or more shares. A share’s metadata contains the share and details about the user’s participation. Fetch metadata when you want to manually accept participation in a share using CKAcceptSharesOperation.
For a shared record hierarchy, the fetched metadata includes the record ID of the share’s root record. Set CKFetchShareMetadataOperation.ShouldFetchRootRecord to true to fetch the entire root record. You can further customize this behavior using CKFetchShareMetadataOperation.RootRecordDesiredKeys to specify which fields you want to include in your fetch. This functionality isn’t applicable for a shared record zone because, unlike a shared record hierarchy, it doesn’t have a nominated root record.
To run the operation, add it to any container’s operation queue. Returned metadata includes the ID of the container that stores the share. The operation executes its callbacks on a private serial queue.
The operation calls perShareMetadataBlock once for each URL you provide, and CloudKit returns the metadata, or an error if the fetch fails. CloudKit also batches per-URL errors. If the operation completes with errors, it returns a partialFailure error. The error stores individual errors in its userInfo dictionary. Use the CKPartialErrorsByItemIDKey key to extract them.
When all of the following conditions are true, CloudKit returns a participantMayNeedVerification error:
- There are pending participants that don’t have matched iCloud accounts. - The current user has an active iCloud account and isn’t an existing participant (pending or otherwise).
On receipt of this error, call open(_:options:completionHandler:) with the share’s URL to allow CloudKit to verify the user.
The following example demonstrates how to create the operation, configure it, and then execute it using the default container’s operation queue:
Creating an Operation ¶
- CKFetchShareMetadataOperation.InitWithShareURLs: Creates an operation for fetching the metadata for the specified shares.
Configuring the Operation ¶
- CKFetchShareMetadataOperation.ShareURLs: The URLs of the shares to fetch.
- CKFetchShareMetadataOperation.SetShareURLs
- CKFetchShareMetadataOperation.ShouldFetchRootRecord: A Boolean value that indicates whether to retrieve the root record.
- CKFetchShareMetadataOperation.SetShouldFetchRootRecord
Instance Properties ¶
- CKFetchShareMetadataOperation.RootRecordDesiredKeys: The fields to return when fetching the root record.
- CKFetchShareMetadataOperation.SetRootRecordDesiredKeys
See: https://developer.apple.com/documentation/CloudKit/CKFetchShareMetadataOperation
func CKFetchShareMetadataOperationFromID ¶
func CKFetchShareMetadataOperationFromID(id objc.ID) CKFetchShareMetadataOperation
CKFetchShareMetadataOperationFromID constructs a CKFetchShareMetadataOperation from an objc.ID.
An operation that fetches metadata for one or more shares.
func NewCKFetchShareMetadataOperation ¶
func NewCKFetchShareMetadataOperation() CKFetchShareMetadataOperation
NewCKFetchShareMetadataOperation creates a new CKFetchShareMetadataOperation instance.
func NewCKFetchShareMetadataOperationWithShareURLs ¶
func NewCKFetchShareMetadataOperationWithShareURLs(shareURLs []foundation.NSURL) CKFetchShareMetadataOperation
Creates an operation for fetching the metadata for the specified shares.
shareURLs: The URLs of the shares. If you specify `nil`, you must assign a value to the CKFetchShareMetadataOperation.ShareURLs property before you execute the operation.
Discussion ¶
After creating the operation, assign a handler to the fetchShareMetadataCompletionBlock property to process the results.
See: https://developer.apple.com/documentation/CloudKit/CKFetchShareMetadataOperation/init(shareURLs:)
func (CKFetchShareMetadataOperation) Autorelease ¶
func (c CKFetchShareMetadataOperation) Autorelease() CKFetchShareMetadataOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchShareMetadataOperation) Init ¶
func (c CKFetchShareMetadataOperation) Init() CKFetchShareMetadataOperation
Init initializes the instance.
func (CKFetchShareMetadataOperation) InitWithShareURLs ¶
func (c CKFetchShareMetadataOperation) InitWithShareURLs(shareURLs []foundation.NSURL) CKFetchShareMetadataOperation
Creates an operation for fetching the metadata for the specified shares.
shareURLs: The URLs of the shares. If you specify `nil`, you must assign a value to the CKFetchShareMetadataOperation.ShareURLs property before you execute the operation.
Discussion ¶
After creating the operation, assign a handler to the fetchShareMetadataCompletionBlock property to process the results.
See: https://developer.apple.com/documentation/CloudKit/CKFetchShareMetadataOperation/init(shareURLs:)
func (CKFetchShareMetadataOperation) RootRecordDesiredKeys ¶
func (c CKFetchShareMetadataOperation) RootRecordDesiredKeys() unsafe.Pointer
The fields to return when fetching the root record.
func (CKFetchShareMetadataOperation) SetRootRecordDesiredKeys ¶
func (c CKFetchShareMetadataOperation) SetRootRecordDesiredKeys(value kernel.Pointer)
func (CKFetchShareMetadataOperation) SetShareURLs ¶
func (c CKFetchShareMetadataOperation) SetShareURLs(value []foundation.NSURL)
func (CKFetchShareMetadataOperation) SetShouldFetchRootRecord ¶
func (c CKFetchShareMetadataOperation) SetShouldFetchRootRecord(value bool)
func (CKFetchShareMetadataOperation) ShareURLs ¶
func (c CKFetchShareMetadataOperation) ShareURLs() []foundation.NSURL
The URLs of the shares to fetch.
Discussion ¶
Use this property to view or change the URLs of the shares to fetch. If you intend to specify or change this property’s value, do so before you execute the operation or submit it to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKFetchShareMetadataOperation/shareURLs
func (CKFetchShareMetadataOperation) ShouldFetchRootRecord ¶
func (c CKFetchShareMetadataOperation) ShouldFetchRootRecord() bool
A Boolean value that indicates whether to retrieve the root record.
Discussion ¶
For a shared record hierarchy, set this property to true to include the root record in the fetched share metadata. CloudKit ignores this property for a shared record zone because, unlike a shared record hierarchy, it doesn’t have a nominated root record.
The default value is false.
type CKFetchShareMetadataOperationClass ¶
type CKFetchShareMetadataOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchShareMetadataOperationClass ¶
func GetCKFetchShareMetadataOperationClass() CKFetchShareMetadataOperationClass
GetCKFetchShareMetadataOperationClass returns the class object for CKFetchShareMetadataOperation.
func (CKFetchShareMetadataOperationClass) Alloc ¶
func (cc CKFetchShareMetadataOperationClass) Alloc() CKFetchShareMetadataOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchShareMetadataOperationClass) Class ¶
func (cc CKFetchShareMetadataOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKFetchShareParticipantsOperation ¶
type CKFetchShareParticipantsOperation struct {
}
An operation that converts user identities into share participants.
Overview ¶
Participants are a fundamental part of sharing in CloudKit. A participant provides information about a user and their participation in a share, which includes their identity, acceptance status, role, and permissions. The acceptance status manages the user’s visibilty of the shared records. The role and permissions control what actions the user can perform on those records.
You don’t create participants. Instead, create an instance of CKUserIdentityLookupInfo for each user. Provide the user’s email address or phone number, and then use this operation to convert them into participants that you can add to a share. CloudKit limits the number of participants in a share to 100, and each participant must have an active iCloud account.
CloudKit queries iCloud for corresponding accounts as part of the operation. If it doesn’t find an account, the server updates the participant’s CKShareParticipant.UserIdentity to reflect that by setting the CKUserIdentity.HasiCloudAccount property to false. CloudKit associates a participant with their iCloud account when they accept the share.
Anyone with the URL of a public share can become a participant in that share. For a private share, the owner manages its participants. A participant can’t accept a private share unless the owner adds them first.
To run the operation, add it to the container’s operation queue. The operation executes its callbacks on a private serial queue.
The following example demonstrates how to create the operation, configure it, and then execute it using the default container’s operation queue:
The operation calls shareParticipantFetchedBlock once for each item you provide, and CloudKit returns the participant, or an error if it can’t generate a particpant. CloudKit also batches per-participant errors. If the operation completes with errors, it returns a partialFailure error. The error stores the individual errors in its userInfo dictionary. Use the CKPartialErrorsByItemIDKey key to extract them.
Creating an Operation ¶
- CKFetchShareParticipantsOperation.InitWithUserIdentityLookupInfos: Creates an operation for generating share participants from the specified user data.
Configuring the Operation ¶
- CKFetchShareParticipantsOperation.UserIdentityLookupInfos: The user data for the participants.
- CKFetchShareParticipantsOperation.SetUserIdentityLookupInfos
See: https://developer.apple.com/documentation/CloudKit/CKFetchShareParticipantsOperation
func CKFetchShareParticipantsOperationFromID ¶
func CKFetchShareParticipantsOperationFromID(id objc.ID) CKFetchShareParticipantsOperation
CKFetchShareParticipantsOperationFromID constructs a CKFetchShareParticipantsOperation from an objc.ID.
An operation that converts user identities into share participants.
func NewCKFetchShareParticipantsOperation ¶
func NewCKFetchShareParticipantsOperation() CKFetchShareParticipantsOperation
NewCKFetchShareParticipantsOperation creates a new CKFetchShareParticipantsOperation instance.
func NewCKFetchShareParticipantsOperationWithUserIdentityLookupInfos ¶
func NewCKFetchShareParticipantsOperationWithUserIdentityLookupInfos(userIdentityLookupInfos []CKUserIdentityLookupInfo) CKFetchShareParticipantsOperation
Creates an operation for generating share participants from the specified user data.
userIdentityLookupInfos: The user data for the participants. If you specify `nil`, you must assign a value to the CKFetchShareParticipantsOperation.UserIdentityLookupInfos property before you execute this operation.
Discussion ¶
After you create the operation, assign a handler to the fetchShareParticipantsCompletionBlock property to process the results.
func (CKFetchShareParticipantsOperation) Autorelease ¶
func (c CKFetchShareParticipantsOperation) Autorelease() CKFetchShareParticipantsOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchShareParticipantsOperation) Init ¶
func (c CKFetchShareParticipantsOperation) Init() CKFetchShareParticipantsOperation
Init initializes the instance.
func (CKFetchShareParticipantsOperation) InitWithUserIdentityLookupInfos ¶
func (c CKFetchShareParticipantsOperation) InitWithUserIdentityLookupInfos(userIdentityLookupInfos []CKUserIdentityLookupInfo) CKFetchShareParticipantsOperation
Creates an operation for generating share participants from the specified user data.
userIdentityLookupInfos: The user data for the participants. If you specify `nil`, you must assign a value to the CKFetchShareParticipantsOperation.UserIdentityLookupInfos property before you execute this operation.
Discussion ¶
After you create the operation, assign a handler to the fetchShareParticipantsCompletionBlock property to process the results.
func (CKFetchShareParticipantsOperation) SetUserIdentityLookupInfos ¶
func (c CKFetchShareParticipantsOperation) SetUserIdentityLookupInfos(value []CKUserIdentityLookupInfo)
func (CKFetchShareParticipantsOperation) UserIdentityLookupInfos ¶
func (c CKFetchShareParticipantsOperation) UserIdentityLookupInfos() []CKUserIdentityLookupInfo
The user data for the participants.
Discussion ¶
Use this property to view or change the participants user data. If you intend to specify or change the value of this property, do so before you execute the operation or submit it to a queue.
type CKFetchShareParticipantsOperationClass ¶
type CKFetchShareParticipantsOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchShareParticipantsOperationClass ¶
func GetCKFetchShareParticipantsOperationClass() CKFetchShareParticipantsOperationClass
GetCKFetchShareParticipantsOperationClass returns the class object for CKFetchShareParticipantsOperation.
func (CKFetchShareParticipantsOperationClass) Alloc ¶
func (cc CKFetchShareParticipantsOperationClass) Alloc() CKFetchShareParticipantsOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchShareParticipantsOperationClass) Class ¶
func (cc CKFetchShareParticipantsOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKFetchSubscriptionsOperation ¶
type CKFetchSubscriptionsOperation struct {
CKDatabaseOperation
}
An operation for fetching subscriptions.
Overview ¶
A fetch subscriptions operation retrieves subscriptions (with IDs you already know) from iCloud and can fetch all subscriptions for the current user.
You might fetch subscriptions so you can examine or modify their parameters — for example, to adjust the delivery options for push notifications that the subscription generates.
If you assign a handler to the completionBlock property, the operation calls it after it executes and passes it the results. Use the handler to perform any housekeeping tasks for the operation. The handler you specify should manage any failures, whether due to an error or an explicit cancellation.
Configuring the Fetch Subscriptions Operation ¶
- CKFetchSubscriptionsOperation.SubscriptionIDs: The IDs of the subscriptions to fetch.
- CKFetchSubscriptionsOperation.SetSubscriptionIDs
Processing the Fetch Subscription Results ¶
- CKFetchSubscriptionsOperation.FetchSubscriptionCompletionBlock: The block to execute with the fetch results.
- CKFetchSubscriptionsOperation.SetFetchSubscriptionCompletionBlock
See: https://developer.apple.com/documentation/CloudKit/CKFetchSubscriptionsOperation
func CKFetchSubscriptionsOperationFromID ¶
func CKFetchSubscriptionsOperationFromID(id objc.ID) CKFetchSubscriptionsOperation
CKFetchSubscriptionsOperationFromID constructs a CKFetchSubscriptionsOperation from an objc.ID.
An operation for fetching subscriptions.
func NewCKFetchSubscriptionsOperation ¶
func NewCKFetchSubscriptionsOperation() CKFetchSubscriptionsOperation
NewCKFetchSubscriptionsOperation creates a new CKFetchSubscriptionsOperation instance.
func (CKFetchSubscriptionsOperation) Autorelease ¶
func (c CKFetchSubscriptionsOperation) Autorelease() CKFetchSubscriptionsOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchSubscriptionsOperation) FetchSubscriptionCompletionBlock ¶
func (c CKFetchSubscriptionsOperation) FetchSubscriptionCompletionBlock() objectivec.IObject
The block to execute with the fetch results.
func (CKFetchSubscriptionsOperation) Init ¶
func (c CKFetchSubscriptionsOperation) Init() CKFetchSubscriptionsOperation
Init initializes the instance.
func (CKFetchSubscriptionsOperation) SetFetchSubscriptionCompletionBlock ¶
func (c CKFetchSubscriptionsOperation) SetFetchSubscriptionCompletionBlock(value objectivec.IObject)
func (CKFetchSubscriptionsOperation) SetSubscriptionIDs ¶
func (c CKFetchSubscriptionsOperation) SetSubscriptionIDs(value kernel.Pointer)
func (CKFetchSubscriptionsOperation) SubscriptionIDs ¶
func (c CKFetchSubscriptionsOperation) SubscriptionIDs() unsafe.Pointer
The IDs of the subscriptions to fetch.
type CKFetchSubscriptionsOperationClass ¶
type CKFetchSubscriptionsOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchSubscriptionsOperationClass ¶
func GetCKFetchSubscriptionsOperationClass() CKFetchSubscriptionsOperationClass
GetCKFetchSubscriptionsOperationClass returns the class object for CKFetchSubscriptionsOperation.
func (CKFetchSubscriptionsOperationClass) Alloc ¶
func (cc CKFetchSubscriptionsOperationClass) Alloc() CKFetchSubscriptionsOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchSubscriptionsOperationClass) Class ¶
func (cc CKFetchSubscriptionsOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKFetchSubscriptionsOperationClass) FetchAllSubscriptionsOperation ¶
func (_CKFetchSubscriptionsOperationClass CKFetchSubscriptionsOperationClass) FetchAllSubscriptionsOperation() CKFetchSubscriptionsOperation
Returns an operation that fetches all of the user’s subscriptions.
Discussion ¶
After creating the operation, set the fetchSubscriptionCompletionBlock property to process the results.
type CKFetchWebAuthTokenOperation ¶
type CKFetchWebAuthTokenOperation struct {
CKDatabaseOperation
}
An operation that creates an authentication token for use with CloudKit web services.
Overview ¶
CloudKit web services provides an HTTP interface to fetch, create, update, and delete records, zones, and subscriptions. Each request you send requires an API token, which you configure in CloudKit Dashboard. You must create an API token for each container in each environment.
If you want to send a request to an endpoint that requires an authenticated user, use this operation to fetch an authentication token. Append the authentication token, along with the API token, to the endpoint’s URL. That request then acts on behalf of the current user. Authentication tokens are short-lived and expire after a single use.
For an example of using a web authentication token with a CloudKit web service, see Changing Access Controls on User Data.
This operation executes the handlers you provide on a background queue. Tasks that need access to the main queue must redirect as appropriate.
The operation calls fetchWebAuthTokenCompletionBlock after it executes to provide the fetched token. Use the completion handler to perform housekeeping tasks for the operation. It should also manage any failures, whether due to an error or an explicit cancellation.
CloudKit operations have a default QoS of QualityOfService.default. Operations with this service level are discretionary. The system schedules their execution at an optimal time according to battery level and network conditions, among other factors. Use the qualityOfService property to set a more appropriate QoS for the operation.
The following example shows how to create the operation, configure its callbacks, and execute it in the user’s private database:
Creating a Fetch Token Operation ¶
- CKFetchWebAuthTokenOperation.InitWithAPIToken: Creates a fetch operation for the specified API token.
Managing the Operation’s Configuration ¶
- CKFetchWebAuthTokenOperation.APIToken: The API token that allows access to an app’s container.
- CKFetchWebAuthTokenOperation.SetAPIToken
See: https://developer.apple.com/documentation/CloudKit/CKFetchWebAuthTokenOperation
func CKFetchWebAuthTokenOperationFromID ¶
func CKFetchWebAuthTokenOperationFromID(id objc.ID) CKFetchWebAuthTokenOperation
CKFetchWebAuthTokenOperationFromID constructs a CKFetchWebAuthTokenOperation from an objc.ID.
An operation that creates an authentication token for use with CloudKit web services.
func NewCKFetchWebAuthTokenOperation ¶
func NewCKFetchWebAuthTokenOperation() CKFetchWebAuthTokenOperation
NewCKFetchWebAuthTokenOperation creates a new CKFetchWebAuthTokenOperation instance.
func NewCKFetchWebAuthTokenOperationWithAPIToken ¶
func NewCKFetchWebAuthTokenOperationWithAPIToken(APIToken string) CKFetchWebAuthTokenOperation
Creates a fetch operation for the specified API token.
APIToken: The API token that allows access to an app’s container.
func (CKFetchWebAuthTokenOperation) APIToken ¶
func (c CKFetchWebAuthTokenOperation) APIToken() string
The API token that allows access to an app’s container.
See: https://developer.apple.com/documentation/CloudKit/CKFetchWebAuthTokenOperation/apiToken
func (CKFetchWebAuthTokenOperation) Autorelease ¶
func (c CKFetchWebAuthTokenOperation) Autorelease() CKFetchWebAuthTokenOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKFetchWebAuthTokenOperation) Init ¶
func (c CKFetchWebAuthTokenOperation) Init() CKFetchWebAuthTokenOperation
Init initializes the instance.
func (CKFetchWebAuthTokenOperation) InitWithAPIToken ¶
func (c CKFetchWebAuthTokenOperation) InitWithAPIToken(APIToken string) CKFetchWebAuthTokenOperation
Creates a fetch operation for the specified API token.
APIToken: The API token that allows access to an app’s container.
func (CKFetchWebAuthTokenOperation) SetAPIToken ¶
func (c CKFetchWebAuthTokenOperation) SetAPIToken(value string)
type CKFetchWebAuthTokenOperationClass ¶
type CKFetchWebAuthTokenOperationClass struct {
// contains filtered or unexported fields
}
func GetCKFetchWebAuthTokenOperationClass ¶
func GetCKFetchWebAuthTokenOperationClass() CKFetchWebAuthTokenOperationClass
GetCKFetchWebAuthTokenOperationClass returns the class object for CKFetchWebAuthTokenOperation.
func (CKFetchWebAuthTokenOperationClass) Alloc ¶
func (cc CKFetchWebAuthTokenOperationClass) Alloc() CKFetchWebAuthTokenOperation
Alloc allocates memory for a new instance of the class.
func (CKFetchWebAuthTokenOperationClass) Class ¶
func (cc CKFetchWebAuthTokenOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKLocationSortDescriptor ¶
type CKLocationSortDescriptor struct {
foundation.NSSortDescriptor
}
An object for sorting records that contain location data.
Overview ¶
You can add a location sort descriptor to your queries when searching for records. At creation time, you must provide the sort descriptor with a key that has a CLLocation object as its value. The sort descriptor uses the value of that key to perform the sort.
CloudKit computes distance by drawing a direct line between the two locations that follows the curvature of the Earth. Distances don’t account for altitude changes between the two locations.
Creating a Location Sort Descriptor ¶
- CKLocationSortDescriptor.InitWithKeyRelativeLocation: Creates a location sort descriptor using the specified key and relative location.
Accessing the Location Value ¶
- CKLocationSortDescriptor.RelativeLocation: The reference location for sorting records.
See: https://developer.apple.com/documentation/CloudKit/CKLocationSortDescriptor
func CKLocationSortDescriptorFromID ¶
func CKLocationSortDescriptorFromID(id objc.ID) CKLocationSortDescriptor
CKLocationSortDescriptorFromID constructs a CKLocationSortDescriptor from an objc.ID.
An object for sorting records that contain location data.
func NewCKLocationSortDescriptor ¶
func NewCKLocationSortDescriptor() CKLocationSortDescriptor
NewCKLocationSortDescriptor creates a new CKLocationSortDescriptor instance.
func NewCKLocationSortDescriptorWithCoder ¶
func NewCKLocationSortDescriptorWithCoder(aDecoder foundation.INSCoder) CKLocationSortDescriptor
Creates a location sort descriptor from a serialized instance.
aDecoder: The coder to use when deserializing the location sort descriptor.
See: https://developer.apple.com/documentation/CloudKit/CKLocationSortDescriptor/init(coder:)
func NewCKLocationSortDescriptorWithKeyRelativeLocation ¶
func NewCKLocationSortDescriptorWithKeyRelativeLocation(key string, relativeLocation unsafe.Pointer) CKLocationSortDescriptor
Creates a location sort descriptor using the specified key and relative location.
key: The name of the key with a CLLocation object as its value. The key must belong to the records you’re sorting. The sort descriptor uses this key to retrieve the corresponding value from the record.
relativeLocation: The reference location when sorting. CloudKit sorts records according to their distance from this location.
Discussion ¶
During sorting, the sort descriptor computes the distance between the value in the `relativeLocation` parameter and the location value in the specified key of each record. It then sorts the records in ascending order using the distance between the two points. You can’t change the sort order.
func (CKLocationSortDescriptor) Autorelease ¶
func (c CKLocationSortDescriptor) Autorelease() CKLocationSortDescriptor
Autorelease adds the receiver to the current autorelease pool.
func (CKLocationSortDescriptor) Init ¶
func (c CKLocationSortDescriptor) Init() CKLocationSortDescriptor
Init initializes the instance.
func (CKLocationSortDescriptor) InitWithKeyRelativeLocation ¶
func (c CKLocationSortDescriptor) InitWithKeyRelativeLocation(key string, relativeLocation unsafe.Pointer) CKLocationSortDescriptor
Creates a location sort descriptor using the specified key and relative location.
key: The name of the key with a CLLocation object as its value. The key must belong to the records you’re sorting. The sort descriptor uses this key to retrieve the corresponding value from the record.
relativeLocation: The reference location when sorting. CloudKit sorts records according to their distance from this location.
Discussion ¶
During sorting, the sort descriptor computes the distance between the value in the `relativeLocation` parameter and the location value in the specified key of each record. It then sorts the records in ascending order using the distance between the two points. You can’t change the sort order.
func (CKLocationSortDescriptor) RelativeLocation ¶
func (c CKLocationSortDescriptor) RelativeLocation() unsafe.Pointer
The reference location for sorting records.
See: https://developer.apple.com/documentation/CloudKit/CKLocationSortDescriptor/relativeLocation
type CKLocationSortDescriptorClass ¶
type CKLocationSortDescriptorClass struct {
// contains filtered or unexported fields
}
func GetCKLocationSortDescriptorClass ¶
func GetCKLocationSortDescriptorClass() CKLocationSortDescriptorClass
GetCKLocationSortDescriptorClass returns the class object for CKLocationSortDescriptor.
func (CKLocationSortDescriptorClass) Alloc ¶
func (cc CKLocationSortDescriptorClass) Alloc() CKLocationSortDescriptor
Alloc allocates memory for a new instance of the class.
func (CKLocationSortDescriptorClass) Class ¶
func (cc CKLocationSortDescriptorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKModifyRecordZonesOperation ¶
type CKModifyRecordZonesOperation struct {
CKDatabaseOperation
}
An operation that modifies one or more record zones.
Overview ¶
After you create one or more record zones, use this operation to save those zones to the database. You can also use the operation to delete record zones and their records.
If you assign a handler to the completionBlock property of the operation, CloudKit calls the handler after the operation executes and returns its results. Use the handler to perform housekeeping tasks for the operation, but don’t use it to process the results of the operation. The handler you provide should manage any failures of the operation, whether due to an error or an explicit cancellation.
Configuring the Modify Zones Operation ¶
- CKModifyRecordZonesOperation.RecordZonesToSave: The record zones to save to the database.
- CKModifyRecordZonesOperation.SetRecordZonesToSave
- CKModifyRecordZonesOperation.RecordZoneIDsToDelete: The IDs of the record zones to delete permanently from the database.
- CKModifyRecordZonesOperation.SetRecordZoneIDsToDelete
Instance Properties ¶
- CKModifyRecordZonesOperation.PerRecordZoneDeleteBlock: The closure to execute when CloudKit deletes a record zone.
- CKModifyRecordZonesOperation.SetPerRecordZoneDeleteBlock
- CKModifyRecordZonesOperation.PerRecordZoneSaveBlock: The closure to execute when CloudKit saves a record zone.
- CKModifyRecordZonesOperation.SetPerRecordZoneSaveBlock
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordZonesOperation
func CKModifyRecordZonesOperationFromID ¶
func CKModifyRecordZonesOperationFromID(id objc.ID) CKModifyRecordZonesOperation
CKModifyRecordZonesOperationFromID constructs a CKModifyRecordZonesOperation from an objc.ID.
An operation that modifies one or more record zones.
func NewCKModifyRecordZonesOperation ¶
func NewCKModifyRecordZonesOperation() CKModifyRecordZonesOperation
NewCKModifyRecordZonesOperation creates a new CKModifyRecordZonesOperation instance.
func (CKModifyRecordZonesOperation) Autorelease ¶
func (c CKModifyRecordZonesOperation) Autorelease() CKModifyRecordZonesOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKModifyRecordZonesOperation) Init ¶
func (c CKModifyRecordZonesOperation) Init() CKModifyRecordZonesOperation
Init initializes the instance.
func (CKModifyRecordZonesOperation) PerRecordZoneDeleteBlock ¶
func (c CKModifyRecordZonesOperation) PerRecordZoneDeleteBlock() unsafe.Pointer
The closure to execute when CloudKit deletes a record zone.
func (CKModifyRecordZonesOperation) PerRecordZoneSaveBlock ¶
func (c CKModifyRecordZonesOperation) PerRecordZoneSaveBlock() unsafe.Pointer
The closure to execute when CloudKit saves a record zone.
func (CKModifyRecordZonesOperation) RecordZoneIDsToDelete ¶
func (c CKModifyRecordZonesOperation) RecordZoneIDsToDelete() []CKRecordZoneID
The IDs of the record zones to delete permanently from the database.
Discussion ¶
The initial value of the property is the array of zone IDs that you provide to the initWithRecordZonesToSave:recordZoneIDsToDelete: method. You can modify this array as necessary before you execute the operation. The record zones must all target the same database. You can specify `nil`, or an empty array, for this property.
If you intend to change the value of this property, do so before you execute the operation or submit the operation to a queue.
func (CKModifyRecordZonesOperation) RecordZonesToSave ¶
func (c CKModifyRecordZonesOperation) RecordZonesToSave() []CKRecordZone
The record zones to save to the database.
Discussion ¶
The initial value of the property is the array that you provide to the initWithRecordZonesToSave:recordZoneIDsToDelete: method. You can modify this array as necessary before you execute the operation. The record zones must all target the same database. You can specify `nil`, or an empty array, for this property.
If you intend to change the value of this property, do so before you execute the operation or submit the operation to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordZonesOperation/recordZonesToSave
func (CKModifyRecordZonesOperation) SetPerRecordZoneDeleteBlock ¶
func (c CKModifyRecordZonesOperation) SetPerRecordZoneDeleteBlock(value kernel.Pointer)
func (CKModifyRecordZonesOperation) SetPerRecordZoneSaveBlock ¶
func (c CKModifyRecordZonesOperation) SetPerRecordZoneSaveBlock(value kernel.Pointer)
func (CKModifyRecordZonesOperation) SetRecordZoneIDsToDelete ¶
func (c CKModifyRecordZonesOperation) SetRecordZoneIDsToDelete(value []CKRecordZoneID)
func (CKModifyRecordZonesOperation) SetRecordZonesToSave ¶
func (c CKModifyRecordZonesOperation) SetRecordZonesToSave(value []CKRecordZone)
type CKModifyRecordZonesOperationClass ¶
type CKModifyRecordZonesOperationClass struct {
// contains filtered or unexported fields
}
func GetCKModifyRecordZonesOperationClass ¶
func GetCKModifyRecordZonesOperationClass() CKModifyRecordZonesOperationClass
GetCKModifyRecordZonesOperationClass returns the class object for CKModifyRecordZonesOperation.
func (CKModifyRecordZonesOperationClass) Alloc ¶
func (cc CKModifyRecordZonesOperationClass) Alloc() CKModifyRecordZonesOperation
Alloc allocates memory for a new instance of the class.
func (CKModifyRecordZonesOperationClass) Class ¶
func (cc CKModifyRecordZonesOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKModifyRecordsOperation ¶
type CKModifyRecordsOperation struct {
CKDatabaseOperation
}
An operation that modifies one or more records.
Overview ¶
After modifying the fields of a record, use this operation to save those changes to a database. You also use this operation to delete records permanently from a database.
If you’re saving a record that contains a reference to another record, set the reference’s CKReference.ReferenceAction to indicate if the target record’s deletion should cascade to the saved record. This helps avoid orphaned records in explicit record hierarchies. When creating two new records that have a reference between them, use the same operation to save both records at the same time. During a save operation, CloudKit requires that the target record of the CKRecord.Parent reference, if set, exists in the database or is part of the same operation; all other reference fields are exempt from this requirement.
When you save records, the value in the CKModifyRecordsOperation.SavePolicy property determines how to proceed when CloudKit detects conflicts. Because records can change between the time you fetch them and the time you save them, the save policy determines whether new changes overwrite existing changes. By default, the operation reports an error when there’s a newer version on the server. You can change the default setting to permit your changes to overwrite the server values wholly or partially.
The handlers you assign to monitor progress of the operation execute serially on an internal queue that the operation manages. You must provide handlers capable of executing on a background thread, so any tasks that require access to the main thread must redirect accordingly.
If you assign a completion handler to the completionBlock property of the operation, CloudKit calls it after the operation executes and returns the results. Use the completion handler to perform any housekeeping tasks for the operation, but don’t use it to process the results of the operation. The completion handler you provide should manage any failures of the operation, whether due to an error or an explicit cancellation.
Configuring the Modify Record Operation ¶
- CKModifyRecordsOperation.RecordsToSave: The records to save to the database.
- CKModifyRecordsOperation.SetRecordsToSave
- CKModifyRecordsOperation.RecordIDsToDelete: The IDs of the records to delete permanently from the database.
- CKModifyRecordsOperation.SetRecordIDsToDelete
- CKModifyRecordsOperation.ClientChangeTokenData: A token that tracks local changes to records.
- CKModifyRecordsOperation.SetClientChangeTokenData
- CKModifyRecordsOperation.Atomic: A Boolean value that indicates whether the entire operation fails when CloudKit can’t update one or more records in a record zone.
- CKModifyRecordsOperation.SetAtomic
- CKModifyRecordsOperation.SavePolicy: The policy to use when saving changes to records.
- CKModifyRecordsOperation.SetSavePolicy
Processing the Modify Record Results ¶
- CKModifyRecordsOperation.PerRecordProgressBlock: The closure to execute with progress information for individual records.
- CKModifyRecordsOperation.SetPerRecordProgressBlock
Instance Properties ¶
- CKModifyRecordsOperation.PerRecordDeleteBlock: The closure to execute when CloudKit deletes a record.
- CKModifyRecordsOperation.SetPerRecordDeleteBlock
- CKModifyRecordsOperation.PerRecordSaveBlock: The closure to execute when CloudKit saves a record.
- CKModifyRecordsOperation.SetPerRecordSaveBlock
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation
func CKModifyRecordsOperationFromID ¶
func CKModifyRecordsOperationFromID(id objc.ID) CKModifyRecordsOperation
CKModifyRecordsOperationFromID constructs a CKModifyRecordsOperation from an objc.ID.
An operation that modifies one or more records.
func NewCKModifyRecordsOperation ¶
func NewCKModifyRecordsOperation() CKModifyRecordsOperation
NewCKModifyRecordsOperation creates a new CKModifyRecordsOperation instance.
func (CKModifyRecordsOperation) Atomic ¶
func (c CKModifyRecordsOperation) Atomic() bool
A Boolean value that indicates whether the entire operation fails when CloudKit can’t update one or more records in a record zone.
Discussion ¶
Modifying records atomically prevents you from updating your data in a way that would leave it in an inconsistent state. You use atomic updates when you want to write multiple records to the same record zone. If there’s a failure to modify any of the records in a zone, CloudKit doesn’t change the other records in that same zone. The record zone must have the CKRecordZoneCapabilityAtomic capability for this behavior to apply. If a record zone doesn’t support the atomic capability, setting this property has no effect.
The default value of this property is true, which causes all modifications within a single record zone to occur atomically. If your operation contains records in multiple record zones, a failure in one zone doesn’t prevent modifications to records in a different zone. Changing the value of this property to false causes CloudKit to modify records individually, regardless of whether the record zone supports atomic modifications.
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation/isAtomic
func (CKModifyRecordsOperation) Autorelease ¶
func (c CKModifyRecordsOperation) Autorelease() CKModifyRecordsOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKModifyRecordsOperation) ClientChangeTokenData ¶
func (c CKModifyRecordsOperation) ClientChangeTokenData() foundation.NSData
A token that tracks local changes to records.
Discussion ¶
The default value is `nil`.
When you modify records from a fetch operation, specify a token using this property to indicate which version of the record you most recently modified. Compare the token you supply to the token in the next record fetch to confirm the server successfully receives the device’s most recent modify request.
If you intend to change the value of this property, do so before you execute the operation or submit the operation to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation/clientChangeTokenData
func (CKModifyRecordsOperation) Init ¶
func (c CKModifyRecordsOperation) Init() CKModifyRecordsOperation
Init initializes the instance.
func (CKModifyRecordsOperation) PerRecordDeleteBlock ¶
func (c CKModifyRecordsOperation) PerRecordDeleteBlock() unsafe.Pointer
The closure to execute when CloudKit deletes a record.
func (CKModifyRecordsOperation) PerRecordProgressBlock ¶
func (c CKModifyRecordsOperation) PerRecordProgressBlock() CKRecordFloat64Handler
The closure to execute with progress information for individual records.
Discussion ¶
This property is a closure that returns no value and has the following parameters:
- The record that CloudKit saves. - The amount of data, as a percentage, that CloudKit saves for the record. The range is `0.0` to `1.0`, where `0.0` indicates that CloudKit hasn’t saved any data, and `1.0` means that CloudKit has saved the entire record.
The modify records operation executes this closure one or more times for each record in the CKModifyRecordsOperation.RecordsToSave property. Each time the closure executes, it executes serially with respect to the other progress closures of the operation. You can use this closure to track the ongoing progress of the operation.
If you intend to use this closure to process results, set it before you execute the operation or add the operation to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation/perRecordProgressBlock
func (CKModifyRecordsOperation) PerRecordSaveBlock ¶
func (c CKModifyRecordsOperation) PerRecordSaveBlock() unsafe.Pointer
The closure to execute when CloudKit saves a record.
See: https://developer.apple.com/documentation/cloudkit/ckmodifyrecordsoperation/perrecordsaveblock-7yq9d
func (CKModifyRecordsOperation) RecordIDsToDelete ¶
func (c CKModifyRecordsOperation) RecordIDsToDelete() []CKRecordID
The IDs of the records to delete permanently from the database.
Discussion ¶
An array of CKRecordID objects that identifies the records to delete. The initial value of the property is the array of record IDs that you provide to the initWithRecordsToSave:recordIDsToDelete: method.
When deleting records, the operation reports progress only on the records with the IDs that you specify in this property. Deleting records can trigger the deletion of related records if there is an owner-owned relationship between the records involving a CKReference object. When additional deletions occur, CloudKit doesn’t pass them to the progress handler of the operation. For that reason, it’s important to understand the implications of the ownership model you use when you relate records to each other through a CKReference object. For more information about owner-owned relationships, see CKReference.
If you intend to change the value of this property, do so before you execute the operation or submit the operation to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation/recordIDsToDelete
func (CKModifyRecordsOperation) RecordsToSave ¶
func (c CKModifyRecordsOperation) RecordsToSave() []CKRecord
The records to save to the database.
Discussion ¶
The initial value of the property is the array that you provide to the initWithRecordsToSave:recordIDsToDelete: method. You can modify this array as necessary before you execute the operation. The records must all target the same database, but can belong to different record zones.
If you intend to change the value of this property, do so before you execute the operation or submit the operation to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation/recordsToSave
func (CKModifyRecordsOperation) SavePolicy ¶
func (c CKModifyRecordsOperation) SavePolicy() CKRecordSavePolicy
The policy to use when saving changes to records.
Discussion ¶
The server uses this property to determine how to proceed when saving record changes. The exact behavior depends on the policy you choose:
- Use CKModifyRecordsOperation.RecordSavePolicy.ifServerRecordUnchanged to only save a record when the change tag of the local copy matches that of the server’s copy. If the server record’s change tag is more recent, CloudKit discards the save and returns a CKError.Code.serverRecordChanged error. - Use CKModifyRecordsOperation.RecordSavePolicy.changedKeys to save only the fields of the record that contain changes. The server doesn’t compare record change tags when using this policy. - Use CKModifyRecordsOperation.RecordSavePolicy.allKeys to save every field of the record, even those without changes. The server doesn’t compare record change tags when using this policy.
If you change the property’s value, do so before you execute the operation or submit the operation to a queue. The default value is CKModifyRecordsOperation.RecordSavePolicy.ifServerRecordUnchanged.
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation/savePolicy
func (CKModifyRecordsOperation) SetAtomic ¶
func (c CKModifyRecordsOperation) SetAtomic(value bool)
func (CKModifyRecordsOperation) SetClientChangeTokenData ¶
func (c CKModifyRecordsOperation) SetClientChangeTokenData(value foundation.NSData)
func (CKModifyRecordsOperation) SetPerRecordDeleteBlock ¶
func (c CKModifyRecordsOperation) SetPerRecordDeleteBlock(value kernel.Pointer)
func (CKModifyRecordsOperation) SetPerRecordProgressBlock ¶
func (c CKModifyRecordsOperation) SetPerRecordProgressBlock(value CKRecordFloat64Handler)
func (CKModifyRecordsOperation) SetPerRecordSaveBlock ¶
func (c CKModifyRecordsOperation) SetPerRecordSaveBlock(value kernel.Pointer)
func (CKModifyRecordsOperation) SetRecordIDsToDelete ¶
func (c CKModifyRecordsOperation) SetRecordIDsToDelete(value []CKRecordID)
func (CKModifyRecordsOperation) SetRecordsToSave ¶
func (c CKModifyRecordsOperation) SetRecordsToSave(value []CKRecord)
func (CKModifyRecordsOperation) SetSavePolicy ¶
func (c CKModifyRecordsOperation) SetSavePolicy(value CKRecordSavePolicy)
type CKModifyRecordsOperationClass ¶
type CKModifyRecordsOperationClass struct {
// contains filtered or unexported fields
}
func GetCKModifyRecordsOperationClass ¶
func GetCKModifyRecordsOperationClass() CKModifyRecordsOperationClass
GetCKModifyRecordsOperationClass returns the class object for CKModifyRecordsOperation.
func (CKModifyRecordsOperationClass) Alloc ¶
func (cc CKModifyRecordsOperationClass) Alloc() CKModifyRecordsOperation
Alloc allocates memory for a new instance of the class.
func (CKModifyRecordsOperationClass) Class ¶
func (cc CKModifyRecordsOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKModifySubscriptionsOperation ¶
type CKModifySubscriptionsOperation struct {
CKDatabaseOperation
}
An operation for modifying one or more subscriptions.
Overview ¶
After you create or change the configuration of a subscription, use this operation to save those changes to the server. You can also use this operation to permanently delete subscriptions.
If you assign a handler to the completionBlock property, the operation calls it after it executes and passes it the results. Use the handler to perform any housekeeping tasks for the operation. The handler you specify should manage any failures, whether due to an error or an explicit cancellation.
Configuring the Modify Subscriptions Operation ¶
- CKModifySubscriptionsOperation.SubscriptionsToSave: The subscriptions to save to the database.
- CKModifySubscriptionsOperation.SetSubscriptionsToSave
- CKModifySubscriptionsOperation.SubscriptionIDsToDelete: The IDs of the subscriptions that you want to delete.
- CKModifySubscriptionsOperation.SetSubscriptionIDsToDelete
Processing the Modify Subscription Results ¶
- CKModifySubscriptionsOperation.ModifySubscriptionsCompletionBlock: The closure to execute after the operation modifies the subscriptions.
- CKModifySubscriptionsOperation.SetModifySubscriptionsCompletionBlock
Instance Properties ¶
- CKModifySubscriptionsOperation.PerSubscriptionDeleteBlock: The closure to execute when CloudKit deletes a subscription.
- CKModifySubscriptionsOperation.SetPerSubscriptionDeleteBlock
- CKModifySubscriptionsOperation.PerSubscriptionSaveBlock: The closure to execute when CloudKit saves a subscription.
- CKModifySubscriptionsOperation.SetPerSubscriptionSaveBlock
See: https://developer.apple.com/documentation/CloudKit/CKModifySubscriptionsOperation
func CKModifySubscriptionsOperationFromID ¶
func CKModifySubscriptionsOperationFromID(id objc.ID) CKModifySubscriptionsOperation
CKModifySubscriptionsOperationFromID constructs a CKModifySubscriptionsOperation from an objc.ID.
An operation for modifying one or more subscriptions.
func NewCKModifySubscriptionsOperation ¶
func NewCKModifySubscriptionsOperation() CKModifySubscriptionsOperation
NewCKModifySubscriptionsOperation creates a new CKModifySubscriptionsOperation instance.
func (CKModifySubscriptionsOperation) Autorelease ¶
func (c CKModifySubscriptionsOperation) Autorelease() CKModifySubscriptionsOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKModifySubscriptionsOperation) Init ¶
func (c CKModifySubscriptionsOperation) Init() CKModifySubscriptionsOperation
Init initializes the instance.
func (CKModifySubscriptionsOperation) ModifySubscriptionsCompletionBlock ¶
func (c CKModifySubscriptionsOperation) ModifySubscriptionsCompletionBlock() objectivec.IObject
The closure to execute after the operation modifies the subscriptions.
func (CKModifySubscriptionsOperation) PerSubscriptionDeleteBlock ¶
func (c CKModifySubscriptionsOperation) PerSubscriptionDeleteBlock() unsafe.Pointer
The closure to execute when CloudKit deletes a subscription.
func (CKModifySubscriptionsOperation) PerSubscriptionSaveBlock ¶
func (c CKModifySubscriptionsOperation) PerSubscriptionSaveBlock() unsafe.Pointer
The closure to execute when CloudKit saves a subscription.
func (CKModifySubscriptionsOperation) SetModifySubscriptionsCompletionBlock ¶
func (c CKModifySubscriptionsOperation) SetModifySubscriptionsCompletionBlock(value objectivec.IObject)
func (CKModifySubscriptionsOperation) SetPerSubscriptionDeleteBlock ¶
func (c CKModifySubscriptionsOperation) SetPerSubscriptionDeleteBlock(value kernel.Pointer)
func (CKModifySubscriptionsOperation) SetPerSubscriptionSaveBlock ¶
func (c CKModifySubscriptionsOperation) SetPerSubscriptionSaveBlock(value kernel.Pointer)
func (CKModifySubscriptionsOperation) SetSubscriptionIDsToDelete ¶
func (c CKModifySubscriptionsOperation) SetSubscriptionIDsToDelete(value kernel.Pointer)
func (CKModifySubscriptionsOperation) SetSubscriptionsToSave ¶
func (c CKModifySubscriptionsOperation) SetSubscriptionsToSave(value []CKSubscription)
func (CKModifySubscriptionsOperation) SubscriptionIDsToDelete ¶
func (c CKModifySubscriptionsOperation) SubscriptionIDsToDelete() unsafe.Pointer
The IDs of the subscriptions that you want to delete.
func (CKModifySubscriptionsOperation) SubscriptionsToSave ¶
func (c CKModifySubscriptionsOperation) SubscriptionsToSave() []CKSubscription
The subscriptions to save to the database.
Discussion ¶
This property contains the subscriptions that you want to save. Its initial value is the array that you pass to the init(subscriptionsToSave:subscriptionIDsToDelete:) method. Modify this property as necessary before you execute the operation or submit it to a queue. After CloudKit saves the subscriptions, it begins generating push notifications according to their criteria.
type CKModifySubscriptionsOperationClass ¶
type CKModifySubscriptionsOperationClass struct {
// contains filtered or unexported fields
}
func GetCKModifySubscriptionsOperationClass ¶
func GetCKModifySubscriptionsOperationClass() CKModifySubscriptionsOperationClass
GetCKModifySubscriptionsOperationClass returns the class object for CKModifySubscriptionsOperation.
func (CKModifySubscriptionsOperationClass) Alloc ¶
func (cc CKModifySubscriptionsOperationClass) Alloc() CKModifySubscriptionsOperation
Alloc allocates memory for a new instance of the class.
func (CKModifySubscriptionsOperationClass) Class ¶
func (cc CKModifySubscriptionsOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKNotification ¶
type CKNotification struct {
objectivec.Object
}
The abstract base class for CloudKit notifications.
Overview ¶
Use subclasses of CKNotification to extract data from push notifications that the system receives, or to fetch a container’s previous push notifications. In both cases, the object indicates the changed data.
CKNotification is an abstract class. When you create a notification from a payload dictionary, the [CKRecordZoneNotificationClass.NotificationFromRemoteNotificationDictionary] method returns an instance of the appropriate subclass. Similarly, when you fetch notifications from a container, you receive instances of a concrete subclass. CKNotification provides information about the push notification and its method of delivery. Subclasses contain specific data that provides the changes.
The system delivers notifications with alerts, badges, or sounds via the [UserNotifications] framework, in the form of a [UNNotification].
Applications should use the [UserNotifications] framework to interact with the alert, badge, and sound properties of the notification.
Applications may create a CKNotification from a [UNNotification] in their [UNUserNotificationCenterDelegate]:
Notifications without alerts, badges, or sounds are delivered via an application delegate, in the form of a remote notification.
For example: `UIApplicationDelegate.Application(_:) async`
Applications may create a CKNotification from the remote notification in their [UIApplicationDelegate]:
Identifying the Notification ¶
- CKNotification.NotificationID: The notification’s ID.
- CKNotification.NotificationType: The type of event that generates the notification.
- CKNotification.ContainerIdentifier: The ID of the container with the content that triggers the notification.
Getting the Notification’s Status ¶
- CKNotification.IsPruned: A Boolean value that indicates whether the system removes some push notification content before delivery.
Accessing the Notification Info ¶
- CKNotification.AlertBody: The notification’s alert body.
- CKNotification.AlertLocalizationKey: The key that identifies the localized text for the alert body.
- CKNotification.AlertLocalizationArgs: The fields for building a notification’s alert.
- CKNotification.AlertActionLocalizationKey: The key that identifies the localized string for the notification’s action.
- CKNotification.AlertLaunchImage: The filename of an image to use as a launch image.
- CKNotification.SoundName: The name of the sound file to play when a notification arrives.
- CKNotification.Badge: The value that the app icon’s badge displays.
- CKNotification.Category: The name of the action group that corresponds to this notification.
- CKNotification.SubscriptionID: The ID of the subscription that triggers the notification.
- CKNotification.SetSubscriptionID
- CKNotification.SubscriptionOwnerUserRecordID: The ID of the user record that creates the subscription that generates the push notification.
- CKNotification.Title: The notification’s title.
- CKNotification.TitleLocalizationKey: The key that identifies the localized string for the notification’s title.
- CKNotification.TitleLocalizationArgs: The fields for building a notification’s title.
- CKNotification.Subtitle: The notification’s subtitle.
- CKNotification.SubtitleLocalizationKey: The key that identifies the localized string for the notification’s subtitle.
- CKNotification.SubtitleLocalizationArgs: The fields for building a notification’s subtitle.
See: https://developer.apple.com/documentation/CloudKit/CKNotification
func CKNotificationFromID ¶
func CKNotificationFromID(id objc.ID) CKNotification
CKNotificationFromID constructs a CKNotification from an objc.ID.
The abstract base class for CloudKit notifications.
func NewCKNotification ¶
func NewCKNotification() CKNotification
NewCKNotification creates a new CKNotification instance.
func NewCKNotificationFromRemoteNotificationDictionary ¶
func NewCKNotificationFromRemoteNotificationDictionary(notificationDictionary foundation.INSDictionary) CKNotification
Creates a new notification using the specified payload data.
notificationDictionary: The push notification’s payload data. Use the dictionary that the system provides to your app delegate’s application(_:didReceiveRemoteNotification:fetchCompletionHandler:) method. This parameter must not be `nil`.
func (CKNotification) AlertActionLocalizationKey ¶
func (c CKNotification) AlertActionLocalizationKey() string
The key that identifies the localized string for the notification’s action.
Discussion ¶
The system uses this property’s value to find the matching string in your app’s `Localizable.Strings()` file. It uses the string as the text of the button that opens your app, which the notification alert displays.
If this property’s value is `nil`, the system displays a single button to dismiss the alert.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/alertActionLocalizationKey
func (CKNotification) AlertBody ¶
func (c CKNotification) AlertBody() string
The notification’s alert body.
Discussion ¶
This property contains the nonlocalized text that the notification’s alert displays.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/alertBody
func (CKNotification) AlertLaunchImage ¶
func (c CKNotification) AlertLaunchImage() string
The filename of an image to use as a launch image.
Discussion ¶
The system uses this property’s value to locate an image in the app’s bundle, and displays it as a launch image when the user launches the app after receiving a push notification.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/alertLaunchImage
func (CKNotification) AlertLocalizationArgs ¶
func (c CKNotification) AlertLocalizationArgs() []string
The fields for building a notification’s alert.
Discussion ¶
This property is an array of field names that CloudKit uses to extract the corresponding values from the record that triggers the push notification. The values are strings, numbers, or dates. CloudKit may truncate strings with a length greater than 100 characters when it adds them to a notification’s payload.
If you use `%@` for your substitution variables, CloudKit replaces those variables by traversing the array in order. If you use variables of the form `%n$@`, where `n` is an integer, `n` represents the index (starting at 1) of the item in the array to use. So, the first item in the array replaces the variable `%1$@`, the second item replaces the variable `%2$@`, and so on. You can use indexed substitution variables to change the order of items in the resulting string, which might be necessary when you localize your app’s content.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/alertLocalizationArgs
func (CKNotification) AlertLocalizationKey ¶
func (c CKNotification) AlertLocalizationKey() string
The key that identifies the localized text for the alert body.
Discussion ¶
When the system delivers a push notification to your app, it gets the text for the alert body by looking up the specified key in your app’s `Localizable.Strings()` file. CloudKit ignores the value in CKNotification.AlertBody if you set this property.
.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/alertLocalizationKey
func (CKNotification) Autorelease ¶
func (c CKNotification) Autorelease() CKNotification
Autorelease adds the receiver to the current autorelease pool.
func (CKNotification) Badge ¶
func (c CKNotification) Badge() foundation.NSNumber
The value that the app icon’s badge displays.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/badge
func (CKNotification) Category ¶
func (c CKNotification) Category() string
The name of the action group that corresponds to this notification.
Discussion ¶
Categories allow you to present custom actions to the user on your push notifications. For more information, see UIMutableUserNotificationCategory.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/category
func (CKNotification) ContainerIdentifier ¶
func (c CKNotification) ContainerIdentifier() string
The ID of the container with the content that triggers the notification.
Discussion ¶
Use this property to determine the location of the changed content.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/containerIdentifier
func (CKNotification) Init ¶
func (c CKNotification) Init() CKNotification
Init initializes the instance.
func (CKNotification) IsPruned ¶
func (c CKNotification) IsPruned() bool
A Boolean value that indicates whether the system removes some push notification content before delivery.
Discussion ¶
The server may truncate the payload data of a push notification if the size of that data exceeds the allowed maximum. For notifications you create using a payload dictionary, the value of this property is true if the payload data doesn’t contain all information regarding the change. The value is false if the payload data is complete.
For notifications you fetch from the database using a [CKFetchNotificationChangesOperation] operation, this property’s value is always true.
When CloudKit must remove payload data, it removes it in a specific order. This class’s properties are among the last that CloudKit removes because they define information about how to deliver the push notification. The following list shows the properties that CloudKit removes, and the order for removing them:
- CKNotification.ContainerIdentifier - Keys that subclasses of CKNotification define. - CKNotification.SoundName - CKNotification.AlertLaunchImage - CKNotification.AlertActionLocalizationKey - CKNotification.AlertBody - CKNotification.AlertLocalizationArgs - CKNotification.AlertLocalizationKey - CKNotification.Badge - CKNotification.NotificationID
See: https://developer.apple.com/documentation/CloudKit/CKNotification/isPruned
func (CKNotification) NotificationID ¶
func (c CKNotification) NotificationID() ICKNotificationID
The notification’s ID.
Discussion ¶
Use this property to differentiate notifications.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/notificationID
func (CKNotification) NotificationType ¶
func (c CKNotification) NotificationType() CKNotificationType
The type of event that generates the notification.
Discussion ¶
Different notification types correspond to different subclasses of CKNotification, so you can use the value in this property to determine how to handle the notification data.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/notificationType-swift.property
func (CKNotification) SetSubscriptionID ¶
func (c CKNotification) SetSubscriptionID(value CKSubscriptionID)
func (CKNotification) SoundName ¶
func (c CKNotification) SoundName() string
The name of the sound file to play when a notification arrives.
Discussion ¶
The system uses this property’s value to locate a sound file in the app’s bundle. The sound plays when the system receives a push notification. If the system can’t find the specified file, or if the property’s value is the string `default`, the system plays the default sound.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/soundName
func (CKNotification) SubscriptionID ¶
func (c CKNotification) SubscriptionID() CKSubscriptionID
The ID of the subscription that triggers the notification.
See: https://developer.apple.com/documentation/cloudkit/cknotification/subscriptionid-16ygj
func (CKNotification) SubscriptionOwnerUserRecordID ¶
func (c CKNotification) SubscriptionOwnerUserRecordID() ICKRecordID
The ID of the user record that creates the subscription that generates the push notification.
Discussion ¶
On a system that supports multiple users, such as tvOS, use this identifier to check whether the pending content is for the current user. If your app always fetches data from CloudKit on launch, you may improve efficiency by disregarding notifications for other users.
For more information about supporting a multiuser environment, see Personalizing Your App for Each User on Apple TV.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/subscriptionOwnerUserRecordID
func (CKNotification) Subtitle ¶
func (c CKNotification) Subtitle() string
The notification’s subtitle.
Discussion ¶
The system ignores this property if CKNotification.SubtitleLocalizationKey has a value.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/subtitle
func (CKNotification) SubtitleLocalizationArgs ¶
func (c CKNotification) SubtitleLocalizationArgs() []string
The fields for building a notification’s subtitle.
Discussion ¶
This property is an array of field names that CloudKit uses to extract the corresponding values from the record that triggers the push notification. The values are strings, numbers, or dates. CloudKit may truncate strings with a length greater than 100 characters when it adds them to a notification’s payload.
If you use `%@` for your substitution variables, CloudKit replaces those variables by traversing the array in order. If you use variables of the form `%n$@`, where `n` is an integer, `n` represents the index (starting at 1) of the item in the array to use. So, the first item in the array replaces the variable `%1$@`, the second item replaces the variable `%2$@`, and so on. You can use indexed substitution variables to change the order of items in the resulting string, which might be necessary when you localize your app’s content.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/subtitleLocalizationArgs
func (CKNotification) SubtitleLocalizationKey ¶
func (c CKNotification) SubtitleLocalizationKey() string
The key that identifies the localized string for the notification’s subtitle.
Discussion ¶
This property takes precedence over CKNotification.Subtitle.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/subtitleLocalizationKey
func (CKNotification) Title ¶
func (c CKNotification) Title() string
The notification’s title.
Discussion ¶
The system ignores this property if CKNotification.TitleLocalizationKey has a value.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/title
func (CKNotification) TitleLocalizationArgs ¶
func (c CKNotification) TitleLocalizationArgs() []string
The fields for building a notification’s title.
Discussion ¶
This property is an array of field names that CloudKit uses to extract the corresponding values from the record that triggers the push notification. The values are strings, numbers, or dates. CloudKit may truncate strings with a length greater than 100 characters when it adds them to a notification’s payload.
If you use `%@` for your substitution variables, CloudKit replaces those variables by traversing the array in order. If you use variables of the form `%n$@`, where `n` is an integer, `n` represents the index (starting at 1) of the item in the array to use. So, the first item in the array replaces the variable `%1$@`, the second item replaces the variable `%2$@`, and so on. You can use indexed substitution variables to change the order of items in the resulting string, which might be necessary when you localize your app’s content.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/titleLocalizationArgs
func (CKNotification) TitleLocalizationKey ¶
func (c CKNotification) TitleLocalizationKey() string
The key that identifies the localized string for the notification’s title.
Discussion ¶
This property takes precedence over CKNotification.Title.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/titleLocalizationKey
type CKNotificationClass ¶
type CKNotificationClass struct {
// contains filtered or unexported fields
}
func GetCKNotificationClass ¶
func GetCKNotificationClass() CKNotificationClass
GetCKNotificationClass returns the class object for CKNotification.
func (CKNotificationClass) Alloc ¶
func (cc CKNotificationClass) Alloc() CKNotification
Alloc allocates memory for a new instance of the class.
func (CKNotificationClass) Class ¶
func (cc CKNotificationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKNotificationID ¶
type CKNotificationID struct {
objectivec.Object
}
An object that uniquely identifies a push notification that a container sends.
Overview ¶
You don’t create notification IDs directly. The server creates them when it creates instances of CKNotification that correspond to the push notifications that CloudKit sends to your app. You can compare two IDs using the isEqual(_:) method to determine whether two notifications are the same. This class defines no methods or properties.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/ID
func CKNotificationIDFromID ¶
func CKNotificationIDFromID(id objc.ID) CKNotificationID
CKNotificationIDFromID constructs a CKNotificationID from an objc.ID.
An object that uniquely identifies a push notification that a container sends.
func NewCKNotificationID ¶
func NewCKNotificationID() CKNotificationID
NewCKNotificationID creates a new CKNotificationID instance.
func (CKNotificationID) Autorelease ¶
func (c CKNotificationID) Autorelease() CKNotificationID
Autorelease adds the receiver to the current autorelease pool.
func (CKNotificationID) EncodeWithCoder ¶
func (c CKNotificationID) EncodeWithCoder(coder foundation.INSCoder)
func (CKNotificationID) Init ¶
func (c CKNotificationID) Init() CKNotificationID
Init initializes the instance.
type CKNotificationIDClass ¶
type CKNotificationIDClass struct {
// contains filtered or unexported fields
}
func GetCKNotificationIDClass ¶
func GetCKNotificationIDClass() CKNotificationIDClass
GetCKNotificationIDClass returns the class object for CKNotificationID.
func (CKNotificationIDClass) Alloc ¶
func (cc CKNotificationIDClass) Alloc() CKNotificationID
Alloc allocates memory for a new instance of the class.
func (CKNotificationIDClass) Class ¶
func (cc CKNotificationIDClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKNotificationInfo ¶
type CKNotificationInfo struct {
objectivec.Object
}
An object that describes the configuration of a subscription’s push notifications.
Overview ¶
When configuring a subscription, use this class to specify the type of push notifications you want to generate when conditions meet the subscription’s trigger. You can provide content that the system displays to the user, describe the sounds to play, and indicate whether the app’s icon has a badge. You can request that the notification include information about the record that triggers it.
When your app receives a push notification that a subscription generates, instantiate an instance of CKNotification using the [CKRecordZoneNotificationClass.NotificationFromRemoteNotificationDictionary] method and pass the notification’s payload. The object that the method returns contains the data you specify when configuring the subscription.
For more information about push notification alerts and how they display to the user, see Apple Push Notification Service in Local and Remote Notification Programming Guide.
Grouping Notifications ¶
- CKNotificationInfo.Category: The name of the action group that corresponds to this notification.
- CKNotificationInfo.SetCategory
- CKNotificationInfo.CollapseIDKey: A value that the system uses to coalesce unseen push notifications.
- CKNotificationInfo.SetCollapseIDKey
Displaying Badges ¶
- CKNotificationInfo.ShouldBadge: A Boolean value that determines whether an app’s icon badge increments its value.
- CKNotificationInfo.SetShouldBadge
Accessing the Notification Alert ¶
- CKNotificationInfo.AlertBody: The text for the notification’s alert.
- CKNotificationInfo.SetAlertBody
- CKNotificationInfo.AlertLocalizationKey: The key that identifies the localized string for the notification’s alert.
- CKNotificationInfo.SetAlertLocalizationKey
- CKNotificationInfo.AlertActionLocalizationKey: The key that identifies the localized string for the notification’s action.
- CKNotificationInfo.SetAlertActionLocalizationKey
- CKNotificationInfo.AlertLaunchImage: The filename of an image to use as a launch image.
- CKNotificationInfo.SetAlertLaunchImage
- CKNotificationInfo.SoundName: The filename of the sound file to play when a notification arrives.
- CKNotificationInfo.SetSoundName
Accessing the Notification Info ¶
- CKNotificationInfo.ShouldSendContentAvailable: A Boolean value that indicates whether the push notification includes the content available flag.
- CKNotificationInfo.SetShouldSendContentAvailable
- CKNotificationInfo.ShouldSendMutableContent: A Boolean value that indicates whether the push notification sets the mutable content flag.
- CKNotificationInfo.SetShouldSendMutableContent
Accessing the Notification Title ¶
- CKNotificationInfo.Title: The notification’s title.
- CKNotificationInfo.SetTitle
- CKNotificationInfo.TitleLocalizationKey: The key that identifies the localized string for the notification’s title.
- CKNotificationInfo.SetTitleLocalizationKey
Accessing the Notification Subtitle ¶
- CKNotificationInfo.Subtitle: The notification’s subtitle.
- CKNotificationInfo.SetSubtitle
- CKNotificationInfo.SubtitleLocalizationKey: The key that identifies the localized string for the notification’s subtitle.
- CKNotificationInfo.SetSubtitleLocalizationKey
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/NotificationInfo-swift.class
func CKNotificationInfoFromID ¶
func CKNotificationInfoFromID(id objc.ID) CKNotificationInfo
CKNotificationInfoFromID constructs a CKNotificationInfo from an objc.ID.
An object that describes the configuration of a subscription’s push notifications.
func NewCKNotificationInfo ¶
func NewCKNotificationInfo() CKNotificationInfo
NewCKNotificationInfo creates a new CKNotificationInfo instance.
func (CKNotificationInfo) AlertActionLocalizationKey ¶
func (c CKNotificationInfo) AlertActionLocalizationKey() string
The key that identifies the localized string for the notification’s action.
Discussion ¶
Set this property’s value to have the system use a localized string for the text of the notification’s button that opens your app. The system uses the key to find the matching string in your app’s `Localizable.String()` file.
If this property’s value is `nil`, the system displays a single button to dismiss the alert.
For information about localizing string resources, see Internationalization and Localization Guide.
func (CKNotificationInfo) AlertBody ¶
func (c CKNotificationInfo) AlertBody() string
The text for the notification’s alert.
Discussion ¶
Set this property’s value to have the system display the specified string when it receives the corresponding push notification. If you localize your app’s content, use the CKNotificationInfo.AlertLocalizationKey property instead.
func (CKNotificationInfo) AlertLaunchImage ¶
func (c CKNotificationInfo) AlertLaunchImage() string
The filename of an image to use as a launch image.
Discussion ¶
If you specify a value, the system uses it to locate an image in the app’s bundle, and displays it as a launch image when the user launches the app after receiving a push notification.
func (CKNotificationInfo) AlertLocalizationKey ¶
func (c CKNotificationInfo) AlertLocalizationKey() string
The key that identifies the localized string for the notification’s alert.
Discussion ¶
Set this property’s value to have the system display a localized string when it receives the corresponding push notification. The system uses the key to find the matching string in your app’s `Localizable.String()` file. If you specify a value for this property, CloudKit ignores the CKNotificationInfo.AlertBody property’s value.
For information about localizing string resources, see Internationalization and Localization Guide.
func (CKNotificationInfo) Autorelease ¶
func (c CKNotificationInfo) Autorelease() CKNotificationInfo
Autorelease adds the receiver to the current autorelease pool.
func (CKNotificationInfo) Category ¶
func (c CKNotificationInfo) Category() string
The name of the action group that corresponds to this notification.
Discussion ¶
Categories allow you to present custom actions to the user on your push notifications. For more information, see UIMutableUserNotificationCategory.
func (CKNotificationInfo) CollapseIDKey ¶
func (c CKNotificationInfo) CollapseIDKey() string
A value that the system uses to coalesce unseen push notifications.
Discussion ¶
When CloudKit generates a push notification, it sets the notification’s `apns-collapse-id` header to this property’s value. The system uses this header to coalesce unseen notifications.
See Sending notification requests to APNs for more information about sending notifications using the Apple Push Notification service.
func (CKNotificationInfo) EncodeWithCoder ¶
func (c CKNotificationInfo) EncodeWithCoder(coder foundation.INSCoder)
func (CKNotificationInfo) Init ¶
func (c CKNotificationInfo) Init() CKNotificationInfo
Init initializes the instance.
func (CKNotificationInfo) SetAlertActionLocalizationKey ¶
func (c CKNotificationInfo) SetAlertActionLocalizationKey(value string)
func (CKNotificationInfo) SetAlertBody ¶
func (c CKNotificationInfo) SetAlertBody(value string)
func (CKNotificationInfo) SetAlertLaunchImage ¶
func (c CKNotificationInfo) SetAlertLaunchImage(value string)
func (CKNotificationInfo) SetAlertLocalizationKey ¶
func (c CKNotificationInfo) SetAlertLocalizationKey(value string)
func (CKNotificationInfo) SetCategory ¶
func (c CKNotificationInfo) SetCategory(value string)
func (CKNotificationInfo) SetCollapseIDKey ¶
func (c CKNotificationInfo) SetCollapseIDKey(value string)
func (CKNotificationInfo) SetShouldBadge ¶
func (c CKNotificationInfo) SetShouldBadge(value bool)
func (CKNotificationInfo) SetShouldSendContentAvailable ¶
func (c CKNotificationInfo) SetShouldSendContentAvailable(value bool)
func (CKNotificationInfo) SetShouldSendMutableContent ¶
func (c CKNotificationInfo) SetShouldSendMutableContent(value bool)
func (CKNotificationInfo) SetSoundName ¶
func (c CKNotificationInfo) SetSoundName(value string)
func (CKNotificationInfo) SetSubtitle ¶
func (c CKNotificationInfo) SetSubtitle(value string)
func (CKNotificationInfo) SetSubtitleLocalizationKey ¶
func (c CKNotificationInfo) SetSubtitleLocalizationKey(value string)
func (CKNotificationInfo) SetTitle ¶
func (c CKNotificationInfo) SetTitle(value string)
func (CKNotificationInfo) SetTitleLocalizationKey ¶
func (c CKNotificationInfo) SetTitleLocalizationKey(value string)
func (CKNotificationInfo) ShouldBadge ¶
func (c CKNotificationInfo) ShouldBadge() bool
A Boolean value that determines whether an app’s icon badge increments its value.
Discussion ¶
The default value of this property is false. Set it to true to cause the system to increment the badge value whenever it receives the corresponding push notification.
func (CKNotificationInfo) ShouldSendContentAvailable ¶
func (c CKNotificationInfo) ShouldSendContentAvailable() bool
A Boolean value that indicates whether the push notification includes the content available flag.
Discussion ¶
When this property is true, the server includes the `content-available` flag in the push notification’s payload. That flag causes the system to wake or launch an app that isn’t currently running. The app then receives background execution time to download any data for the push notification, such as the set of changed records. If the app is already running in the foreground, the inclusion of this flag has no additional effect and the system delivers the notification to the app delegate for processing as usual.
The default value of this property is false.
func (CKNotificationInfo) ShouldSendMutableContent ¶
func (c CKNotificationInfo) ShouldSendMutableContent() bool
A Boolean value that indicates whether the push notification sets the mutable content flag.
Discussion ¶
When this property is true, the server includes the `mutable-content` flag with a value of `1` in the push notification’s payload. When the value is `1`, the system passes the notification to your app extension for modification before delivery.
See Generating a remote notification for more information about the `mutable-content` flag, and Modifying content in newly delivered notifications for information about how to modify push notifiction content in your app extension prior to delivery.
The default value of this property is false.
func (CKNotificationInfo) SoundName ¶
func (c CKNotificationInfo) SoundName() string
The filename of the sound file to play when a notification arrives.
Discussion ¶
If you specify a value, the system uses it to locate a sound file in the app’s bundle. The sound plays when the system receives a push notification. If the system can’t find the specified file, or if you use the string `default`, the system plays the default sound.
func (CKNotificationInfo) Subtitle ¶
func (c CKNotificationInfo) Subtitle() string
The notification’s subtitle.
Discussion ¶
CloudKit uses this value to set the `subtitle` push notification property. If you set CKNotificationInfo.SubtitleLocalizationKey, CloudKit ignores this value.
See Generating a remote notification for more details about push notification properties.
func (CKNotificationInfo) SubtitleLocalizationKey ¶
func (c CKNotificationInfo) SubtitleLocalizationKey() string
The key that identifies the localized string for the notification’s subtitle.
Discussion ¶
CloudKit uses this value to set the `subtitle-loc-key` push notification property. Setting this property overrides any value in CKNotificationInfo.Subtitle.
See Generating a remote notification for more details about push notification properties.
func (CKNotificationInfo) Title ¶
func (c CKNotificationInfo) Title() string
The notification’s title.
Discussion ¶
CloudKit uses this value to set the `title` push notification property.
See Generating a remote notification for more detail about push notification properties.
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/NotificationInfo-swift.class/title
func (CKNotificationInfo) TitleLocalizationKey ¶
func (c CKNotificationInfo) TitleLocalizationKey() string
The key that identifies the localized string for the notification’s title.
Discussion ¶
CloudKit uses this value to set the `title-loc-key` push notification property.
See Generating a remote notification for more details about push notification properties.
type CKNotificationInfoClass ¶
type CKNotificationInfoClass struct {
// contains filtered or unexported fields
}
func GetCKNotificationInfoClass ¶
func GetCKNotificationInfoClass() CKNotificationInfoClass
GetCKNotificationInfoClass returns the class object for CKNotificationInfo.
func (CKNotificationInfoClass) Alloc ¶
func (cc CKNotificationInfoClass) Alloc() CKNotificationInfo
Alloc allocates memory for a new instance of the class.
func (CKNotificationInfoClass) Class ¶
func (cc CKNotificationInfoClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKNotificationType ¶
type CKNotificationType int
See: https://developer.apple.com/documentation/CloudKit/CKNotification/NotificationType-swift.enum
const ( // CKNotificationTypeDatabase: A notification that CloudKit generates when the contents of a database change. CKNotificationTypeDatabase CKNotificationType = 4 // CKNotificationTypeQuery: A notification that CloudKit generates from a query subscription’s predicate. CKNotificationTypeQuery CKNotificationType = 1 // CKNotificationTypeReadNotification: A notification that your app marks as read. CKNotificationTypeReadNotification CKNotificationType = 3 // CKNotificationTypeRecordZone: A notification that CloudKit generates when the contents of a record zone change. CKNotificationTypeRecordZone CKNotificationType = 2 )
func (CKNotificationType) String ¶
func (e CKNotificationType) String() string
type CKOperation ¶
type CKOperation struct {
foundation.NSOperation
}
The abstract base class for all operations that execute in a database.
Overview ¶
All CloudKit operations descend from CKOperation, which provides the infrastructure for executing tasks in one of your app’s containers. Don’t subclass or create instances of this class directly. Instead, create instances of one of its concrete subclasses.
Use the properties of this class to configure the behavior of the operation before submitting it to a queue or executing it directly. CloudKit operations involve communicating with the iCloud servers to send and receive data. You can use the properties of this class to configure the behavior of those network requests to ensure the best performance for your app.
Long-Lived Operations ¶
A is an operation that continues to run after the user closes the app. To specify a long-lived operation, set CKOperation.IsLongLived to true, provide a completion handler, and execute the operation. To get the identifiers of all running long-lived operations, use the allLongLivedOperationIDs() method that CKContainer provides. To get a specific long-lived operation, use the longLivedOperation(for:) method. Make sure you set the completion handler of a long-lived operation before you execute it so that the system can notify you when it completes and you can process the results. Do not execute an operation, change it to long-lived, and execute it again as a long-lived operation.
The following is the typical life cycle of a long-lived operation:
- The app creates a long-lived operation and executes it.
The daemon starts saving and sending the callbacks to the running app. 2. The app exits.
The daemon continues running the long-lived operation and saves the callbacks. 3. The app launches and fetches the long-lived operation.
If the operation is running or if it completed within the previous 24 hours, the daemon returns a proxy for the long-lived operation. If the operation completed more than 24 hours previously, the daemon may stop returning it in fetch requests. 4. The app runs the long-lived operation again.
The daemon sends the app all the saved callbacks (it doesn’t actually rerun the operation), and continues saving the callbacks and sending them to the running app. 5. The app receives the completion callback or the app cancels the operation.
The daemon stops including the operation in future fetch results.
Identifying the Operation ¶
- CKOperation.OperationID: A unique identifier for a long-lived operation.
- CKOperation.SetOperationID
Managing the Operation’s Configuration ¶
- CKOperation.Configuration: The operation’s configuration.
- CKOperation.SetConfiguration
- CKOperation.Group: The operation’s group.
- CKOperation.SetGroup
- CKOperation.LongLivedOperationWasPersistedBlock: The closure to execute when the server begins to store callbacks for the long-lived operation.
- CKOperation.SetLongLivedOperationWasPersistedBlock
See: https://developer.apple.com/documentation/CloudKit/CKOperation
func CKOperationFromID ¶
func CKOperationFromID(id objc.ID) CKOperation
CKOperationFromID constructs a CKOperation from an objc.ID.
The abstract base class for all operations that execute in a database.
func NewCKOperation ¶
func NewCKOperation() CKOperation
NewCKOperation creates a new CKOperation instance.
func (CKOperation) AllowsCellularAccess ¶
func (c CKOperation) AllowsCellularAccess() bool
A Boolean value that indicates whether the operation can send data over the cellular network.
See: https://developer.apple.com/documentation/cloudkit/ckoperation/allowscellularaccess
func (CKOperation) Autorelease ¶
func (c CKOperation) Autorelease() CKOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKOperation) Configuration ¶
func (c CKOperation) Configuration() ICKOperationConfiguration
The operation’s configuration.
See: https://developer.apple.com/documentation/CloudKit/CKOperation/configuration-swift.property
func (CKOperation) Container ¶
func (c CKOperation) Container() ICKContainer
The operation’s container.
See: https://developer.apple.com/documentation/cloudkit/ckoperation/container
func (CKOperation) Group ¶
func (c CKOperation) Group() ICKOperationGroup
The operation’s group.
See: https://developer.apple.com/documentation/CloudKit/CKOperation/group
func (CKOperation) IsLongLived ¶
func (c CKOperation) IsLongLived() bool
A Boolean value that indicates whether the operation is long-lived.
See: https://developer.apple.com/documentation/cloudkit/ckoperation/islonglived
func (CKOperation) LongLivedOperationWasPersistedBlock ¶
func (c CKOperation) LongLivedOperationWasPersistedBlock() VoidHandler
The closure to execute when the server begins to store callbacks for the long-lived operation.
Discussion ¶
If your app exits before CloudKit calls this property’s value, the system doesn’t include the operation’s ID in the results of calls to the fetchAllLongLivedOperationIDsWithCompletionHandler: method.
For more information, see CKOperation.
See: https://developer.apple.com/documentation/CloudKit/CKOperation/longLivedOperationWasPersistedBlock
func (CKOperation) OperationID ¶
func (c CKOperation) OperationID() CKOperationID
A unique identifier for a long-lived operation.
See: https://developer.apple.com/documentation/cloudkit/ckoperation/operationid-8auuc
func (CKOperation) SetAllowsCellularAccess ¶
func (c CKOperation) SetAllowsCellularAccess(value bool)
func (CKOperation) SetConfiguration ¶
func (c CKOperation) SetConfiguration(value ICKOperationConfiguration)
func (CKOperation) SetContainer ¶
func (c CKOperation) SetContainer(value ICKContainer)
func (CKOperation) SetGroup ¶
func (c CKOperation) SetGroup(value ICKOperationGroup)
func (CKOperation) SetLongLived ¶
func (c CKOperation) SetLongLived(value bool)
func (CKOperation) SetLongLivedOperationWasPersistedBlock ¶
func (c CKOperation) SetLongLivedOperationWasPersistedBlock(value VoidHandler)
func (CKOperation) SetOperationID ¶
func (c CKOperation) SetOperationID(value CKOperationID)
func (CKOperation) SetTimeoutIntervalForRequest ¶
func (c CKOperation) SetTimeoutIntervalForRequest(value float64)
func (CKOperation) SetTimeoutIntervalForResource ¶
func (c CKOperation) SetTimeoutIntervalForResource(value float64)
func (CKOperation) TimeoutIntervalForRequest ¶
func (c CKOperation) TimeoutIntervalForRequest() float64
The timeout interval when waiting for additional data.
See: https://developer.apple.com/documentation/cloudkit/ckoperation/timeoutintervalforrequest
func (CKOperation) TimeoutIntervalForResource ¶
func (c CKOperation) TimeoutIntervalForResource() float64
The maximum amount of time that a resource request can use.
See: https://developer.apple.com/documentation/cloudkit/ckoperation/timeoutintervalforresource
type CKOperationClass ¶
type CKOperationClass struct {
// contains filtered or unexported fields
}
func GetCKOperationClass ¶
func GetCKOperationClass() CKOperationClass
GetCKOperationClass returns the class object for CKOperation.
func (CKOperationClass) Alloc ¶
func (cc CKOperationClass) Alloc() CKOperation
Alloc allocates memory for a new instance of the class.
func (CKOperationClass) Class ¶
func (cc CKOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKOperationConfiguration ¶
type CKOperationConfiguration struct {
objectivec.Object
}
An object that describes how a CloudKit operation behaves.
Overview ¶
All of the properties in CKOperationConfiguration have a default value. When determining which properties to apply to a CloudKit operation, consult the operation’s configuration property, as well as the CKOperationGroup.DefaultConfiguration property of the group that the operation belongs to. These properties combine through the following rules:
[Table data omitted]
Preparing a Configuration ¶
- CKOperationConfiguration.AllowsCellularAccess: A Boolean value that indicates whether operations that use this configuration can send data over the cellular network.
- CKOperationConfiguration.SetAllowsCellularAccess
- CKOperationConfiguration.Container: The configuration’s container.
- CKOperationConfiguration.SetContainer
- CKOperationConfiguration.IsLongLived: A Boolean value that indicates whether the operations that use this configuration are long-lived.
- CKOperationConfiguration.SetLongLived
- CKOperationConfiguration.QualityOfService: The priority that the system uses when it allocates resources to the operations that use this configuration.
- CKOperationConfiguration.SetQualityOfService
- CKOperationConfiguration.TimeoutIntervalForRequest: The maximum amount of time that a request can take.
- CKOperationConfiguration.SetTimeoutIntervalForRequest
- CKOperationConfiguration.TimeoutIntervalForResource: The maximum amount of time that a resource request can take.
- CKOperationConfiguration.SetTimeoutIntervalForResource
See: https://developer.apple.com/documentation/CloudKit/CKOperation/Configuration-swift.class
func CKOperationConfigurationFromID ¶
func CKOperationConfigurationFromID(id objc.ID) CKOperationConfiguration
CKOperationConfigurationFromID constructs a CKOperationConfiguration from an objc.ID.
An object that describes how a CloudKit operation behaves.
func NewCKOperationConfiguration ¶
func NewCKOperationConfiguration() CKOperationConfiguration
NewCKOperationConfiguration creates a new CKOperationConfiguration instance.
func (CKOperationConfiguration) AllowsCellularAccess ¶
func (c CKOperationConfiguration) AllowsCellularAccess() bool
A Boolean value that indicates whether operations that use this configuration can send data over the cellular network.
func (CKOperationConfiguration) Autorelease ¶
func (c CKOperationConfiguration) Autorelease() CKOperationConfiguration
Autorelease adds the receiver to the current autorelease pool.
func (CKOperationConfiguration) Container ¶
func (c CKOperationConfiguration) Container() ICKContainer
The configuration’s container.
Discussion ¶
If you don’t provide a container, CloudKit uses the default container that CKContainer provides.
See: https://developer.apple.com/documentation/CloudKit/CKOperation/Configuration-swift.class/container
func (CKOperationConfiguration) Init ¶
func (c CKOperationConfiguration) Init() CKOperationConfiguration
Init initializes the instance.
func (CKOperationConfiguration) IsLongLived ¶ added in v0.6.5
func (c CKOperationConfiguration) IsLongLived() bool
A Boolean value that indicates whether the operations that use this configuration are long-lived.
See: https://developer.apple.com/documentation/CloudKit/CKOperation/Configuration-swift.class/isLongLived
func (CKOperationConfiguration) QualityOfService ¶
func (c CKOperationConfiguration) QualityOfService() foundation.NSQualityOfService
The priority that the system uses when it allocates resources to the operations that use this configuration.
func (CKOperationConfiguration) SetAllowsCellularAccess ¶
func (c CKOperationConfiguration) SetAllowsCellularAccess(value bool)
func (CKOperationConfiguration) SetContainer ¶
func (c CKOperationConfiguration) SetContainer(value ICKContainer)
func (CKOperationConfiguration) SetLongLived ¶
func (c CKOperationConfiguration) SetLongLived(value bool)
func (CKOperationConfiguration) SetQualityOfService ¶
func (c CKOperationConfiguration) SetQualityOfService(value foundation.NSQualityOfService)
func (CKOperationConfiguration) SetTimeoutIntervalForRequest ¶
func (c CKOperationConfiguration) SetTimeoutIntervalForRequest(value foundation.NSTimeInterval)
func (CKOperationConfiguration) SetTimeoutIntervalForResource ¶
func (c CKOperationConfiguration) SetTimeoutIntervalForResource(value foundation.NSTimeInterval)
func (CKOperationConfiguration) TimeoutIntervalForRequest ¶
func (c CKOperationConfiguration) TimeoutIntervalForRequest() foundation.NSTimeInterval
The maximum amount of time that a request can take.
func (CKOperationConfiguration) TimeoutIntervalForResource ¶
func (c CKOperationConfiguration) TimeoutIntervalForResource() foundation.NSTimeInterval
The maximum amount of time that a resource request can take.
type CKOperationConfigurationClass ¶
type CKOperationConfigurationClass struct {
// contains filtered or unexported fields
}
func GetCKOperationConfigurationClass ¶
func GetCKOperationConfigurationClass() CKOperationConfigurationClass
GetCKOperationConfigurationClass returns the class object for CKOperationConfiguration.
func (CKOperationConfigurationClass) Alloc ¶
func (cc CKOperationConfigurationClass) Alloc() CKOperationConfiguration
Alloc allocates memory for a new instance of the class.
func (CKOperationConfigurationClass) Class ¶
func (cc CKOperationConfigurationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKOperationGroup ¶
type CKOperationGroup struct {
objectivec.Object
}
An explicit association between two or more operations.
Overview ¶
In certain situations, you might want to perform several CloudKit operations together. Grouping operations in CloudKit doesn’t ensure atomicity.
For example, when building a Calendar app, you group the following actions:
- Fetch records from CloudKit, which consists of numerous queries that fetch both new records and records with changes. - Perform incremental fetches of records in response to a push notification. - Update several records when the user saves a calendar event.
Associate operation groups with operations by setting their CKOperation.Group property. Create a new operation group for each distinct user interaction.
Creating an Operation Group ¶
- CKOperationGroup.InitWithCoder: Creates an operation group from a serialized instance.
Configuring an Operation Group ¶
- CKOperationGroup.DefaultConfiguration: The default configuration for operations in the group.
- CKOperationGroup.SetDefaultConfiguration
- CKOperationGroup.ExpectedReceiveSize: The estimated size of traffic to download from CloudKit.
- CKOperationGroup.SetExpectedReceiveSize
- CKOperationGroup.ExpectedSendSize: The estimated size of traffic to upload to CloudKit.
- CKOperationGroup.SetExpectedSendSize
- CKOperationGroup.Name: The operation group’s name.
- CKOperationGroup.SetName
- CKOperationGroup.OperationGroupID: The operation group’s unique identifier.
- CKOperationGroup.Quantity: The number of operations in the operation group.
- CKOperationGroup.SetQuantity
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup
func CKOperationGroupFromID ¶
func CKOperationGroupFromID(id objc.ID) CKOperationGroup
CKOperationGroupFromID constructs a CKOperationGroup from an objc.ID.
An explicit association between two or more operations.
func NewCKOperationGroup ¶
func NewCKOperationGroup() CKOperationGroup
NewCKOperationGroup creates a new CKOperationGroup instance.
func NewCKOperationGroupWithCoder ¶
func NewCKOperationGroupWithCoder(aDecoder foundation.INSCoder) CKOperationGroup
Creates an operation group from a serialized instance.
aDecoder: The coder to use when deserializing the group.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/init(coder:)
func (CKOperationGroup) Autorelease ¶
func (c CKOperationGroup) Autorelease() CKOperationGroup
Autorelease adds the receiver to the current autorelease pool.
func (CKOperationGroup) DefaultConfiguration ¶
func (c CKOperationGroup) DefaultConfiguration() ICKOperationConfiguration
The default configuration for operations in the group.
Discussion ¶
If an operation in the group has its own configuration, that configuration’s values override the default configuration’s values. For more information, see CKOperationConfiguration.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/defaultConfiguration
func (CKOperationGroup) EncodeWithCoder ¶
func (c CKOperationGroup) EncodeWithCoder(coder foundation.INSCoder)
func (CKOperationGroup) ExpectedReceiveSize ¶
func (c CKOperationGroup) ExpectedReceiveSize() CKOperationGroupTransferSize
The estimated size of traffic to download from CloudKit.
Discussion ¶
This property informs the system about the amount of data your app can transfer. An order-of-magnitude estimate is better than no estimate, and accuracy helps performance. The system checks this value when it schedules discretionary network requests.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/expectedReceiveSize
func (CKOperationGroup) ExpectedSendSize ¶
func (c CKOperationGroup) ExpectedSendSize() CKOperationGroupTransferSize
The estimated size of traffic to upload to CloudKit.
Discussion ¶
This property informs the system about the amount of data your app can transfer. An order-of-magnitude estimate is better than no estimate, and accuracy helps performance. The system checks this value when it schedules discretionary network requests.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/expectedSendSize
func (CKOperationGroup) Init ¶
func (c CKOperationGroup) Init() CKOperationGroup
Init initializes the instance.
func (CKOperationGroup) InitWithCoder ¶
func (c CKOperationGroup) InitWithCoder(aDecoder foundation.INSCoder) CKOperationGroup
Creates an operation group from a serialized instance.
aDecoder: The coder to use when deserializing the group.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/init(coder:)
func (CKOperationGroup) Name ¶
func (c CKOperationGroup) Name() string
The operation group’s name.
Discussion ¶
The system sends the name of the operation group to CloudKit to provide aggregate reporting for CKOperationGroup. The name must not include any personal data.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/name
func (CKOperationGroup) OperationGroupID ¶
func (c CKOperationGroup) OperationGroupID() string
The operation group’s unique identifier.
Discussion ¶
The framework generates this value and it’s unique to this operation group. The system sends this identifier to CloudKit, which can use it to identify server-side logs for CKOperationGroup.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/operationGroupID
func (CKOperationGroup) Quantity ¶
func (c CKOperationGroup) Quantity() uint
The number of operations in the operation group.
Discussion ¶
This property shows the number of operations that you expect to be in this operation group. It’s the developer’s responsibility to set this value.
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/quantity
func (CKOperationGroup) SetDefaultConfiguration ¶
func (c CKOperationGroup) SetDefaultConfiguration(value ICKOperationConfiguration)
func (CKOperationGroup) SetExpectedReceiveSize ¶
func (c CKOperationGroup) SetExpectedReceiveSize(value CKOperationGroupTransferSize)
func (CKOperationGroup) SetExpectedSendSize ¶
func (c CKOperationGroup) SetExpectedSendSize(value CKOperationGroupTransferSize)
func (CKOperationGroup) SetName ¶
func (c CKOperationGroup) SetName(value string)
func (CKOperationGroup) SetQuantity ¶
func (c CKOperationGroup) SetQuantity(value uint)
type CKOperationGroupClass ¶
type CKOperationGroupClass struct {
// contains filtered or unexported fields
}
func GetCKOperationGroupClass ¶
func GetCKOperationGroupClass() CKOperationGroupClass
GetCKOperationGroupClass returns the class object for CKOperationGroup.
func (CKOperationGroupClass) Alloc ¶
func (cc CKOperationGroupClass) Alloc() CKOperationGroup
Alloc allocates memory for a new instance of the class.
func (CKOperationGroupClass) Class ¶
func (cc CKOperationGroupClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKOperationGroupTransferSize ¶
type CKOperationGroupTransferSize int
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup/TransferSize
const ( // CKOperationGroupTransferSizeGigabytes: A transfer size that represents 1 or more gigabytes. CKOperationGroupTransferSizeGigabytes CKOperationGroupTransferSize = 5 // CKOperationGroupTransferSizeHundredsOfGigabytes: A transfer size that represents hundreds of gigabytes. CKOperationGroupTransferSizeHundredsOfGigabytes CKOperationGroupTransferSize = 7 // CKOperationGroupTransferSizeHundredsOfMegabytes: A transfer size that represents hundreds of megabytes. CKOperationGroupTransferSizeHundredsOfMegabytes CKOperationGroupTransferSize = 4 // CKOperationGroupTransferSizeKilobytes: A transfer size that represents 1 or more kilobytes. CKOperationGroupTransferSizeKilobytes CKOperationGroupTransferSize = 1 // CKOperationGroupTransferSizeMegabytes: A transfer size that represents 1 or more megabytes. CKOperationGroupTransferSizeMegabytes CKOperationGroupTransferSize = 2 // CKOperationGroupTransferSizeTensOfGigabytes: A transfer size that represents tens of gigabytes. CKOperationGroupTransferSizeTensOfGigabytes CKOperationGroupTransferSize = 6 // CKOperationGroupTransferSizeTensOfMegabytes: A transfer size that represents tens of megabytes. CKOperationGroupTransferSizeTensOfMegabytes CKOperationGroupTransferSize = 3 // CKOperationGroupTransferSizeUnknown: An unknown transfer size. CKOperationGroupTransferSizeUnknown CKOperationGroupTransferSize = 0 )
func (CKOperationGroupTransferSize) String ¶
func (e CKOperationGroupTransferSize) String() string
type CKOperationID ¶
type CKOperationID = string
CKOperationID is a type that represents the ID of an operation.
See: https://developer.apple.com/documentation/CloudKit/CKOperationID
type CKQuery ¶
type CKQuery struct {
objectivec.Object
}
A query that describes the criteria to apply when searching for records in a database.
Overview ¶
You create a query as the first step in the search process. The query stores the search parameters, including the type of records to search, the match criteria (predicate) to apply, and the sort parameters to apply to the results. Then you use the query to initialize an instance of CKQueryOperation, which you execute to generate the results.
Always designate a record type and predicate when you create a query object. The record type narrows the scope of the search to one type of record, and the predicate defines the conditions for matching records of that type. Predicates usually compare one or more fields of a record to constant values, but you can create predicates that return all records of a specific type or perform more nuanced searches.
Because you can’t change the record type and predicate after initialization, you can use the same query to initialize multiple instances of CKQueryOperation, each of which targets a different database or record zone.
Building Your Predicates ¶
An NSPredicate object defines the logical conditions for determining whether a record is a match for a query. Queries support only a subset of the predicate behaviors that the NSPredicate class offers.
Predicate Rules for Query Objects ¶
The predicates you create for your query objects must follow these rules:
- Predicates derive from a format string. You can’t use value or block-based predicates. - Predicates use only the operators in CKQuery. - Predicates operate only on fields that contain the following types of data: - - NSString - NSData - NSDate - NSNumber - NSArray - CKReference - CLLocation - Key names in predicates correspond to fields in the currently evaluated record. Key names can include the names of the record’s metadata properties, such as `creationDate`, or any data fields you add to the record. You can’t use key paths to specify fields in related records. - Predicates support the following variable substitution strings: - - Use `%@` for value objects, such as strings, numbers, and dates. - Use `%K` for the name of a field. This substitution variable indicates that the system uses the substitution string to look up a field name. - With one exception, the [CONTAINS] operator is only for testing list membership. The exception is when you use it to perform full-text searches in conjunction with the `self` key path. The `self` key path causes the server to look in searchable string-based fields for the specified token string. For example, a predicate string of `@"self contains 'blue'"` searches for the word in all fields that you mark for inclusion in full-text searches. You can’t use the `self` key path to search in fields with a type that isn’t a string. - You can combine the [ANY] and [SOME] aggregate operators with the [IN] and [CONTAINS] operators to perform list membership tests. - The “ operator function performs a radius-based location comparison and that comparison must determine whether the location value is inside the circular area you provide. You can’t use it to search for locations outside the specified circular area. Location indexes have a resolution of no less than 10 km. - CloudKit doesn’t support the [ALL] aggregate operator. - CloudKit doesn’t support the [NOT] compound operator in the following cases: - - You can’t use it to negate an [AND] compound predicate. - You can’t use it in tokenized queries, such as `self CONTAINS 'value'`. - You can’t use it with the “ function. - You can’t use it in [BETWEEN] queries.
Supported Predicate Operators ¶
The following table lists the operators you can use in predicates for a query.
[Table data omitted]
Specifying an unsupported operator or data type in your query’s predicate results in an error when you execute the query. For more information about creating predicate objects, see Predicate Programming Guide.
Sample Predicate Format Strings ¶
To match records that link to a different record with an ID you know, create a predicate that matches a field that contains a reference as Listing 1 shows. In the example, the `employee` field of the record contains a CKReference object that points to another record. When CloudKit executes the query, a match occurs when the ID in the locally-created CKReference object is the same ID as in the specified field of the record.
Listing 1. Matching the ID of a record
To match the contents of a field to a specific value, use a predicate similar to the ones in Listing 2. All of the listed predicates generate the same set of results, which in the example means that the `favoriteColors` field contains the value . The value in the field must match the value you specify in the predicate exactly. String-based comparisons are case-insensitive, but otherwise, all comparisons must be an exact match of the specified value.
Listing 2. Matching a field to a specific value
You can match more than one value at a time by using a predicate similar to the ones in Listing 3. In the example, the predicates report a match if the value in the `favoriteColor` field of a record matches either of the values `red` or `green`.
Listing 3. Matching a field to one or more values
For fields that contain string values, you can match the beginning portion of the string using the [BEGINSWITH] operator as Listing 4 shows. You can’t use other string comparison operators, such as [CONTAINS] or [ENDSWITH]. When using this operator, the field must contain a string value and must start with the string you specify. Matches are case-sensitive. In the examples, the predicate matches records where the `favoriteColors` field contains the strings , , or ` “ “ `.
Listing 4. Matching a field that starts with a string value
To perform a tokenized search of a record’s fields, use the special operator `self`. A tokenized search searches any fields where you enable full-text search, which is all string-based fields by default. CloudKit treats each distinct word in the tokenized string as a separate token for the purpose of searching. Comparisons are case- and diacritic-insensitive. These token strings can be in a single field or in multiple fields.
Listing 5 shows an example that searches the fields of a record for the token strings `bob` or `smith`:
Listing 5. Matching a field that contains one or more tokens
To search for multiple tokens present in the fields, use the [AND] predicate operator, as Listing 6 shows.
Listing 6. Matching a field that contains multiple tokens
To test whether two locations are near each other, create a predicate using the “ function as Listing 7 shows. Predicates that use this function must have the structure in the listing. In your code, replace the `location` variable with a field name from one of your records. This data type for the field must be a CLLocation object. Similarly, replace the `fixedLoc` and `radius` values with appropriate values from your app. The `fixedLoc` value is the geographic coordinate that marks the center of a circle with the specified radius. In this example, the predicate returns a match if the location in the record is within 10 kilometers of the specified latitude and longitude.
Listing 7. Matching by distance from a location
To retrieve all records of a specific type, use the [TRUEPREDICATE] expression as Listing 8 shows. A predicate with this operator always evaluates to `true` and, therefore, matches every record. When using such an operator, use a cursor to batch the results into smaller groups for processing.
Listing 8. Retrieving all records of a specific type
Indexes and Full-Text Search ¶
Indexes make it possible to search the contents of your records efficiently. During development, the server indexes all fields with data types it can use in the predicate of a query. This automatic indexing makes it easier to experiment with queries during development, but the indexes require space in a database, and require time to generate and maintain. So when migrating to a production environment, remove the indexes for any fields that you don’t use in queries.
Full-text search is another feature that is on by default for all fields during development. When you move to the production environment, disable full-text search for fields with content you don’t need to search. As with removing indexes, disabling full-text search improves the performance of your tokenized searches. To configure the indexing and full-text search options for fields in your schema, use CloudKit Dashboard.
In a full-text search, CloudKit ignores the following words if they appear in the token strings:
[Table data omitted]
Executing a Search Using Your Query Object ¶
To execute a query, do one of the following:
- Create an instance of CKQueryOperation using your query. Run the operation directly or add it to an operation queue to perform the query and deliver the results. - Call the perform(_:inZoneWith:completionHandler:) method of CKDatabase to execute the query. Process the results in your completion handler.
Queries always run asynchronously and deliver results to a completion handler that you provide.
Creating a Query ¶
- CKQuery.InitWithCoder: Creates an operation group from a serialized instance.
Accessing the Query Parameters ¶
- CKQuery.RecordType: The record type to search.
- CKQuery.SetRecordType
- CKQuery.Predicate: The predicate to use for matching records.
- CKQuery.SortDescriptors: The sort descriptors for organizing the query’s results.
- CKQuery.SetSortDescriptors
See: https://developer.apple.com/documentation/CloudKit/CKQuery
func CKQueryFromID ¶
CKQueryFromID constructs a CKQuery from an objc.ID.
A query that describes the criteria to apply when searching for records in a database.
func NewCKQueryWithCoder ¶
func NewCKQueryWithCoder(aDecoder foundation.INSCoder) CKQuery
Creates an operation group from a serialized instance.
aDecoder: The coder to use when deserializing the group.
See: https://developer.apple.com/documentation/CloudKit/CKQuery/init(coder:)
func (CKQuery) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (CKQuery) EncodeWithCoder ¶
func (c CKQuery) EncodeWithCoder(coder foundation.INSCoder)
func (CKQuery) InitWithCoder ¶
func (c CKQuery) InitWithCoder(aDecoder foundation.INSCoder) CKQuery
Creates an operation group from a serialized instance.
aDecoder: The coder to use when deserializing the group.
See: https://developer.apple.com/documentation/CloudKit/CKQuery/init(coder:)
func (CKQuery) Predicate ¶
func (c CKQuery) Predicate() foundation.NSPredicate
The predicate to use for matching records.
Discussion ¶
A predicate contains one or more expressions that evaluate to true or false. Expressions are often value-based comparisons, but predicates support other types of operators, including string comparisons and aggregate operations. For guidelines on how to construct predicates for your queries, see CKQuery.
See: https://developer.apple.com/documentation/CloudKit/CKQuery/predicate
func (CKQuery) RecordType ¶
The record type to search.
See: https://developer.apple.com/documentation/cloudkit/ckquery/recordtype-6ajii
func (CKQuery) SetRecordType ¶
func (CKQuery) SetSortDescriptors ¶
func (c CKQuery) SetSortDescriptors(value []foundation.NSSortDescriptor)
func (CKQuery) SortDescriptors ¶
func (c CKQuery) SortDescriptors() []foundation.NSSortDescriptor
The sort descriptors for organizing the query’s results.
Discussion ¶
You can add sort descriptors to a query and change them later as necessary. Each sort descriptor contains a field name of the intended record type and information about whether to sort values in that field in ascending or descending order. The default value of this property is `nil`, which means that records return in an indeterminate order.
The order of the items in the array defines the order that CloudKit applies the sort descriptors to the results. In other words, CloudKit applies the first sort descriptor in the array, then the second sort descriptor, if necessary, then the third, and so on.
See: https://developer.apple.com/documentation/CloudKit/CKQuery/sortDescriptors
type CKQueryClass ¶
type CKQueryClass struct {
// contains filtered or unexported fields
}
func GetCKQueryClass ¶
func GetCKQueryClass() CKQueryClass
GetCKQueryClass returns the class object for CKQuery.
func (CKQueryClass) Alloc ¶
func (cc CKQueryClass) Alloc() CKQuery
Alloc allocates memory for a new instance of the class.
func (CKQueryClass) Class ¶
func (cc CKQueryClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKQueryCursor ¶
type CKQueryCursor struct {
objectivec.Object
}
An object that marks the stopping point for a query and the starting point for retrieving the remaining results.
Overview ¶
You don’t create instances of this class yourself. When fetching records using a query operation, if the number of results exceeds the limit for the query, CloudKit provides a cursor. Use that cursor to create a new instance of CKQueryOperation and retrieve the next batch of results for the same query.
For information about how to use a CKQueryCursor object, see CKQueryOperation.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/Cursor-swift.class
func CKQueryCursorFromID ¶
func CKQueryCursorFromID(id objc.ID) CKQueryCursor
CKQueryCursorFromID constructs a CKQueryCursor from an objc.ID.
An object that marks the stopping point for a query and the starting point for retrieving the remaining results.
func NewCKQueryCursor ¶
func NewCKQueryCursor() CKQueryCursor
NewCKQueryCursor creates a new CKQueryCursor instance.
func (CKQueryCursor) Autorelease ¶
func (c CKQueryCursor) Autorelease() CKQueryCursor
Autorelease adds the receiver to the current autorelease pool.
func (CKQueryCursor) EncodeWithCoder ¶
func (c CKQueryCursor) EncodeWithCoder(coder foundation.INSCoder)
func (CKQueryCursor) Init ¶
func (c CKQueryCursor) Init() CKQueryCursor
Init initializes the instance.
type CKQueryCursorClass ¶
type CKQueryCursorClass struct {
// contains filtered or unexported fields
}
func GetCKQueryCursorClass ¶
func GetCKQueryCursorClass() CKQueryCursorClass
GetCKQueryCursorClass returns the class object for CKQueryCursor.
func (CKQueryCursorClass) Alloc ¶
func (cc CKQueryCursorClass) Alloc() CKQueryCursor
Alloc allocates memory for a new instance of the class.
func (CKQueryCursorClass) Class ¶
func (cc CKQueryCursorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKQueryNotification ¶
type CKQueryNotification struct {
CKNotification
}
A notification that triggers when a record that matches the subscription’s predicate changes.
Overview ¶
Query subscriptions execute when a record that matches the subscription’s predicate changes, for example, when the user modifies a field’s value in the record. When CloudKit registers the change, it sends push notifications to the user’s devices to inform your app about the change. You can then fetch the changes and cache them on-device. When appropriate, CloudKit excludes the device where the change originates.
You configure a subscription’s notifications by setting it’s CKSubscription.NotificationInfo property. Do this before you save it to the server. A subscription generates either high-priority or medium-priority push notifications. CloudKit delivers medium-priority notifications to your app in the background. High-priority notifications are visual and the system displays them to the user. Visual notifications need the user’s permission. For more information, see Asking permission to use notifications.
A subscription uses CKNotificationInfo to configure its notifications. For background delivery, set only its CKNotificationInfo.ShouldSendContentAvailable property to true. If you set any other property, CloudKit treats the notification as high-priority.
Don’t rely on push notifications for changes because the system can coalesce them. CloudKit can omit data to keep the notification’s payload size under the APNs size limit. If you use CKSubscription.DesiredKeys to include extra data in the payload, the server removes that first. A notification’s CKNotification.IsPruned property is true if CloudKit omits data.
Consider notifications an indication of remote changes. Use CKDatabaseNotification.DatabaseScope to determine which database contains the changed record. To fetch the changes, configure an instance of CKQueryOperation to match the subscription and then execute it in the database. CloudKit returns all records that match the predicate, including the changed record. Dispose of any records you cache on-device and use the operation’s results instead.
You don’t instantiate this class. Instead, implement application(_:didReceiveRemoteNotification:fetchCompletionHandler:) in your app delegate. Initialize CKNotification with the `userInfo` dictionary that CloudKit passes to the method. This returns an instance of the appropriate subclass. Use the CKNotification.NotificationType property to determine the type. Then cast to that type to access type-specific properties and methods.
Getting the Database Scope ¶
- CKQueryNotification.DatabaseScope: The type of database for the record zone.
Getting the Notification Attributes ¶
- CKQueryNotification.QueryNotificationReason: The event that triggers the push notification.
Getting the Record Information ¶
- CKQueryNotification.RecordID: The ID of the record that CloudKit creates, updates, or deletes.
- CKQueryNotification.RecordFields: A dictionary of fields that have changes.
See: https://developer.apple.com/documentation/CloudKit/CKQueryNotification
func CKQueryNotificationFromID ¶
func CKQueryNotificationFromID(id objc.ID) CKQueryNotification
CKQueryNotificationFromID constructs a CKQueryNotification from an objc.ID.
A notification that triggers when a record that matches the subscription’s predicate changes.
func NewCKQueryNotification ¶
func NewCKQueryNotification() CKQueryNotification
NewCKQueryNotification creates a new CKQueryNotification instance.
func NewCKQueryNotificationFromRemoteNotificationDictionary ¶
func NewCKQueryNotificationFromRemoteNotificationDictionary(notificationDictionary foundation.INSDictionary) CKQueryNotification
Creates a new notification using the specified payload data.
notificationDictionary: The push notification’s payload data. Use the dictionary that the system provides to your app delegate’s application(_:didReceiveRemoteNotification:fetchCompletionHandler:) method. This parameter must not be `nil`.
func (CKQueryNotification) Autorelease ¶
func (c CKQueryNotification) Autorelease() CKQueryNotification
Autorelease adds the receiver to the current autorelease pool.
func (CKQueryNotification) DatabaseScope ¶
func (c CKQueryNotification) DatabaseScope() CKDatabaseScope
The type of database for the record zone.
Discussion ¶
This property’s value is one of the constants that CKDatabase.Scope defines.
See: https://developer.apple.com/documentation/CloudKit/CKQueryNotification/databaseScope
func (CKQueryNotification) Init ¶
func (c CKQueryNotification) Init() CKQueryNotification
Init initializes the instance.
func (CKQueryNotification) QueryNotificationReason ¶
func (c CKQueryNotification) QueryNotificationReason() CKQueryNotificationReason
The event that triggers the push notification.
Discussion ¶
Subscription notifications result from the creation, deletion, or updating of a single record. The record in question must match the subscription’s predicate for an event to trigger.
See: https://developer.apple.com/documentation/CloudKit/CKQueryNotification/queryNotificationReason
func (CKQueryNotification) RecordFields ¶
func (c CKQueryNotification) RecordFields() foundation.INSDictionary
A dictionary of fields that have changes.
Discussion ¶
For updated and created records, this property contains the subscription’s desired keys. When you configure the notification info of a subscription, you specify the names of one or more fields in the CKSubscription.DesiredKeys property. When a push notification triggers, CloudKit retrieves the values for each of those keys from the record and includes them in the notification’s payload.
For query notifications that you fetch from a container, all keys and values are present. For query notifications that you create from push notifications, one or more keys and values may be missing. Push notification payloads have a size limit, and CloudKit can exclude record fields when a payload exceeds that limit. For information about the order, see the overview of this class.
See: https://developer.apple.com/documentation/CloudKit/CKQueryNotification/recordFields
func (CKQueryNotification) RecordID ¶
func (c CKQueryNotification) RecordID() ICKRecordID
The ID of the record that CloudKit creates, updates, or deletes.
Discussion ¶
Use this value to fetch the record.
See: https://developer.apple.com/documentation/CloudKit/CKQueryNotification/recordID
type CKQueryNotificationClass ¶
type CKQueryNotificationClass struct {
// contains filtered or unexported fields
}
func GetCKQueryNotificationClass ¶
func GetCKQueryNotificationClass() CKQueryNotificationClass
GetCKQueryNotificationClass returns the class object for CKQueryNotification.
func (CKQueryNotificationClass) Alloc ¶
func (cc CKQueryNotificationClass) Alloc() CKQueryNotification
Alloc allocates memory for a new instance of the class.
func (CKQueryNotificationClass) Class ¶
func (cc CKQueryNotificationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKQueryNotificationReason ¶
type CKQueryNotificationReason int
See: https://developer.apple.com/documentation/CloudKit/CKQueryNotification/Reason
const ( // CKQueryNotificationReasonRecordCreated: A notification that indicates the creation of a record matching the subscription’s predicate. CKQueryNotificationReasonRecordCreated CKQueryNotificationReason = 1 // CKQueryNotificationReasonRecordDeleted: A notification that indicates the deletion of a record matching the subscription’s predicate. CKQueryNotificationReasonRecordDeleted CKQueryNotificationReason = 3 // CKQueryNotificationReasonRecordUpdated: A notification that indicates the update of a record matching the subscription’s predicate. CKQueryNotificationReasonRecordUpdated CKQueryNotificationReason = 2 )
func (CKQueryNotificationReason) String ¶
func (e CKQueryNotificationReason) String() string
type CKQueryOperation ¶
type CKQueryOperation struct {
CKDatabaseOperation
}
An operation for executing queries in a database.
Overview ¶
A CKQueryOperation object is a concrete operation that you can use to execute queries. A query operation applies query parameters to the specified database and record zone, delivering any matching records asynchronously to the handlers that you provide.
To perform a new search:
- Initialize a CKQueryOperation object with a CKQuery object that contains the search criteria and sorting information for the records you want. - Assign a handler to the queryCompletionBlock property so that you can process the results and execute the operation.
If the search yields many records, the operation object may deliver a portion of the total results to your blocks immediately, along with a cursor for obtaining the remaining records. Use the cursor to initialize and execute a separate CKQueryOperation instance when you’re ready to process the next batch of results. 3. Optionally, configure the results by specifying values for the CKQueryOperation.ResultsLimit and desiredKeys properties. 4. Pass the query operation object to the CKDatabase.AddOperation method of the target database to execute the operation.
CloudKit restricts queries to the records in a single record zone. For new queries, you specify the zone when you initialize the query operation object. For cursor-based queries, the cursor contains the zone information. To search for records in multiple zones, you must create a separate CKQueryOperation object for each zone you want to search, although you can initialize each of them with the same CKQuery object.
If you assign a handler to the operation’s completionBlock property, the operation calls it after it executes and returns any results. Use a handler to perform housekeeping tasks for the operation, but don’t use it to process the results of the operation. The handler you provide should manage any failures, whether due to an error or an explicit cancellation.
Creating a Query Operation ¶
- CKQueryOperation.InitWithQuery: Creates an operation that searches for records in the specified record zone.
- CKQueryOperation.InitWithCursor: Creates an operation with additional results from a previous search.
Configuring the Query Operation ¶
- CKQueryOperation.Query: The query for the search.
- CKQueryOperation.SetQuery
- CKQueryOperation.Cursor: The cursor for continuing the search.
- CKQueryOperation.SetCursor
- CKQueryOperation.ZoneID: The ID of the record zone that contains the records to search.
- CKQueryOperation.SetZoneID
- CKQueryOperation.ResultsLimit: The maximum number of records to return at one time.
- CKQueryOperation.SetResultsLimit
- CKQueryOperation.DesiredKeys: The fields of the records to fetch.
- CKQueryOperation.SetDesiredKeys
Instance Properties ¶
- CKQueryOperation.RecordMatchedBlock: The closure to execute when a record match is available.
- CKQueryOperation.SetRecordMatchedBlock
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation
func CKQueryOperationFromID ¶
func CKQueryOperationFromID(id objc.ID) CKQueryOperation
CKQueryOperationFromID constructs a CKQueryOperation from an objc.ID.
An operation for executing queries in a database.
func NewCKQueryOperation ¶
func NewCKQueryOperation() CKQueryOperation
NewCKQueryOperation creates a new CKQueryOperation instance.
func NewCKQueryOperationWithCursor ¶
func NewCKQueryOperationWithCursor(cursor ICKQueryCursor) CKQueryOperation
Creates an operation with additional results from a previous search.
cursor: The cursor that identifies the previous search. CloudKit passes this value to the completion handler of the previous search. For more information, see the queryCompletionBlock property.
Discussion ¶
Use this method to create an operation that retrieves the next batch of results from a previous search. When executing searches for a cursor, don’t cache cursors for a long time before using them. A cursor isn’t a snapshot of the previous search results; it stores a relative offset into the results list. An operation that you create from a cursor performs a new search, sorts the new set of results, and uses the previous offset value to determine where the next batch of results starts.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/init(cursor:)
func NewCKQueryOperationWithQuery ¶
func NewCKQueryOperationWithQuery(query ICKQuery) CKQueryOperation
Creates an operation that searches for records in the specified record zone.
query: The query for the search.
Discussion ¶
You can use the operation that this method returns only once to perform a search, but you can reuse the query that you provide. During execution, the operation performs a new search and returns the first batch of results. If there are more results available, you must create a separate query object using the provided cursor object.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/init(query:)
func (CKQueryOperation) Autorelease ¶
func (c CKQueryOperation) Autorelease() CKQueryOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKQueryOperation) Cursor ¶
func (c CKQueryOperation) Cursor() ICKQueryCursor
The cursor for continuing the search.
Discussion ¶
The initial value of this property is the cursor that you provide to the CKQueryOperation.InitWithCursor method. When you use a cursor, the operation ignores the contents of the CKQueryOperation.Query property. This property’s value is an opaque value that CloudKit provides. For more information, see the queryCompletionBlock property.
If you intend to specify or change the value in this property, do so before you execute the operation or submit it to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/cursor-swift.property
func (CKQueryOperation) DesiredKeys ¶
func (c CKQueryOperation) DesiredKeys() unsafe.Pointer
The fields of the records to fetch.
See: https://developer.apple.com/documentation/cloudkit/ckqueryoperation/desiredkeys-7qrse
func (CKQueryOperation) Init ¶
func (c CKQueryOperation) Init() CKQueryOperation
Init initializes the instance.
func (CKQueryOperation) InitWithCursor ¶
func (c CKQueryOperation) InitWithCursor(cursor ICKQueryCursor) CKQueryOperation
Creates an operation with additional results from a previous search.
cursor: The cursor that identifies the previous search. CloudKit passes this value to the completion handler of the previous search. For more information, see the queryCompletionBlock property.
Discussion ¶
Use this method to create an operation that retrieves the next batch of results from a previous search. When executing searches for a cursor, don’t cache cursors for a long time before using them. A cursor isn’t a snapshot of the previous search results; it stores a relative offset into the results list. An operation that you create from a cursor performs a new search, sorts the new set of results, and uses the previous offset value to determine where the next batch of results starts.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/init(cursor:)
func (CKQueryOperation) InitWithQuery ¶
func (c CKQueryOperation) InitWithQuery(query ICKQuery) CKQueryOperation
Creates an operation that searches for records in the specified record zone.
query: The query for the search.
Discussion ¶
You can use the operation that this method returns only once to perform a search, but you can reuse the query that you provide. During execution, the operation performs a new search and returns the first batch of results. If there are more results available, you must create a separate query object using the provided cursor object.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/init(query:)
func (CKQueryOperation) Query ¶
func (c CKQueryOperation) Query() ICKQuery
The query for the search.
Discussion ¶
The initial value of this property is the query that you provide to the CKQueryOperation.InitWithQuery method. When the value in the CKQueryOperation.Cursor property is `nil`, the operation uses this property’s value to execute a new search and return its results to your completion handler. If CKQueryOperation.Cursor isn’t `nil`, the operation uses the cursor instead.
If you intend to specify or change the value of this property, do so before you execute the operation or submit it to a queue.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/query
func (CKQueryOperation) RecordMatchedBlock ¶
func (c CKQueryOperation) RecordMatchedBlock() unsafe.Pointer
The closure to execute when a record match is available.
See: https://developer.apple.com/documentation/cloudkit/ckqueryoperation/recordmatchedblock-2qze7
func (CKQueryOperation) ResultsLimit ¶
func (c CKQueryOperation) ResultsLimit() uint
The maximum number of records to return at one time.
Discussion ¶
For most queries, leave the value of this property as the default value, which is the maximumResults constant. When using that value, CloudKit returns as many records as possible while minimizing delays in receiving those records. If you want to process a fixed number of results, change the value of this property accordingly.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/resultsLimit
func (CKQueryOperation) SetCursor ¶
func (c CKQueryOperation) SetCursor(value ICKQueryCursor)
func (CKQueryOperation) SetDesiredKeys ¶
func (c CKQueryOperation) SetDesiredKeys(value kernel.Pointer)
func (CKQueryOperation) SetQuery ¶
func (c CKQueryOperation) SetQuery(value ICKQuery)
func (CKQueryOperation) SetRecordMatchedBlock ¶
func (c CKQueryOperation) SetRecordMatchedBlock(value kernel.Pointer)
func (CKQueryOperation) SetResultsLimit ¶
func (c CKQueryOperation) SetResultsLimit(value uint)
func (CKQueryOperation) SetZoneID ¶
func (c CKQueryOperation) SetZoneID(value ICKRecordZoneID)
func (CKQueryOperation) ZoneID ¶
func (c CKQueryOperation) ZoneID() ICKRecordZoneID
The ID of the record zone that contains the records to search.
Discussion ¶
The value of this property limits the scope of the search to only the records in the specified record zone. If you don’t specify a record zone, the search includes all record zones.
When you create an operation using the CKQueryOperation.InitWithCursor method, this property’s value is `nil` and CloudKit ignores any changes that you make to it. When the operation executes, the cursor provides the record zone information from the original search that provides the cursor.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/zoneID
type CKQueryOperationClass ¶
type CKQueryOperationClass struct {
// contains filtered or unexported fields
}
func GetCKQueryOperationClass ¶
func GetCKQueryOperationClass() CKQueryOperationClass
GetCKQueryOperationClass returns the class object for CKQueryOperation.
func (CKQueryOperationClass) Alloc ¶
func (cc CKQueryOperationClass) Alloc() CKQueryOperation
Alloc allocates memory for a new instance of the class.
func (CKQueryOperationClass) Class ¶
func (cc CKQueryOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKQuerySubscription ¶
type CKQuerySubscription struct {
CKSubscription
}
A subscription that generates push notifications when CloudKit modifies records that match a predicate.
Overview ¶
Subscriptions track the creation, modification, and deletion of records in a database, and are fundamental in keeping data on the user’s device up to date. A subscription applies only to the user that creates it. When a subscription registers a change, such as CloudKit saving a new record, it sends push notifications to the user’s devices to inform your app about the change. You can then fetch the changes and cache them on-device. When appropriate, the server excludes the device where the change originates.
Query subscriptions execute whenever a change occurs in a database that matches the predicate and options you specify. You scope a query subscription to an individual record type that you provide during initialization. You can set the subscription’s CKQuerySubscription.ZoneID property to further specialize the subscription to a specific record zone in the database. This limits the scope of the subscription to only track changes in that record zone and reduces the number of notifications it generates. For more information about defining CloudKit-compatible predicates, see CKQuery.
Create any subscriptions on your app’s first launch. After you initialize a subscription, save it to the server using CKModifySubscriptionsOperation. When the operation completes, record that state on-device (in UserDefaults, for example). You can then check that state on subsequent launches to prevent unnecessary trips to the server.
To configure the notification the subscription generates, set the subscription’s CKSubscription.NotificationInfo property. Because the system coalesces notifications, don’t rely on them for specific changes. CloudKit can omit data to keep the payload size under the APNs size limit. Consider notifications an indication of remote changes and use CKQueryOperation to fetch the changed records. Create the operation with an instance of CKQuery that you configure with the same record type and predicate as the subscription. If you limit the subscription to a specific record zone, set the operation’s CKQueryOperation.ZoneID property to that record zone’s ID. Because CKQueryOperation doesn’t employ server change tokens, dispose of any records you cache on-device and use the query’s results instead.
The example below shows how to create a query subscription in the user’s private database, configure the notifications it generates — in this case, silent push notifications — and then save that subscription to the server:
Accessing the Subscription Search Parameters ¶
- CKQuerySubscription.Predicate: The matching criteria to apply to records.
- CKQuerySubscription.QuerySubscriptionOptions: Options that define the behavior of the subscription.
Accessing the Subscription Metadata ¶
- CKQuerySubscription.RecordType: The type of record that the subscription queries.
- CKQuerySubscription.SetRecordType
- CKQuerySubscription.ZoneID: The ID of the record zone that the subscription queries.
- CKQuerySubscription.SetZoneID
See: https://developer.apple.com/documentation/CloudKit/CKQuerySubscription
func CKQuerySubscriptionFromID ¶
func CKQuerySubscriptionFromID(id objc.ID) CKQuerySubscription
CKQuerySubscriptionFromID constructs a CKQuerySubscription from an objc.ID.
A subscription that generates push notifications when CloudKit modifies records that match a predicate.
func NewCKQuerySubscription ¶
func NewCKQuerySubscription() CKQuerySubscription
NewCKQuerySubscription creates a new CKQuerySubscription instance.
func NewCKQuerySubscriptionWithCoder ¶
func NewCKQuerySubscriptionWithCoder(aDecoder foundation.INSCoder) CKQuerySubscription
Creates a query-based subscription from a serialized instance.
aDecoder: The coder for decoding the serialized query subscription.
See: https://developer.apple.com/documentation/CloudKit/CKQuerySubscription/init(coder:)
func (CKQuerySubscription) Autorelease ¶
func (c CKQuerySubscription) Autorelease() CKQuerySubscription
Autorelease adds the receiver to the current autorelease pool.
func (CKQuerySubscription) Init ¶
func (c CKQuerySubscription) Init() CKQuerySubscription
Init initializes the instance.
func (CKQuerySubscription) Predicate ¶
func (c CKQuerySubscription) Predicate() foundation.NSPredicate
The matching criteria to apply to records.
Discussion ¶
A query-based subscription uses its search predicate to identify potential matches for records. It combines the predicate information with the value in the CKQuerySubscription.QuerySubscriptionOptions property to determine when to send a push notification to the app.
The search predicate defines the records that the subscription object monitors for changes. The system only uses the property’s value when the CKSubscription.SubscriptionType property is CKSubscription.SubscriptionType.query. Otherwise, the system ignores it.
See: https://developer.apple.com/documentation/CloudKit/CKQuerySubscription/predicate
func (CKQuerySubscription) QuerySubscriptionOptions ¶
func (c CKQuerySubscription) QuerySubscriptionOptions() CKQuerySubscriptionOptions
Options that define the behavior of the subscription.
Discussion ¶
Set the value of this property at initialization time. When you configure a query-based subscription, use one of the following values:
- CKQuerySubscriptionOptionsFiresOnRecordCreation - CKQuerySubscriptionOptionsFiresOnRecordUpdate - CKQuerySubscriptionOptionsFiresOnRecordDeletion
If you don’t set an option, the system throws an invalidArgumentException.
See: https://developer.apple.com/documentation/CloudKit/CKQuerySubscription/querySubscriptionOptions
func (CKQuerySubscription) RecordType ¶
func (c CKQuerySubscription) RecordType() unsafe.Pointer
The type of record that the subscription queries.
See: https://developer.apple.com/documentation/cloudkit/ckquerysubscription/recordtype-4qgdo
func (CKQuerySubscription) SetRecordType ¶
func (c CKQuerySubscription) SetRecordType(value kernel.Pointer)
func (CKQuerySubscription) SetZoneID ¶
func (c CKQuerySubscription) SetZoneID(value ICKRecordZoneID)
func (CKQuerySubscription) ZoneID ¶
func (c CKQuerySubscription) ZoneID() ICKRecordZoneID
The ID of the record zone that the subscription queries.
Discussion ¶
This property applies to query-based subscriptions and zone-based subscriptions. Specifying a record zone ID limits the scope of the query to only the records in that zone. For zone-based subscriptions, the query includes all records in the specified record zone. For a query-based subscription, the query includes only records of a specific type in the specified record zone.
For zone-based subscriptions, CloudKit sets this property’s value automatically. For all other subscription types, the default value is `nil`. If you want to scope your query-based subscription to a specific record zone, you must assign a value explicitly.
See: https://developer.apple.com/documentation/CloudKit/CKQuerySubscription/zoneID
type CKQuerySubscriptionClass ¶
type CKQuerySubscriptionClass struct {
// contains filtered or unexported fields
}
func GetCKQuerySubscriptionClass ¶
func GetCKQuerySubscriptionClass() CKQuerySubscriptionClass
GetCKQuerySubscriptionClass returns the class object for CKQuerySubscription.
func (CKQuerySubscriptionClass) Alloc ¶
func (cc CKQuerySubscriptionClass) Alloc() CKQuerySubscription
Alloc allocates memory for a new instance of the class.
func (CKQuerySubscriptionClass) Class ¶
func (cc CKQuerySubscriptionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKQuerySubscriptionOptions ¶
type CKQuerySubscriptionOptions uint
See: https://developer.apple.com/documentation/CloudKit/CKQuerySubscription/Options
const ( // CKQuerySubscriptionOptionsFiresOnRecordCreation: An option that instructs CloudKit to send a push notification when it creates a record that matches a subscription’s criteria. CKQuerySubscriptionOptionsFiresOnRecordCreation CKQuerySubscriptionOptions = 1 // CKQuerySubscriptionOptionsFiresOnRecordDeletion: An option that instructs CloudKit to send a push notification when it deletes a record that matches a subscription’s criteria. CKQuerySubscriptionOptionsFiresOnRecordDeletion CKQuerySubscriptionOptions = 4 // CKQuerySubscriptionOptionsFiresOnRecordUpdate: An option that instructs CloudKit to send a push notification when it modifies a record that matches a subscription’s criteria. CKQuerySubscriptionOptionsFiresOnRecordUpdate CKQuerySubscriptionOptions = 2 // CKQuerySubscriptionOptionsFiresOnce: An option that instructs CloudKit to send a push notification only once. CKQuerySubscriptionOptionsFiresOnce CKQuerySubscriptionOptions = 8 )
func (CKQuerySubscriptionOptions) String ¶
func (e CKQuerySubscriptionOptions) String() string
type CKRecord ¶
type CKRecord struct {
objectivec.Object
}
A collection of key-value pairs that store your app’s data.
Overview ¶
Records are the fundamental objects that manage data in CloudKit. You can define any number of record types for your app, with each record type corresponding to a different type of information. Within a record type, you then define one or more fields, each with a name and a value. Records can contain simple data types, such as strings and numbers, or more complex types, such as geographic locations or pointers to other records.
An important step in using CloudKit is defining the record types your app supports. A new record object doesn’t contain any keys or values. During development, you can add new keys and values at any time. The first time you set a value for a key and save the record, the server associates that type with the key for all records of the same type. The CKRecord class doesn’t impose these type constraints or do any local validation of a record’s contents. CloudKit enforces these constraints when you save the records.
Although records behave like dictionaries, there are limitations to the types of values you can assign to keys. The following are the object types that the CKRecord class supports. Attempting to specify objects of any other type results in failure. Fields of all types are searchable unless otherwise noted.
Supported Data Types ¶
CKRecord fields support the following data types:
NSString: Stores relatively small amounts of text. Although strings themselves can be any length, use a CKAsset to store large amounts of text. NSNumber: Stores any numerical information, including integers and floating-point numbers. NSData: Stores arbitrary bytes of data. A typical use for data objects is to map the bytes that they contain to a `struct`. Don’t use data objects for storing large binary data files; use a CKAsset instead. Data fields aren’t searchable. NSDate: Stores day and time information in an accessible form. NSArray: Stores one or more objects of any other type in this table. You can store arrays of strings, arrays of numbers, arrays of references, and so on. CLLocation: Stores geographic coordinate data. You use locations in conjunction with the Core Location framework and any other services that handle location information. CKAsset: Associates a disk-based file with the record. Although assets have a close association with records, you manage them separately. For more information about using assets, see CKAsset. CKReference: Creates a link to a related record. A reference stores the ID of the target record. The advantage of using a reference instead of storing the ID as a string is that references can initiate cascade deletions of dependent records. The disadvantage is that references can only link between records in the same record zone. For more information, see CKReference.
Defining Records ¶
The process for defining your record types depends entirely on your app and the data you’re trying to represent. It’s best to design records that encapsulate data for one unit of information. For example, you might use one record type to store an employee’s name, job title, and date of hire, and use a separate record type to store the employee’s address information. Using different record types lets you manage, manipulate, and validate the two types of information separately.
Use fields that contain CKReference objects to establish relationships between different types of records. After you define your record types, use the iCloud Dashboard to set them up. During development, you can also create new record types programmatically.
Indexing the Fields of a Record ¶
Indexes make it possible to search the contents of your records efficiently. During development, the server indexes all fields with data types it can use in the predicate of a query. This automatic indexing makes it easier to experiment with queries during development, but the indexes require space in a database, and require time to generate and maintain.
To manage the indexing behavior of your records in the production environment, use CloudKit Dashboard. When migrating your schema from the development environment to the production environment, enable indexing only for the fields that your app uses in queries, and disable it for all other fields.
Customizing Records ¶
Use this class as-is to manage data coming from or going to the server, and don’t subclass it.
Storing Records Locally ¶
If you store records in a local database, use the CKRecord.EncodeSystemFieldsWithCoder method to encode and store the record’s metadata. The metadata contains the record ID and the change tag, which you need later to sync records in a local database with those in CloudKit.
Accessing the Record’s Metadata ¶
- CKRecord.RecordID: The unique ID of the record.
- CKRecord.RecordType: The value that your app defines to identify the type of record.
- CKRecord.SetRecordType
- CKRecord.CreationDate: The time when CloudKit first saves the record to the server.
- CKRecord.CreatorUserRecordID: The ID of the user who creates the record.
- CKRecord.ModificationDate: The most recent time that CloudKit saved the record to the server.
- CKRecord.LastModifiedUserRecordID: The ID of the user who most recently modified the record.
- CKRecord.RecordChangeTag: The server change token for the record.
Encrypting the Record’s Values ¶
- CKRecord.EncryptedValues: An object that manages the record’s encrypted key-value pairs.
Getting Data for Full-Text Searches ¶
- CKRecord.AllTokens: Returns an array of strings to use for full-text searches of the field’s string-based values.
Encoding the Record’s Metadata ¶
- CKRecord.EncodeSystemFieldsWithCoder: Encodes the record’s system fields using the specified archiver.
Sharing Records ¶
- CKRecord.Parent: A reference to the record’s parent record.
- CKRecord.SetParent
- CKRecord.Share: A reference to the share object that determines the share status of the record.
- CKRecord.SetParentReferenceFromRecord: Creates and sets a reference object for a parent from its record.
- CKRecord.SetParentReferenceFromRecordID: Creates and sets a reference object for a parent from the parent’s record ID.
Initializers ¶
See: https://developer.apple.com/documentation/CloudKit/CKRecord
func CKRecordFromID ¶
CKRecordFromID constructs a CKRecord from an objc.ID.
A collection of key-value pairs that store your app’s data.
func NewCKRecordWithCoder ¶ added in v0.6.10
func NewCKRecordWithCoder(coder foundation.INSCoder) CKRecord
See: https://developer.apple.com/documentation/CloudKit/CKRecord/init(coder:)
func (CKRecord) AllKeys ¶
Returns an array of the record’s keys.
Return Value ¶
An array of keys, or an empty array if the record doesn’t contain any keys.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/allKeys()
func (CKRecord) AllTokens ¶
Returns an array of strings to use for full-text searches of the field’s string-based values.
Return Value ¶
An array of strings that contains data from the record’s string-based fields.
Discussion ¶
When performing your own full-text searches, you can use this method to get a list of strings for your search. The method acts only on keys with string values. It breaks each value string apart at whitespace boundaries, creates new strings for each word, adds the new strings to an array, and returns the array. This tokenized version of the record’s string values makes it easier to do string-based comparisons of individual words.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/allTokens()
func (CKRecord) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (CKRecord) ChangedKeys ¶
Returns an array of keys with recent changes to their values.
Return Value ¶
An array of keys with changed values since downloading or saving the record. If there aren’t any changed keys, this method returns an empty array.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/changedKeys()
func (CKRecord) CreationDate ¶
func (c CKRecord) CreationDate() foundation.NSDate
The time when CloudKit first saves the record to the server.
Discussion ¶
The creation date reflects the time when CloudKit creates a record on the server with the current record’s ID. For new instances of this class, the value of this property is initially `nil`. When you save the record to the server, the value updates with the creation date for the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/creationDate
func (CKRecord) CreatorUserRecordID ¶
func (c CKRecord) CreatorUserRecordID() ICKRecordID
The ID of the user who creates the record.
Discussion ¶
Use this property’s value to retrieve the user record for the user who creates this record. Every user of the app has a unique user record that is empty by default. Apps can add data to the user record on behalf of the user, but don’t store sensitive data in it.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/creatorUserRecordID
func (CKRecord) EncodeSystemFieldsWithCoder ¶
func (c CKRecord) EncodeSystemFieldsWithCoder(coder foundation.INSCoder)
Encodes the record’s system fields using the specified archiver.
coder: An archiver object.
Discussion ¶
Use this method to encode the record’s metadata that CloudKit provides. Every record has keys that the system defines that correspond to record metadata, such as the record ID, record type, creation date, and so on. This method encodes those keys in the specified archiver. This method doesn’t include any keys you add to the record. It also doesn’t encode the keys that the changedKeys method returns.
You might use this method when you want to store only the system metadata because you store the actual record data elsewhere.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/encodeSystemFields(with:)
func (CKRecord) EncodeWithCoder ¶
func (c CKRecord) EncodeWithCoder(coder foundation.INSCoder)
func (CKRecord) EncryptedValues ¶
func (c CKRecord) EncryptedValues() CKRecordKeyValueSetting
An object that manages the record’s encrypted key-value pairs.
Discussion ¶
Use the object this property returns to read and write encrypted key-value pairs that you store on the record. You can encrypt values of any data type that CloudKit supports, except CKAsset, which is encrypted by default, and CKReference, which isn’t encrypted so it remains available for server-side use. Only encrypt new fields. CloudKit doesn’t allow encryption on fields that already exist in your app’s schema, or on records that you store in the public database.
CloudKit encrypts the fields’ values on-device before saving them to iCloud, and decrypts the values only after fetching them from the server. When you enable Advanced Data Protection, the encryption keys are available exclusively to the record’s owner and, if the user shares the record, that share’s participants.
The following example shows how to use `encryptedValues` to encrypt and decrypt a string value:
See: https://developer.apple.com/documentation/CloudKit/CKRecord/encryptedValues
func (CKRecord) InitWithCoder ¶ added in v0.6.10
func (c CKRecord) InitWithCoder(coder foundation.INSCoder) CKRecord
See: https://developer.apple.com/documentation/CloudKit/CKRecord/init(coder:)
func (CKRecord) LastModifiedUserRecordID ¶
func (c CKRecord) LastModifiedUserRecordID() ICKRecordID
The ID of the user who most recently modified the record.
Discussion ¶
Use this property’s value to retrieve the user record of the user who most recently modified this record. Every user of the app has a unique user record that is empty by default. Apps can add data to the user record on behalf of the user, but don’t store sensitive data in it.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/lastModifiedUserRecordID
func (CKRecord) ModificationDate ¶
func (c CKRecord) ModificationDate() foundation.NSDate
The most recent time that CloudKit saved the record to the server.
Discussion ¶
The modification date reflects the most recent time that CloudKit saved a record with the current record’s ID to the server. For new instances of this class, the value of this property is initially `nil`. When you save the record to the server, the value updates with the modification date for the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/modificationDate
func (CKRecord) ObjectForKey ¶
func (c CKRecord) ObjectForKey(key CKRecordFieldKey) CKRecordValue
Returns the object that the record stores for the specified key.
key: The string that identifies a field in the record. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces.
Return Value ¶
The object for the specified key, or `nil` if no such key exists in the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/object(forKey:)
func (CKRecord) ObjectForKeyedSubscript ¶
func (c CKRecord) ObjectForKeyedSubscript(key CKRecordFieldKey) CKRecordValue
Returns the object that the record stores for the specified key.
key: The string that identifies a field in the record. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces.
Return Value ¶
The object for the specified key, or `nil` if no such key exists in the record.
Discussion ¶
See: https://developer.apple.com/documentation/CloudKit/CKRecord/subscript(_:)-51whk
func (CKRecord) Parent ¶
func (c CKRecord) Parent() ICKReference
A reference to the record’s parent record.
Discussion ¶
Use parent references to inform CloudKit about the hierarchy of your records. CloudKit shares the hierarchy when a CKShare includes a referenced record. Add relationships between records as you create them, even if you don’t plan to share them. This allows you to manage the sharing of a hierarchy by only modifying the root record’s CKRecord.Share reference.
To indicate that a record belongs to its parent, set this property to a reference that points to the parent record. The reference must use the CKRecord.ReferenceAction.none action or CloudKit throws an exception. The parent record must exist on the server when you save the child, or must be part of the same save operation. Otherwise, the operation fails.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/parent
func (CKRecord) RecordChangeTag ¶
The server change token for the record.
Discussion ¶
When you fetch a record from the server, you get the current version of that record as it exists on the server. However, at any time after you fetch a record, other users might save a newer version of it to the server. Every time CloudKit saves a record, the server updates the record’s change token to a new value. When you save your copy of the record, the server compares your record’s token with the token on the server. If the two tokens match, the server interprets that you modified the latest version of the record and that it can apply your changes immediately. If the two tokens don’t match, the server checks your app’s save policy to determine how to proceed.
In your own code, you can use change tokens to distinguish between two different versions of the same record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/recordChangeTag
func (CKRecord) RecordID ¶
func (c CKRecord) RecordID() ICKRecordID
The unique ID of the record.
Discussion ¶
The system sets the ID of a new record at initialization time. If you use the init(recordType:recordID:) method to initialize the record, the ID derives from the CKRecordID object you provide. In all other cases, the record generates a UUID and bases its ID on that value. The ID of a record never changes during its lifetime.
When you save a new record object to the server, the server validates the uniqueness of the record, but returns an error only if the save policy calls for it. Specifically, it returns an error when the save policy is CKModifyRecordsOperation.RecordSavePolicy.ifServerRecordUnchanged, which is the default. For all other save policies, the server overwrites the contents of the existing record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/recordID
func (CKRecord) RecordType ¶
The value that your app defines to identify the type of record.
See: https://developer.apple.com/documentation/cloudkit/ckrecord/recordtype-6v7au
func (CKRecord) SetObjectForKey ¶
func (c CKRecord) SetObjectForKey(object CKRecordValue, key CKRecordFieldKey)
Stores an object in the record using the specified key.
object: The object to store using the specified key. It must be one of the data types in CKRecord. You receive an error if you use a data type that CloudKit doesn’t support. If you specify `nil`, CloudKit removes any object that the record associates with the key.
key: The key to associate with `object`. Use this key to retrieve the value later. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces. Avoid using a key that matches the name of any property of CKRecord.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/setObject(_:forKey:)
func (CKRecord) SetParent ¶
func (c CKRecord) SetParent(value ICKReference)
func (CKRecord) SetParentReferenceFromRecord ¶
Creates and sets a reference object for a parent from its record.
parentRecord: A record that you want to set as the parent to this record.
Discussion ¶
This method creates and sets a CKReference object that points to the record you provide. The resulting CKReference has an action of CKRecord.ReferenceAction.none.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/setParent(_:)-23du1
func (CKRecord) SetParentReferenceFromRecordID ¶
func (c CKRecord) SetParentReferenceFromRecordID(parentRecordID ICKRecordID)
Creates and sets a reference object for a parent from the parent’s record ID.
parentRecordID: The CKRecordID object for the record that you want to set as this record’s parent.
Discussion ¶
This method creates and sets a CKReference object that points to the record you provide. The resulting CKReference has an action of CKRecord.ReferenceAction.none.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/setParent(_:)-7egcx
func (CKRecord) SetRecordType ¶
func (CKRecord) Share ¶
func (c CKRecord) Share() ICKReference
A reference to the share object that determines the share status of the record.
Discussion ¶
CloudKit clears this property’s value when it deletes the corresponding CKShare object on the server. Send this record in the same batch operation as the share object you’re deleting, and this property updates accordingly.
CloudKit only supports sharing in zones with the CKRecordZoneCapabilitySharing capability. The default zone doesn’t support sharing.
If any records have a parent reference to this record, CloudKit implicitly shares them along with this record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/share
type CKRecordClass ¶
type CKRecordClass struct {
// contains filtered or unexported fields
}
func GetCKRecordClass ¶
func GetCKRecordClass() CKRecordClass
GetCKRecordClass returns the class object for CKRecord.
func (CKRecordClass) Alloc ¶
func (cc CKRecordClass) Alloc() CKRecord
Alloc allocates memory for a new instance of the class.
func (CKRecordClass) Class ¶
func (cc CKRecordClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKRecordErrorHandler ¶
CKRecordErrorHandler handles The closure to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKRecordFieldKey ¶
type CKRecordFieldKey = string
CKRecordFieldKey is a data type that CloudKit requires for record field names.
See: https://developer.apple.com/documentation/CloudKit/CKRecordFieldKey
var ( // CKRecordCreationDateKey is a key constant that a record uses for its CKRecord.creationDate. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordCreationDateKey CKRecordCreationDateKey CKRecordFieldKey // CKRecordCreatorUserRecordIDKey is a key constant that a record uses for its CKRecord.creatorUserRecordID. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordCreatorUserRecordIDKey CKRecordCreatorUserRecordIDKey CKRecordFieldKey // CKRecordLastModifiedUserRecordIDKey is a key constant that a record uses for its CKRecord.lastModifiedUserRecordID. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordLastModifiedUserRecordIDKey CKRecordLastModifiedUserRecordIDKey CKRecordFieldKey // CKRecordModificationDateKey is a key constant that a record uses for its CKRecord.modificationDate. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordModificationDateKey CKRecordModificationDateKey CKRecordFieldKey // CKRecordParentKey is the key constant that a record uses for its CKRecord.parent. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordParentKey-2kx8l CKRecordParentKey CKRecordFieldKey // CKRecordRecordIDKey is a key constant that a record uses for its CKRecord.recordID. // // See: https://developer.apple.com/documentation/CloudKit/CKRecordRecordIDKey CKRecordRecordIDKey CKRecordFieldKey // // See: https://developer.apple.com/documentation/CloudKit/CKRecordShareKey-rrat CKRecordShareKey CKRecordFieldKey // // See: https://developer.apple.com/documentation/CloudKit/CKShareThumbnailImageDataKey-1rxdx CKShareThumbnailImageDataKey CKRecordFieldKey // // See: https://developer.apple.com/documentation/CloudKit/CKShareTitleKey-9yavd CKShareTitleKey CKRecordFieldKey // // See: https://developer.apple.com/documentation/CloudKit/CKShareTypeKey-204gl CKShareTypeKey CKRecordFieldKey )
type CKRecordFloat64Handler ¶ added in v0.6.10
CKRecordFloat64Handler is the signature for a completion handler block.
type CKRecordID ¶
type CKRecordID struct {
objectivec.Object
}
An object that uniquely identifies a record in a database.
Overview ¶
A record ID object consists of a name string and a zone ID. The name string is an ASCII string that doesn’t exceed 255 characters in length. When you create a record without specifying a record ID, the ID name string derives from a UUID and is, therefore, unique. When creating your own record ID objects, you can use names that have more meaning to your app or to the user, as long as each name is unique within the specified zone. For example, you might use a document name for the name string.
CloudKit uniques records by recordID within a specified database, but you can reuse record IDs in different databases. Each container has a public and a private database, and the private database is different for each unique user. This configuration provides for the reusing of record IDs in each user’s private database, but ensures that only one record uses a specific record ID in the public database.
CloudKit generally creates record IDs when it first saves a new record, but you might manually instantiate instances of CKRecordID in specific situations. For example, you must create an instance when saving a record in a zone other than the default zone. You also instantiate instances of CKRecordID when retrieving specific records from a database.
Don’t subclass CKRecordID.
Interacting with Record IDs ¶
After you create a CKRecordID object, interactions with that object typically involve creating a new record or retrieving an existing record from a database.
You might also use record IDs when you can’t use a CKReference object to refer to a record. References are only valid within a single zone of a database. To refer to objects outside of the current zone or database, save the strings in the record’s CKRecordID and CKRecordZoneID objects. When you want to retrieve the record later, use those strings to recreate the record and zone ID objects so that you can fetch the record.
Creating Record IDs for New Records ¶
To assign a custom record ID to a new record, you must create the CKRecordID object first. You need to know the intended name and zone information for that record, which might also require creating a CKRecordZoneID object. After creating the record ID object, initialize your new record using its init(recordType:recordID:) method.
Using Record IDs to Fetch Records ¶
Use a record ID to fetch the corresponding CKRecord object from a database quickly. You perform the fetch operation using a CKFetchRecordsOperation object or the CKDatabase.FetchRecordWithIDCompletionHandler method of the CKDatabase class. In both cases, CloudKit returns the record asynchronously using the handler you provide.
Creating a Record ID ¶
- CKRecordID.InitWithRecordName: Creates a new record ID with the specified name in the default zone.
Getting the Record ID’s Name ¶
- CKRecordID.RecordName: The unique name of the record.
Getting the Record ID’s Zone ¶
- CKRecordID.ZoneID: The ID of the zone that contains the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/ID
func CKRecordIDFromID ¶
func CKRecordIDFromID(id objc.ID) CKRecordID
CKRecordIDFromID constructs a CKRecordID from an objc.ID.
An object that uniquely identifies a record in a database.
func NewCKRecordID ¶
func NewCKRecordID() CKRecordID
NewCKRecordID creates a new CKRecordID instance.
func NewCKRecordIDWithRecordName ¶
func NewCKRecordIDWithRecordName(recordName string) CKRecordID
Creates a new record ID with the specified name in the default zone.
recordName: The name that identifies the record. The string must contain only ASCII characters, must not exceed 255 characters, and must not start with an underscore. If you specify an empty string for this parameter, the method throws an exception.
Return Value ¶
An initialized record ID object.
Discussion ¶
Use this method when you’re creating or searching for records in the default zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/ID/init(recordName:)
func (CKRecordID) Autorelease ¶
func (c CKRecordID) Autorelease() CKRecordID
Autorelease adds the receiver to the current autorelease pool.
func (CKRecordID) EncodeWithCoder ¶
func (c CKRecordID) EncodeWithCoder(coder foundation.INSCoder)
func (CKRecordID) InitWithRecordName ¶
func (c CKRecordID) InitWithRecordName(recordName string) CKRecordID
Creates a new record ID with the specified name in the default zone.
recordName: The name that identifies the record. The string must contain only ASCII characters, must not exceed 255 characters, and must not start with an underscore. If you specify an empty string for this parameter, the method throws an exception.
Return Value ¶
An initialized record ID object.
Discussion ¶
Use this method when you’re creating or searching for records in the default zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/ID/init(recordName:)
func (CKRecordID) RecordName ¶
func (c CKRecordID) RecordName() string
The unique name of the record.
Discussion ¶
For share records that manage a shared record zone, this property’s value is always CKRecordNameZoneWideShare.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/ID/recordName
func (CKRecordID) ZoneID ¶
func (c CKRecordID) ZoneID() ICKRecordZoneID
The ID of the zone that contains the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/ID/zoneID
type CKRecordIDClass ¶
type CKRecordIDClass struct {
// contains filtered or unexported fields
}
func GetCKRecordIDClass ¶
func GetCKRecordIDClass() CKRecordIDClass
GetCKRecordIDClass returns the class object for CKRecordID.
func (CKRecordIDClass) Alloc ¶
func (cc CKRecordIDClass) Alloc() CKRecordID
Alloc allocates memory for a new instance of the class.
func (CKRecordIDClass) Class ¶
func (cc CKRecordIDClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKRecordIDErrorHandler ¶
type CKRecordIDErrorHandler = func(*CKRecordID, error)
CKRecordIDErrorHandler handles The handler to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKRecordIDFloat64Handler ¶ added in v0.6.10
type CKRecordIDFloat64Handler = func(*CKRecordID, float64)
CKRecordIDFloat64Handler is the signature for a completion handler block.
type CKRecordIDHandler ¶
type CKRecordIDHandler = func(*CKRecordID)
CKRecordIDHandler handles A block that returns the record for the specified record identifier.
Used by:
type CKRecordKeyValueSetting ¶
type CKRecordKeyValueSetting interface {
objectivec.IObject
// Returns the object that the record stores for the specified key.
//
// See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/object(forKey:)
ObjectForKey(key CKRecordFieldKey) CKRecordValue
// Returns the object that the record stores for the specified key.
//
// See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/subscript(_:)
ObjectForKeyedSubscript(key CKRecordFieldKey) CKRecordValue
// Stores an object in the record using the specified key.
//
// See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/setObject(_:forKey:)
SetObjectForKey(object CKRecordValue, key CKRecordFieldKey)
// Returns an array of the record’s keys.
//
// See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/allKeys()
AllKeys() []string
// Returns an array of keys with recent changes to their values.
//
// See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/changedKeys()
ChangedKeys() []string
}
A protocol for managing the key-value pairs of a CloudKit record.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting
type CKRecordKeyValueSettingObject ¶
type CKRecordKeyValueSettingObject struct {
objectivec.Object
}
CKRecordKeyValueSettingObject wraps an existing Objective-C object that conforms to the CKRecordKeyValueSetting protocol.
func CKRecordKeyValueSettingObjectFromID ¶
func CKRecordKeyValueSettingObjectFromID(id objc.ID) CKRecordKeyValueSettingObject
CKRecordKeyValueSettingObjectFromID constructs a CKRecordKeyValueSettingObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (CKRecordKeyValueSettingObject) AllKeys ¶
func (o CKRecordKeyValueSettingObject) AllKeys() []string
Returns an array of the record’s keys.
Return Value ¶
An array of keys, or an empty array if the record doesn’t contain any keys.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/allKeys()
func (CKRecordKeyValueSettingObject) BaseObject ¶
func (o CKRecordKeyValueSettingObject) BaseObject() objectivec.Object
func (CKRecordKeyValueSettingObject) ChangedKeys ¶
func (o CKRecordKeyValueSettingObject) ChangedKeys() []string
Returns an array of keys with recent changes to their values.
Return Value ¶
An array of keys with changed values since downloading or saving the record. If there aren’t any changed keys, this method returns an empty array.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/changedKeys()
func (CKRecordKeyValueSettingObject) ObjectForKey ¶
func (o CKRecordKeyValueSettingObject) ObjectForKey(key CKRecordFieldKey) CKRecordValue
Returns the object that the record stores for the specified key.
key: The string that identifies a field in the record. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces.
Return Value ¶
The object for the specified key, or `nil` if no such key exists in the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/object(forKey:)
func (CKRecordKeyValueSettingObject) ObjectForKeyedSubscript ¶
func (o CKRecordKeyValueSettingObject) ObjectForKeyedSubscript(key CKRecordFieldKey) CKRecordValue
Returns the object that the record stores for the specified key.
key: The string that identifies a field in the record. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces.
Return Value ¶
The object for the specified key, or `nil` if no such key exists in the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/subscript(_:)
func (CKRecordKeyValueSettingObject) SetObjectForKey ¶
func (o CKRecordKeyValueSettingObject) SetObjectForKey(object CKRecordValue, key CKRecordFieldKey)
Stores an object in the record using the specified key.
object: The object to store using the specified key. It must be one of the data types in CKRecord. You receive an error if you use a data type that CloudKit doesn’t support. If you specify `nil`, CloudKit removes any object that the record associates with the key.
key: The key to associate with `object`. Use this key to retrieve the value later. A key must consist of one or more alphanumeric characters and must start with a letter. CloudKit permits the use of underscores, but not spaces. Avoid using a key that matches the name of any property of CKRecord.
See: https://developer.apple.com/documentation/CloudKit/CKRecordKeyValueSetting/setObject(_:forKey:)
type CKRecordSavePolicy ¶
type CKRecordSavePolicy int
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation/RecordSavePolicy
const ( // CKRecordSaveAllKeys: A policy that instructs CloudKit to save all keys of a record, even those without changes. CKRecordSaveAllKeys CKRecordSavePolicy = 2 // CKRecordSaveChangedKeys: A policy that instructs CloudKit to save only the fields of a record that contain changes. CKRecordSaveChangedKeys CKRecordSavePolicy = 1 // CKRecordSaveIfServerRecordUnchanged: A policy that instructs CloudKit to only proceed if the record’s change tag matches that of the server’s copy. CKRecordSaveIfServerRecordUnchanged CKRecordSavePolicy = 0 )
func (CKRecordSavePolicy) String ¶
func (e CKRecordSavePolicy) String() string
type CKRecordType ¶
type CKRecordType = string
CKRecordType is a data type that CloudKit requires for record types.
See: https://developer.apple.com/documentation/CloudKit/CKRecordType
type CKRecordValue ¶
type CKRecordValue interface {
objectivec.IObject
}
The protocol that provides strong type-checking for objects that the CloudKit framework stores on the server.
See: https://developer.apple.com/documentation/CloudKit/CKRecordValue-c.protocol
type CKRecordValueObject ¶
type CKRecordValueObject struct {
objectivec.Object
}
CKRecordValueObject wraps an existing Objective-C object that conforms to the CKRecordValue protocol.
func CKRecordValueObjectFromID ¶
func CKRecordValueObjectFromID(id objc.ID) CKRecordValueObject
CKRecordValueObjectFromID constructs a CKRecordValueObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (CKRecordValueObject) BaseObject ¶
func (o CKRecordValueObject) BaseObject() objectivec.Object
type CKRecordZone ¶
type CKRecordZone struct {
objectivec.Object
}
A database partition that contains related records.
Overview ¶
Zones are an important part of how you organize your data. The public and private databases each have a single default zone. In the private database, you can use CKRecordZone objects to create additional custom zones as necessary. Use custom zones to arrange and encapsulate groups of related records in the private database. Custom zones support other capabilities too, such as the ability to write multiple records as a single atomic transaction.
Treat each custom zone as a single unit of data that is separate from every other zone in the database. You can add records inside the zone. You can also create links between the records inside a zone by using the CKReference class. However, the CKReference class doesn’t support cross-zone linking, so each reference object must point to a record in the same zone as the current record.
Use the CKRecordZone class as-is and don’t subclass it.
Creating a Custom Record Zone ¶
Generally, you use instances of this class to create and manage custom zones. Although you can use this class to retrieve a database’s default zone, most operations act on records in the default zone by default, so you rarely need to specify it explicitly.
To create a custom zone, use CKRecordZone to create the zone object, and then save that zone to the user’s private database using a CKModifyRecordZonesOperation object. You can’t save any records in the zone until you save it to the database. When creating records, explicitly specify the zone ID if you want the records to reside in a specific zone; otherwise, they save to the default zone. You can’t create custom zones in a public database.
After creating a CKRecordZone object and saving it to the database, you don’t interact with the object much. Instead, most interactions occur with its corresponding CKRecordZoneID object, which you use to refer to the zone when creating records.
Creating a Record Zone ¶
- CKRecordZone.InitWithZoneName: Creates a record zone object with the specified zone name.
- CKRecordZone.InitWithZoneID: Creates a record zone object with the specified zone ID.
Getting the Zone Attributes ¶
- CKRecordZone.ZoneID: The unique ID of the zone.
- CKRecordZone.Capabilities: The capabilities that the zone supports.
Sharing Records ¶
- CKRecordZone.Share: A reference to the record zone’s share record.
Initializers ¶
Instance Properties ¶
- CKRecordZone.EncryptionScope: The encryption scope determines the granularity at which encryption keys are stored within the zone.
- CKRecordZone.SetEncryptionScope
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone
func CKRecordZoneFromID ¶
func CKRecordZoneFromID(id objc.ID) CKRecordZone
CKRecordZoneFromID constructs a CKRecordZone from an objc.ID.
A database partition that contains related records.
func NewCKRecordZone ¶
func NewCKRecordZone() CKRecordZone
NewCKRecordZone creates a new CKRecordZone instance.
func NewCKRecordZoneWithCoder ¶ added in v0.6.10
func NewCKRecordZoneWithCoder(coder foundation.INSCoder) CKRecordZone
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/init(coder:)
func NewCKRecordZoneWithZoneID ¶
func NewCKRecordZoneWithZoneID(zoneID ICKRecordZoneID) CKRecordZone
Creates a record zone object with the specified zone ID.
zoneID: The ID for the new zone. This parameter must not be `nil`.
Return Value ¶
The custom record zone, or `nil` if CloudKit can’t create the zone.
Discussion ¶
Use this method when you want to create a new record zone from the information in a zone ID. After creating the zone, save it to the server using a CKModifyRecordZonesOperation object or the CKDatabase.SaveSubscriptionCompletionHandler method of CKDatabase.
Don’t use this method to create a CKRecordZone object that corresponds to a zone that already exists in the database. If the zone exists, fetch it using a CKFetchRecordZonesOperation object or the CKDatabase.FetchRecordZoneWithIDCompletionHandler method of CKDatabase.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/init(zoneID:)
func NewCKRecordZoneWithZoneName ¶
func NewCKRecordZoneWithZoneName(zoneName string) CKRecordZone
Creates a record zone object with the specified zone name.
zoneName: The name of the new zone. Zone names inside a user’s private database are unique, consist of up to 255 ASCII characters, and don’t start with an underscore. One way to ensure the uniqueness of zone names is to create a string from a UUID, but you can also use other techniques.
If this parameter is `nil` or is an empty string, the method throws an exception.
Return Value ¶
The new custom zone, or `nil` if CloudKit can’t create the zone.
Discussion ¶
Use this method to create a new record zone. The new zone has the name you provide and the zone’s owner is the current user. After creating the zone, save it to the server using a CKModifyRecordZonesOperation object or the CKDatabase.SaveSubscriptionCompletionHandler method of CKDatabase. You must save the zone to the server before you attempt to save any records to that zone.
Don’t use this method to create a CKRecordZone object that corresponds to a zone that already exists in the database. If the zone exists, fetch it using a CKFetchRecordZonesOperation object or the CKDatabase.FetchRecordZoneWithIDCompletionHandler method of CKDatabase.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/init(zoneName:)
func (CKRecordZone) Autorelease ¶
func (c CKRecordZone) Autorelease() CKRecordZone
Autorelease adds the receiver to the current autorelease pool.
func (CKRecordZone) Capabilities ¶
func (c CKRecordZone) Capabilities() CKRecordZoneCapabilities
The capabilities that the zone supports.
Discussion ¶
The server determines the capabilities of the zone and sets the value of this property when you save the record zone. Always check this property before performing tasks that require a specific capability.
Default zones don’t support any special capabilities. Custom zones in a private database support the options that CKRecordZone.Capabilities provides.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/capabilities-swift.property
func (CKRecordZone) EncodeWithCoder ¶
func (c CKRecordZone) EncodeWithCoder(coder foundation.INSCoder)
func (CKRecordZone) EncryptionScope ¶
func (c CKRecordZone) EncryptionScope() CKRecordZoneEncryptionScope
The encryption scope determines the granularity at which encryption keys are stored within the zone.
Discussion ¶
Zone encryption scope defaults to CKRecordZoneEncryptionScopePerRecord and can only be modified before zone creation. Attempting to change the encryption scope of an existing zone is invalid and will result in an error.
Zones using CKRecordZoneEncryptionScopePerZone can only use zone-wide sharing and are not compatible with older device OS versions. Refer to CKRecordZoneEncryptionScope for more info.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/encryptionScope-swift.property
func (CKRecordZone) InitWithCoder ¶ added in v0.6.10
func (c CKRecordZone) InitWithCoder(coder foundation.INSCoder) CKRecordZone
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/init(coder:)
func (CKRecordZone) InitWithZoneID ¶
func (c CKRecordZone) InitWithZoneID(zoneID ICKRecordZoneID) CKRecordZone
Creates a record zone object with the specified zone ID.
zoneID: The ID for the new zone. This parameter must not be `nil`.
Return Value ¶
The custom record zone, or `nil` if CloudKit can’t create the zone.
Discussion ¶
Use this method when you want to create a new record zone from the information in a zone ID. After creating the zone, save it to the server using a CKModifyRecordZonesOperation object or the CKDatabase.SaveSubscriptionCompletionHandler method of CKDatabase.
Don’t use this method to create a CKRecordZone object that corresponds to a zone that already exists in the database. If the zone exists, fetch it using a CKFetchRecordZonesOperation object or the CKDatabase.FetchRecordZoneWithIDCompletionHandler method of CKDatabase.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/init(zoneID:)
func (CKRecordZone) InitWithZoneName ¶
func (c CKRecordZone) InitWithZoneName(zoneName string) CKRecordZone
Creates a record zone object with the specified zone name.
zoneName: The name of the new zone. Zone names inside a user’s private database are unique, consist of up to 255 ASCII characters, and don’t start with an underscore. One way to ensure the uniqueness of zone names is to create a string from a UUID, but you can also use other techniques.
If this parameter is `nil` or is an empty string, the method throws an exception.
Return Value ¶
The new custom zone, or `nil` if CloudKit can’t create the zone.
Discussion ¶
Use this method to create a new record zone. The new zone has the name you provide and the zone’s owner is the current user. After creating the zone, save it to the server using a CKModifyRecordZonesOperation object or the CKDatabase.SaveSubscriptionCompletionHandler method of CKDatabase. You must save the zone to the server before you attempt to save any records to that zone.
Don’t use this method to create a CKRecordZone object that corresponds to a zone that already exists in the database. If the zone exists, fetch it using a CKFetchRecordZonesOperation object or the CKDatabase.FetchRecordZoneWithIDCompletionHandler method of CKDatabase.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/init(zoneName:)
func (CKRecordZone) SetEncryptionScope ¶
func (c CKRecordZone) SetEncryptionScope(value CKRecordZoneEncryptionScope)
func (CKRecordZone) Share ¶
func (c CKRecordZone) Share() ICKReference
A reference to the record zone’s share record.
Discussion ¶
CloudKit sets this property only for fetched record zones that contain a share record; otherwise, it’s `nil`.
To share a record zone, create a share record using the CKShare.InitWithRecordZoneID method and then save it to the server. Shared record zones must have the CKRecordZoneCapabilityZoneWideSharing capability, which CloudKit enables by default for new custom record zones in the user’s private database.
A record zone, and the records it contains, can take part in only a single share. CloudKit returns an error if you attempt to share an already-shared record zone, or if that record zone contains previously shared records.
Record zone sharing errors include the following:
- CKError.Code.serverRecordChanged, which CloudKit returns if you try to share an already-shared record zone. - CKError.Code.serverRejectedRequest, which CloudKit returns if you try to share a record hierarchy from an already-shared record zone. - CKError.Code.invalidArguments, which CloudKit returns if you try to share a record zone that contains one or more shared hierarchies.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/share
func (CKRecordZone) ZoneID ¶
func (c CKRecordZone) ZoneID() ICKRecordZoneID
The unique ID of the zone.
Discussion ¶
The zone ID contains the name of the zone and the name of the user who owns the zone. Use this property to access both of those values.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/zoneID
type CKRecordZoneArrayErrorHandler ¶
type CKRecordZoneArrayErrorHandler = func(*[]CKRecordZone, error)
CKRecordZoneArrayErrorHandler handles The closure to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKRecordZoneCapabilities ¶
type CKRecordZoneCapabilities uint
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/Capabilities-swift.struct
const ( // CKRecordZoneCapabilityAtomic: A capability that allows atomic changes of multiple records. CKRecordZoneCapabilityAtomic CKRecordZoneCapabilities = 2 // CKRecordZoneCapabilityFetchChanges: A capability for fetching only the changed records from a zone. CKRecordZoneCapabilityFetchChanges CKRecordZoneCapabilities = 1 // CKRecordZoneCapabilitySharing: A capability for sharing a specific hierarchy of records. CKRecordZoneCapabilitySharing CKRecordZoneCapabilities = 4 // CKRecordZoneCapabilityZoneWideSharing: A capability for sharing the entire contents of a record zone. CKRecordZoneCapabilityZoneWideSharing CKRecordZoneCapabilities = 8 )
func (CKRecordZoneCapabilities) String ¶
func (e CKRecordZoneCapabilities) String() string
type CKRecordZoneClass ¶
type CKRecordZoneClass struct {
// contains filtered or unexported fields
}
func GetCKRecordZoneClass ¶
func GetCKRecordZoneClass() CKRecordZoneClass
GetCKRecordZoneClass returns the class object for CKRecordZone.
func (CKRecordZoneClass) Alloc ¶
func (cc CKRecordZoneClass) Alloc() CKRecordZone
Alloc allocates memory for a new instance of the class.
func (CKRecordZoneClass) Class ¶
func (cc CKRecordZoneClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKRecordZoneClass) DefaultRecordZone ¶
func (_CKRecordZoneClass CKRecordZoneClass) DefaultRecordZone() CKRecordZone
Returns the default record zone.
Discussion ¶
Always use this method to retrieve the default zone for a database. You can use the returned object to specify the default zone for either the public or private database of a container. You don’t need to save the returned zone object before using it. The owner of the zone is CKOwnerDefaultName, which corresponds to the current user.
The default zone of a database is a convenient place to store and access records. If you don’t explicitly assign a zone to a record, CloudKit puts the record in the default zone.
The disadvantage of using the default zone for storing records is that it doesn’t have any special capabilities. You can’t save a group of records to iCloud atomically in the default zone. Similarly, you can’t use a CKFetchRecordChangesOperation object on records in the default zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/default()
type CKRecordZoneEncryptionScope ¶
type CKRecordZoneEncryptionScope int
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/EncryptionScope-swift.enum
const ( // CKRecordZoneEncryptionScopePerRecord: Zone uses per-record encryption keys for any encrypted values on a record or share. CKRecordZoneEncryptionScopePerRecord CKRecordZoneEncryptionScope = 0 // CKRecordZoneEncryptionScopePerZone: Zone uses per-zone encryption keys for encrypted values across all records and the zone-wide share, if present. CKRecordZoneEncryptionScopePerZone CKRecordZoneEncryptionScope = 1 )
func (CKRecordZoneEncryptionScope) String ¶
func (e CKRecordZoneEncryptionScope) String() string
type CKRecordZoneErrorHandler ¶
type CKRecordZoneErrorHandler = func(*CKRecordZone, error)
CKRecordZoneErrorHandler handles The closure to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKRecordZoneID ¶
type CKRecordZoneID struct {
objectivec.Object
}
An object that uniquely identifies a record zone in a database.
Overview ¶
Zones are a mechanism for grouping related records together. You create zone ID objects when you want to fetch an existing zone object or create a new zone with a specific name.
A record zone ID distinguishes one zone from another by a name string and the ID of the user who creates the zone. Both strings must be ASCII strings that don’t exceed 255 characters. When creating your own record zone ID objects, you can use names that have more meaning to your app or to the user, providing each zone name is unique within the specified database. The owner name must be either the current user name or the name of another user. Get the current user name from CKCurrentUserDefaultName or by calling CKContainer.FetchUserRecordIDWithCompletionHandler.
When creating new record zones, make the name string in the record zone ID unique in the target database. Public databases don’t support custom zones, and only the user who owns the database can create zones in private databases.
Don’t create subclasses of this class.
Interacting with Record Zone IDs ¶
After you create a record zone ID, interactions with it typically include:
- Creating a CKRecordID object so that you can fetch or create records in that zone. - Retrieving an existing CKRecordZone object from the database.
You don’t need to create a record zone ID to create a record zone. The CKRecordZone class has initialization methods that create a record zone ID using the name string you provide.
Creating Record Zone IDs for Records ¶
To create a new record in a custom zone, create a record zone ID that specifies the zone name. Use the record zone ID to create a CKRecordID, and then use the record ID to create the record.
Fetching a Record Zone Object from the Database ¶
To fetch a record zone from the database, use a CKFetchRecordZonesOperation object or the CKDatabase.FetchRecordZoneWithIDCompletionHandler method of CKDatabase. Both techniques accept a record zone ID that you provide and retrieve the corresponding record zone object asynchronously. If you use the operation object, you can retrieve multiple record zones at the same time.
Getting the Record Zone ID Attributes ¶
- CKRecordZoneID.ZoneName: The unique name of the record zone.
- CKRecordZoneID.OwnerName: The ID of the user who owns the record zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/ID
func CKRecordZoneIDFromID ¶
func CKRecordZoneIDFromID(id objc.ID) CKRecordZoneID
CKRecordZoneIDFromID constructs a CKRecordZoneID from an objc.ID.
An object that uniquely identifies a record zone in a database.
func NewCKRecordZoneID ¶
func NewCKRecordZoneID() CKRecordZoneID
NewCKRecordZoneID creates a new CKRecordZoneID instance.
func (CKRecordZoneID) Autorelease ¶
func (c CKRecordZoneID) Autorelease() CKRecordZoneID
Autorelease adds the receiver to the current autorelease pool.
func (CKRecordZoneID) EncodeWithCoder ¶
func (c CKRecordZoneID) EncodeWithCoder(coder foundation.INSCoder)
func (CKRecordZoneID) Init ¶
func (c CKRecordZoneID) Init() CKRecordZoneID
Init initializes the instance.
func (CKRecordZoneID) OwnerName ¶
func (c CKRecordZoneID) OwnerName() string
The ID of the user who owns the record zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/ID/ownerName
func (CKRecordZoneID) ZoneName ¶
func (c CKRecordZoneID) ZoneName() string
The unique name of the record zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/ID/zoneName
type CKRecordZoneIDCKServerChangeTokenDataHandler ¶
type CKRecordZoneIDCKServerChangeTokenDataHandler = func(*CKRecordZoneID, *CKServerChangeToken, *foundation.NSData)
CKRecordZoneIDCKServerChangeTokenDataHandler is the signature for a completion handler block.
type CKRecordZoneIDClass ¶
type CKRecordZoneIDClass struct {
// contains filtered or unexported fields
}
func GetCKRecordZoneIDClass ¶
func GetCKRecordZoneIDClass() CKRecordZoneIDClass
GetCKRecordZoneIDClass returns the class object for CKRecordZoneID.
func (CKRecordZoneIDClass) Alloc ¶
func (cc CKRecordZoneIDClass) Alloc() CKRecordZoneID
Alloc allocates memory for a new instance of the class.
func (CKRecordZoneIDClass) Class ¶
func (cc CKRecordZoneIDClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKRecordZoneIDErrorHandler ¶
type CKRecordZoneIDErrorHandler = func(*CKRecordZoneID, error)
CKRecordZoneIDErrorHandler handles The closure to execute after CloudKit deletes the record zone. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKRecordZoneIDHandler ¶
type CKRecordZoneIDHandler = func(*CKRecordZoneID)
CKRecordZoneIDHandler is the signature for a completion handler block.
type CKRecordZoneNotification ¶
type CKRecordZoneNotification struct {
CKNotification
}
A notification that triggers when the contents of a record zone change.
Overview ¶
A record zone subscription executes when a user, or in certain scenarios, CloudKit, modifies a record in that zone, for example, when a field’s value changes in a record. When CloudKit registers the change, it sends push notifications to the user’s devices to inform your app about the change. You can then fetch the changes and cache them on-device. When appropriate, CloudKit excludes the device where the change originates.
You configure a subscription’s notifications by setting it’s CKSubscription.NotificationInfo property. Do this before you save it to the server. A subscription generates either high-priority or medium-priority push notifications. CloudKit delivers medium-priority notifications to your app in the background. High-priority notifications are visual and the system displays them to the user. Visual notifications need the user’s permission. For more information, see Asking permission to use notifications.
A subscription uses CKNotificationInfo to configure its notifications. For background delivery, set only its CKNotificationInfo.ShouldSendContentAvailable property to true. If you set any other property, CloudKit treats the notification as high-priority.
Don’t rely on push notifications for specific changes to records because the system can coalesce them. CloudKit can omit data to keep the notification’s payload size under the APNs size limit. Consider notifications an indication of remote changes. Use CKRecordZoneNotification.DatabaseScope to determine which database contains the changed record zone, and CKRecordZoneNotification.RecordZoneID to determine which zone contains changed records. You can then fetch just those changes using CKFetchRecordZoneChangesOperation. A notification’s CKNotification.IsPruned property is true if CloudKit omits data.
You don’t instantiate this class. Instead, implement application(_:didReceiveRemoteNotification:fetchCompletionHandler:) in your app delegate. Initialize CKNotification with the `userInfo` dictionary that CloudKit passes to the method. This returns an instance of the appropriate subclass. Use the CKNotification.NotificationType property to determine the type. Then cast to that type to access type-specific properties and methods.
Getting the Record Zone ID ¶
- CKRecordZoneNotification.RecordZoneID: The ID of the record zone that has changes.
Getting the Database Scope ¶
- CKRecordZoneNotification.DatabaseScope: The type of database for the record zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneNotification
func CKRecordZoneNotificationFromID ¶
func CKRecordZoneNotificationFromID(id objc.ID) CKRecordZoneNotification
CKRecordZoneNotificationFromID constructs a CKRecordZoneNotification from an objc.ID.
A notification that triggers when the contents of a record zone change.
func NewCKRecordZoneNotification ¶
func NewCKRecordZoneNotification() CKRecordZoneNotification
NewCKRecordZoneNotification creates a new CKRecordZoneNotification instance.
func NewCKRecordZoneNotificationFromRemoteNotificationDictionary ¶
func NewCKRecordZoneNotificationFromRemoteNotificationDictionary(notificationDictionary foundation.INSDictionary) CKRecordZoneNotification
Creates a new notification using the specified payload data.
notificationDictionary: The push notification’s payload data. Use the dictionary that the system provides to your app delegate’s application(_:didReceiveRemoteNotification:fetchCompletionHandler:) method. This parameter must not be `nil`.
func (CKRecordZoneNotification) Autorelease ¶
func (c CKRecordZoneNotification) Autorelease() CKRecordZoneNotification
Autorelease adds the receiver to the current autorelease pool.
func (CKRecordZoneNotification) DatabaseScope ¶
func (c CKRecordZoneNotification) DatabaseScope() CKDatabaseScope
The type of database for the record zone.
Discussion ¶
This property’s value is one of the constants that CKDatabase.Scope defines.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneNotification/databaseScope
func (CKRecordZoneNotification) Init ¶
func (c CKRecordZoneNotification) Init() CKRecordZoneNotification
Init initializes the instance.
func (CKRecordZoneNotification) RecordZoneID ¶
func (c CKRecordZoneNotification) RecordZoneID() ICKRecordZoneID
The ID of the record zone that has changes.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneNotification/recordZoneID
type CKRecordZoneNotificationClass ¶
type CKRecordZoneNotificationClass struct {
// contains filtered or unexported fields
}
func GetCKRecordZoneNotificationClass ¶
func GetCKRecordZoneNotificationClass() CKRecordZoneNotificationClass
GetCKRecordZoneNotificationClass returns the class object for CKRecordZoneNotification.
func (CKRecordZoneNotificationClass) Alloc ¶
func (cc CKRecordZoneNotificationClass) Alloc() CKRecordZoneNotification
Alloc allocates memory for a new instance of the class.
func (CKRecordZoneNotificationClass) Class ¶
func (cc CKRecordZoneNotificationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKRecordZoneSubscription ¶
type CKRecordZoneSubscription struct {
CKSubscription
}
A subscription that generates push notifications when CloudKit modifies records in a specific record zone.
Overview ¶
Subscriptions track the creation, modification, and deletion of records in a database, and are fundamental in keeping data on the user’s device up to date. A subscription applies only to the user that creates it. When a subscription registers a change, such as CloudKit saving a new record, it sends push notifications to the user’s devices to inform your app about the change. You can then fetch the changes and cache them on-device. When appropriate, the server excludes the device where the change originates.
Record zone subscriptions execute whenever a change happens in the record zone you specify when you create the subscription. You can further specialize the subscription by setting its CKDatabaseSubscription.RecordType property to a specific record type. This limits the scope of the subscription to only track changes to records of that type and reduces the number of notifications it generates.
Create any subscriptions on your app’s first launch. After you initialize a subscription, save it to the server using CKModifySubscriptionsOperation. When the operation completes, record that state on-device (in UserDefaults, for example). You can then check that state on subsequent launches to prevent unnecessary trips to the server.
To configure the notification that the subscription generates, set the subscription’s CKSubscription.NotificationInfo property. Because the system coalesces notifications, don’t rely on them for specific changes. CloudKit can omit data to keep the payload size under the APNs size limit. Consider notifications an indication of remote changes and use CKFetchRecordZoneChangesOperation to fetch the changed records. Server change tokens allow you to limit the fetch results to just the changes since your previous fetch.
The example below shows how to create a record zone subscription in the user’s private database, configure the notifications it generates — in this case, silent push notifications — and then save that subscription to the server:
Accessing the Subscription Metadata ¶
- CKRecordZoneSubscription.RecordType: The type of record that the subscription queries.
- CKRecordZoneSubscription.SetRecordType
- CKRecordZoneSubscription.ZoneID: The ID of the record zone that the subscription queries.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneSubscription
func CKRecordZoneSubscriptionFromID ¶
func CKRecordZoneSubscriptionFromID(id objc.ID) CKRecordZoneSubscription
CKRecordZoneSubscriptionFromID constructs a CKRecordZoneSubscription from an objc.ID.
A subscription that generates push notifications when CloudKit modifies records in a specific record zone.
func NewCKRecordZoneSubscription ¶
func NewCKRecordZoneSubscription() CKRecordZoneSubscription
NewCKRecordZoneSubscription creates a new CKRecordZoneSubscription instance.
func NewCKRecordZoneSubscriptionWithCoder ¶
func NewCKRecordZoneSubscriptionWithCoder(aDecoder foundation.INSCoder) CKRecordZoneSubscription
Creates a zone-based subscription from a serialized instance.
aDecoder: The coder for decoding the serialized record zone subscription.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneSubscription/init(coder:)
func (CKRecordZoneSubscription) Autorelease ¶
func (c CKRecordZoneSubscription) Autorelease() CKRecordZoneSubscription
Autorelease adds the receiver to the current autorelease pool.
func (CKRecordZoneSubscription) Init ¶
func (c CKRecordZoneSubscription) Init() CKRecordZoneSubscription
Init initializes the instance.
func (CKRecordZoneSubscription) RecordType ¶
func (c CKRecordZoneSubscription) RecordType() unsafe.Pointer
The type of record that the subscription queries.
See: https://developer.apple.com/documentation/cloudkit/ckrecordzonesubscription/recordtype-1fuqo
func (CKRecordZoneSubscription) SetRecordType ¶
func (c CKRecordZoneSubscription) SetRecordType(value kernel.Pointer)
func (CKRecordZoneSubscription) ZoneID ¶
func (c CKRecordZoneSubscription) ZoneID() ICKRecordZoneID
The ID of the record zone that the subscription queries.
Discussion ¶
This property applies to query-based subscriptions and zone-based subscriptions. Specifying a record zone ID limits the scope of the query to only the records in that zone. For zone-based subscriptions, the query includes all records in the specified record zone. For a query-based subscription, the query includes only records of a specific type in the specified record zone.
For zone-based subscriptions, CloudKit sets this property’s value automatically. For all other subscription types, the default value is `nil`. If you want to scope your query-based subscription to a specific record zone, you must assign a value explicitly.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneSubscription/zoneID
type CKRecordZoneSubscriptionClass ¶
type CKRecordZoneSubscriptionClass struct {
// contains filtered or unexported fields
}
func GetCKRecordZoneSubscriptionClass ¶
func GetCKRecordZoneSubscriptionClass() CKRecordZoneSubscriptionClass
GetCKRecordZoneSubscriptionClass returns the class object for CKRecordZoneSubscription.
func (CKRecordZoneSubscriptionClass) Alloc ¶
func (cc CKRecordZoneSubscriptionClass) Alloc() CKRecordZoneSubscription
Alloc allocates memory for a new instance of the class.
func (CKRecordZoneSubscriptionClass) Class ¶
func (cc CKRecordZoneSubscriptionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKReference ¶
type CKReference struct {
objectivec.Object
}
A relationship between two records in a record zone.
Overview ¶
A CKReference object creates a many-to-one relationship between records in your database. Each reference object stores information about the one record that is the target of the reference. You then save the reference object in the fields of one or more records to create a link from those records to the target. You may only create references between records within the same zone of the same database.
References create a stronger relationship between records than just saving the ID of a record as a string. Specifically, you can use references to create an ownership model between two records. When the reference object’s action is CKRecord.ReferenceAction.deleteSelf, the target of the reference—that is, the record in the reference’s CKReference.RecordID property—becomes the owner of the source record. Deleting the target (owner) record deletes all its source records. The deletion of any owned records can trigger further deletions if those records are the owners of other records. If a record contains two or more CKReference objects with an action of CKRecord.ReferenceAction.deleteSelf, CloudKit deletes the record when it deletes any of the objects it references.
To save multiple records that contain references between them, save the target records first or save all the records in one batch operation using CKModifyRecordsOperation.
Interacting with Reference Objects ¶
You use reference objects to create strong links between two records and to search for related fields. When you create new records, you create reference objects and assign them to fields of your records. The only other time you create reference objects is when you build a search predicate to search for related records.
Linking to Another Record ¶
To link records together and create a strong relationship between them, create a new CKReference object, initialize it with the owner record, and assign that reference object to a field of the owned record. When you design the relationships among your own records, make the owner the more important of two related records. The owner record rarely depends on any records that point to it. The owner record is also the one that you typically fetch first from the database.
The figure below shows an example of a relationship between a to-do list record and a set of item records that represent individual items to complete. The to-do list is the primary record, or owner, in the relationship because it represents the entire to-do list, including all items on the list. As a result, each item record has a field that contains a CKReference object that points to the owning to-do list record.
[media-1965777]
The following code sample shows how to create the reference object for each item record and configure it to point at the list record:
An ownership type of organization is useful even if one object doesn’t explicitly own another. Ownership helps establish the relationships between records and how you search for them in the database. Ownership doesn’t require the deletion of the owned records when you delete their owner record. You can prevent such deletions by specifying the CKRecord.ReferenceAction.none action when you create a CKReference object.
Searching for Related Records ¶
When you want to find records for a single owner object, you create a CKReference object and use it to build your search predicate. When you use reference objects in search predicates, the search code looks only at the ID value in the reference object. It matches the ID in records of the specified type with the ID you provide in the CKReference object.
The code sample below shows how to use a reference object to construct a query for the records in the figure above. The `listID` variable is a placeholder for the record ID of the list with the items you want to retrieve. The predicate tells the query object to search the `owningList` field of the target records and compare the reference object there with the one in the `recordToMatch` variable. Executing the query operation object returns the matching records asynchronously to the completion block you provide.
Creating a Reference ¶
- CKReference.InitWithRecordIDAction: Creates a reference object that points to the record with the specified ID.
- CKReference.InitWithRecordAction: Creates a reference object that points to the specified record object.
Getting the Reference Attributes ¶
- CKReference.ReferenceAction: The ownership behavior for the records.
- CKReference.RecordID: The ID of the referenced record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference
func CKReferenceFromID ¶
func CKReferenceFromID(id objc.ID) CKReference
CKReferenceFromID constructs a CKReference from an objc.ID.
A relationship between two records in a record zone.
func NewCKReference ¶
func NewCKReference() CKReference
NewCKReference creates a new CKReference instance.
func NewCKReferenceWithRecordAction ¶
func NewCKReferenceWithRecordAction(record ICKRecord, action CKReferenceAction) CKReference
Creates a reference object that points to the specified record object.
record: The target record of the reference.
action: The ownership options to use for the records. If you specify the CKRecord.ReferenceAction.deleteSelf option, the object that the `recordID` parameter references becomes the owner of (or acts as the parent of) any objects that use this reference object. For a list of possible values, see CKRecord.ReferenceAction.
Return Value ¶
An initialized reference object that points to the specified record.
Discussion ¶
Use this method to initialize a reference to a local record object. You can reference a local record that you create, or one that you fetch from the server.
When you create a reference object for use in a search predicate, the predicate ignores the value in the `action` parameter. Search predicates use only the ID of the record during their comparison.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference/init(record:action:)
func NewCKReferenceWithRecordIDAction ¶
func NewCKReferenceWithRecordIDAction(recordID ICKRecordID, action CKReferenceAction) CKReference
Creates a reference object that points to the record with the specified ID.
recordID: The ID of the target record. This method throws an exception if you specify `nil` for this parameter.
action: The ownership option use between the target record and any records that incorporate this reference object. If you specify the CKRecord.ReferenceAction.deleteSelf option, the record that the `recordID` parameter references becomes the owner of (or acts as the parent of) any objects that use this reference object. For a list of possible values, see CKRecord.ReferenceAction.
Return Value ¶
An initialized reference object that points to the specified record.
Discussion ¶
Use this method when you have only the ID of the record for the target of a link. You might use this method if you save only the ID of the record to a local data cache.
When you create a reference object for use in a search predicate, the predicate ignores the value in the `action` parameter. Search predicates use only the ID of the record during their comparison.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference/init(recordID:action:)
func (CKReference) Autorelease ¶
func (c CKReference) Autorelease() CKReference
Autorelease adds the receiver to the current autorelease pool.
func (CKReference) EncodeWithCoder ¶
func (c CKReference) EncodeWithCoder(coder foundation.INSCoder)
func (CKReference) InitWithRecordAction ¶
func (c CKReference) InitWithRecordAction(record ICKRecord, action CKReferenceAction) CKReference
Creates a reference object that points to the specified record object.
record: The target record of the reference.
action: The ownership options to use for the records. If you specify the CKRecord.ReferenceAction.deleteSelf option, the object that the `recordID` parameter references becomes the owner of (or acts as the parent of) any objects that use this reference object. For a list of possible values, see CKRecord.ReferenceAction.
Return Value ¶
An initialized reference object that points to the specified record.
Discussion ¶
Use this method to initialize a reference to a local record object. You can reference a local record that you create, or one that you fetch from the server.
When you create a reference object for use in a search predicate, the predicate ignores the value in the `action` parameter. Search predicates use only the ID of the record during their comparison.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference/init(record:action:)
func (CKReference) InitWithRecordIDAction ¶
func (c CKReference) InitWithRecordIDAction(recordID ICKRecordID, action CKReferenceAction) CKReference
Creates a reference object that points to the record with the specified ID.
recordID: The ID of the target record. This method throws an exception if you specify `nil` for this parameter.
action: The ownership option use between the target record and any records that incorporate this reference object. If you specify the CKRecord.ReferenceAction.deleteSelf option, the record that the `recordID` parameter references becomes the owner of (or acts as the parent of) any objects that use this reference object. For a list of possible values, see CKRecord.ReferenceAction.
Return Value ¶
An initialized reference object that points to the specified record.
Discussion ¶
Use this method when you have only the ID of the record for the target of a link. You might use this method if you save only the ID of the record to a local data cache.
When you create a reference object for use in a search predicate, the predicate ignores the value in the `action` parameter. Search predicates use only the ID of the record during their comparison.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference/init(recordID:action:)
func (CKReference) RecordID ¶
func (c CKReference) RecordID() ICKRecordID
The ID of the referenced record.
Discussion ¶
Use the ID in this property to fetch the record on the other end of the link.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference/recordID
func (CKReference) ReferenceAction ¶
func (c CKReference) ReferenceAction() CKReferenceAction
The ownership behavior for the records.
Discussion ¶
The value in this property determines which action, if any, to take when deleting the target of the reference object — that is, the object that the CKReference.RecordID property points to. When this property is CKRecord.ReferenceAction.deleteSelf, deleting the target object deletes any records that contain that reference in one of their fields. When this property is CKRecord.ReferenceAction.none, deleting the target object doesn’t delete any additional objects.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference/action-swift.property
type CKReferenceAction ¶
type CKReferenceAction uint
See: https://developer.apple.com/documentation/CloudKit/CKRecord/ReferenceAction
const ( // CKReferenceActionDeleteSelf: A reference action that cascades deletions. CKReferenceActionDeleteSelf CKReferenceAction = 1 // CKReferenceActionNone: A reference action that has no cascading behavior. CKReferenceActionNone CKReferenceAction = 0 )
func (CKReferenceAction) String ¶
func (e CKReferenceAction) String() string
type CKReferenceClass ¶
type CKReferenceClass struct {
// contains filtered or unexported fields
}
func GetCKReferenceClass ¶
func GetCKReferenceClass() CKReferenceClass
GetCKReferenceClass returns the class object for CKReference.
func (CKReferenceClass) Alloc ¶
func (cc CKReferenceClass) Alloc() CKReference
Alloc allocates memory for a new instance of the class.
func (CKReferenceClass) Class ¶
func (cc CKReferenceClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKServerChangeToken ¶
type CKServerChangeToken struct {
objectivec.Object
}
An opaque token that represents a specific point in a database’s history.
Overview ¶
CloudKit uses server change tokens to record significant events in a database’s history, such as record creation, modification, and deletion. Using change tokens helps reduce the cost of a fetch operation — both the time to execute the fetch and the overall number of records it returns.
You don’t create change tokens. Instead, CKFetchDatabaseChangesOperation and CKFetchRecordZoneChangesOperation provide them during their execution and when they complete. Cache each token as you receive it, overwriting any previous token for the database or record zone you’re fetching from. Then, pass the cached token with your next fetch and CloudKit returns only the changes that occur after that point. Don’t infer any behavior or order from a token’s contents.
The change tokens that CKFetchDatabaseChangesOperation provides aren’t compatible with CKFetchRecordZoneChangesOperation and vice versa, so segregate them in your cache.
Change tokens conform to NSSecureCoding and are safe to cache on-disk, as the following example shows:
Initializers ¶
See: https://developer.apple.com/documentation/CloudKit/CKServerChangeToken
func CKServerChangeTokenFromID ¶
func CKServerChangeTokenFromID(id objc.ID) CKServerChangeToken
CKServerChangeTokenFromID constructs a CKServerChangeToken from an objc.ID.
An opaque token that represents a specific point in a database’s history.
func NewCKServerChangeToken ¶
func NewCKServerChangeToken() CKServerChangeToken
NewCKServerChangeToken creates a new CKServerChangeToken instance.
func NewCKServerChangeTokenWithCoder ¶ added in v0.6.10
func NewCKServerChangeTokenWithCoder(coder foundation.INSCoder) CKServerChangeToken
See: https://developer.apple.com/documentation/CloudKit/CKServerChangeToken/init(coder:)
func (CKServerChangeToken) Autorelease ¶
func (c CKServerChangeToken) Autorelease() CKServerChangeToken
Autorelease adds the receiver to the current autorelease pool.
func (CKServerChangeToken) EncodeWithCoder ¶
func (c CKServerChangeToken) EncodeWithCoder(coder foundation.INSCoder)
func (CKServerChangeToken) Init ¶
func (c CKServerChangeToken) Init() CKServerChangeToken
Init initializes the instance.
func (CKServerChangeToken) InitWithCoder ¶ added in v0.6.10
func (c CKServerChangeToken) InitWithCoder(coder foundation.INSCoder) CKServerChangeToken
See: https://developer.apple.com/documentation/CloudKit/CKServerChangeToken/init(coder:)
type CKServerChangeTokenClass ¶
type CKServerChangeTokenClass struct {
// contains filtered or unexported fields
}
func GetCKServerChangeTokenClass ¶
func GetCKServerChangeTokenClass() CKServerChangeTokenClass
GetCKServerChangeTokenClass returns the class object for CKServerChangeToken.
func (CKServerChangeTokenClass) Alloc ¶
func (cc CKServerChangeTokenClass) Alloc() CKServerChangeToken
Alloc allocates memory for a new instance of the class.
func (CKServerChangeTokenClass) Class ¶
func (cc CKServerChangeTokenClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKServerChangeTokenHandler ¶
type CKServerChangeTokenHandler = func(*CKServerChangeToken)
CKServerChangeTokenHandler is the signature for a completion handler block.
type CKShare ¶
type CKShare struct {
}
A specialized record type that manages a collection of shared records.
Overview ¶
A share is a specialized record type that facilitates the sharing of one or more records with many participants. You store shareable records in a custom record zone in the user’s private database. As you create records in that zone, they become eligible for record zone sharing. If you want to share a specific hierarchy of related records, rather than the entire record zone, set each record’s CKRecord.Parent property to define the relationship with its parent. CloudKit infers the shared hierarchy using only the CKRecord.Parent property, and ignores any custom reference fields.
You create a share with either the ID of the record zone to share, or the root record, which defines the point in a record hierarchy where you want to start sharing. CloudKit shares all the records in the record zone, or every record in the hierarchy below the root. If you set the root record’s CKRecord.Parent property, CloudKit ignores it. A record can take part in only a single share. This applies to every record in the shared record zone or hierarchy. If a record is participating in another share, any attempt to save the share fails, and CloudKit returns an alreadyShared error.
Use CKModifyRecordsOperation to save the share to the server. The initial set of records the share includes must exist on the server or be part of the same save operation to succeed. CloudKit then updates the share’s CKShare.URL property. Use UICloudSharingController to present options to the user for sharing the URL. Otherwise, distribute the URL to any participants you add to the share. You can allow anyone with the URL to take part in the share by setting CKShare.PublicPermission to a value more permissive than CKShare.ParticipantPermission.none.
After CloudKit saves the share, a participant can fetch its corresponding metadata, which includes a reference to the share, information about the user’s participation, and, for shared hierarchies, the root record’s record ID. Create an instance of CKFetchShareMetadataOperation using the share’s URL and add it to the container’s queue to execute it. The operation returns an instance of CKShareMetadata for each URL you provide. This is only applicable if you manually process share acceptance. If a user receives the share URL and taps or clicks it, CloudKit automatically processes their participation.
To determine the configuration of a fetched share, inspect the CKRecordID.RecordName property of its CKRecord.RecordID. If the value is CKRecordNameZoneWideShare, the share is managing a shared record zone; otherwise, it’s managing a shared record hierarchy.
CloudKit limits the number of participants in a share to 100, and each participant must have an active iCloud account. You don’t create participants. Instead, use UICloudSharingController to manage a share’s participants and their permissions. Alternatively, create an instance of CKUserIdentityLookupInfo for each user. Provide the user’s email address or phone number, and use CKFetchShareParticipantsOperation to fetch the corresponding participants. CloudKit queries iCloud for corresponding accounts as part of the operation. If it doesn’t find an account, the server updates the participant’s CKShareParticipant.UserIdentity to reflect that by setting the CKUserIdentity.HasiCloudAccount property to false. CloudKit associates the participant with their iCloud account when they accept the share if they launch the process by tapping or clicking the share URL.
Participants with write permissions can modify or delete any record that you include in the share. However, only the owner can delete a shared hierarchy’s root record. If a participant attempts to delete the share, CloudKit removes the participant. The share remains active for all other participants. If the owner deletes a share that manages a record hierarchy, CloudKit sets the root record’s CKRecord.Share property to `nil`. CloudKit deletes the share if the owner of the shared heirarchy deletes its root record.
You can customize the title and image the system displays when initiating a share or accepting an invitation to participate. You can also provide a custom UTI to indicate the content of the shared records. Use the keys that CKShare.SystemFieldKey defines, as the following example shows:
Creating a Share ¶
- CKShare.InitWithRootRecord: Creates a new share for the specified record.
- CKShare.InitWithRootRecordShareID: Creates a new share for the specified record and record ID.
- CKShare.InitWithRecordZoneID: Creates a new share for the specified record zone.
Accessing the Share’s Attributes ¶
- CKShare.Owner: The participant that represents the share’s owner.
- CKShare.CurrentUserParticipant: The participant that represents the current user.
- CKShare.Participants: An array that contains the share’s participants.
- CKShare.URL: The URL for inviting participants to the share.
Configuring the Share ¶
- CKShare.PublicPermission: The permission for anyone with access to the share’s URL.
- CKShare.SetPublicPermission
- CKShare.AddParticipant: Adds a participant to the share.
- CKShare.RemoveParticipant: Removes a participant from the share.
Instance Properties ¶
- CKShare.AllowsAccessRequests: Indicates whether uninvited users can request access to this share.
- CKShare.SetAllowsAccessRequests
- CKShare.BlockedIdentities: A list of users blocked from requesting access to this share.
- CKShare.Requesters: A list of all uninvited users who have requested access to this share.
Instance Methods ¶
- CKShare.BlockRequesters: Blocks specified users from requesting access to this share.
- CKShare.DenyRequesters: Denies access requests from specified users.
- CKShare.UnblockIdentities: Unblocks previously blocked users, allowing them to request access again.
See: https://developer.apple.com/documentation/CloudKit/CKShare
func CKShareFromID ¶
CKShareFromID constructs a CKShare from an objc.ID.
A specialized record type that manages a collection of shared records.
func NewCKShareWithCoder ¶
func NewCKShareWithCoder(aDecoder foundation.INSCoder) CKShare
Creates a share from a serialized instance.
aDecoder: The coder to use when deserializing the share.
Discussion ¶
When saving a newly created CKShare, you must save the share and its CKShareMetadata.RootRecord in the same CKModifyRecordsOperation batch.
See: https://developer.apple.com/documentation/CloudKit/CKShare/init(coder:)
func NewCKShareWithRecordZoneID ¶
func NewCKShareWithRecordZoneID(recordZoneID ICKRecordZoneID) CKShare
Creates a new share for the specified record zone.
recordZoneID: The ID of the record zone to share.
Discussion ¶
A shared record zone must have the CKRecordZoneCapabilityZoneWideSharing capability. Custom record zones that you create in the user’s private database have this capability by default. A record zone, and the records it contains, can take part in only a single share.
After accepting a share invite, CloudKit adds the records of the shared record zone to a new zone in the participant’s shared database. Use CKFetchDatabaseChangesOperation to fetch the ID of the new record zone. Then configure CKFetchRecordZoneChangesOperation with that record zone ID and execute the operation to fetch the records.
If you use CKFetchShareMetadataOperation to fetch the metadata for a shared record zone, the operation ignores the CKFetchShareMetadataOperation.ShouldFetchRootRecord and CKFetchShareMetadataOperation.RootRecordDesiredKeys properties because, unlike a shared record hierarchy, a record zone doesn’t have a nominated root record.
See: https://developer.apple.com/documentation/CloudKit/CKShare/init(recordZoneID:)
func NewCKShareWithRootRecord ¶
Creates a new share for the specified record.
rootRecord: The record to share.
Discussion ¶
When saving a newly created CKShare, you must save the share and its CKShareMetadata.RootRecord in the same CKModifyRecordsOperation batch.
See: https://developer.apple.com/documentation/CloudKit/CKShare/init(rootRecord:)
func NewCKShareWithRootRecordShareID ¶
func NewCKShareWithRootRecordShareID(rootRecord ICKRecord, shareID ICKRecordID) CKShare
Creates a new share for the specified record and record ID.
rootRecord: The record to share.
shareID: The CKRecordID for the share.
Discussion ¶
When saving a newly created CKShare, save the share and its CKShareMetadata.RootRecord in the same CKModifyRecordsOperation batch.
See: https://developer.apple.com/documentation/CloudKit/CKShare/init(rootRecord:shareID:)
func (CKShare) AddParticipant ¶
func (c CKShare) AddParticipant(participant ICKShareParticipant)
Adds a participant to the share.
participant: The participant to add to the share.
Discussion ¶
If a participant with a matching CKShareParticipant.UserIdentity already exists in the share, the system updates the existing participant’s properties and doesn’t add a new participant.
To modify the list of participants, a share’s CKShare.PublicPermission must be CKShare.ParticipantPermission.none. You can’t mix and match public and private users in the same share. You can only add certain participant types with this API. See CKShareParticipant for more information.
See: https://developer.apple.com/documentation/CloudKit/CKShare/addParticipant(_:)
func (CKShare) AllowsAccessRequests ¶
Indicates whether uninvited users can request access to this share.
Discussion ¶
By default, this property is [NO]. When this property is [YES], uninvited users can request access to the share if they discover the share URL. When this property is [NO], the server prevents uninvited users from requesting access and does not indicate whether the share exists.
Only the share owner or an administrator can modify this property. If another participant attempts to modify this property, CloudKit throws an exception.
See: https://developer.apple.com/documentation/CloudKit/CKShare/allowsAccessRequests
func (CKShare) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (CKShare) BlockRequesters ¶
func (c CKShare) BlockRequesters(requesters []CKShareAccessRequester)
Blocks specified users from requesting access to this share.
requesters: An array of CKShareAccessRequester objects to block.
Discussion ¶
Blocking prevents users from submitting future access requests and removes existing participants from the share. Blocked requesters appear in the CKShare.BlockedIdentities array.
To persist this change, save the share to the server after calling this method.
Only the share owner or an administrator can invoke this method. Attempts by other participants result in an exception.
See: https://developer.apple.com/documentation/CloudKit/CKShare/blockRequesters(_:)
func (CKShare) BlockedIdentities ¶
func (c CKShare) BlockedIdentities() []CKShareBlockedIdentity
A list of users blocked from requesting access to this share.
Discussion ¶
Identities remain in this list until an owner or administrator calls CKShare.UnblockIdentities.
See: https://developer.apple.com/documentation/CloudKit/CKShare/blockedIdentities
func (CKShare) CurrentUserParticipant ¶
func (c CKShare) CurrentUserParticipant() ICKShareParticipant
The participant that represents the current user.
See: https://developer.apple.com/documentation/CloudKit/CKShare/currentUserParticipant
func (CKShare) DenyRequesters ¶
func (c CKShare) DenyRequesters(requesters []CKShareAccessRequester)
Denies access requests from specified users.
requesters: An array of CKShareAccessRequester objects to deny.
Discussion ¶
Use this method to deny pending access requests from uninvited users. CloudKit removes denied requesters from the CKShare.Requesters array. To persist the changes, save the share to the server after calling this method.
After denial, requesters can still submit new access requests unless explicitly blocked using CKShare.BlockRequesters.
Only the share owner or an administrator can invoke this method. Attempts by other participants result in an exception.
See: https://developer.apple.com/documentation/CloudKit/CKShare/denyRequesters(_:)
func (CKShare) InitWithRecordZoneID ¶
func (c CKShare) InitWithRecordZoneID(recordZoneID ICKRecordZoneID) CKShare
Creates a new share for the specified record zone.
recordZoneID: The ID of the record zone to share.
Discussion ¶
A shared record zone must have the CKRecordZoneCapabilityZoneWideSharing capability. Custom record zones that you create in the user’s private database have this capability by default. A record zone, and the records it contains, can take part in only a single share.
After accepting a share invite, CloudKit adds the records of the shared record zone to a new zone in the participant’s shared database. Use CKFetchDatabaseChangesOperation to fetch the ID of the new record zone. Then configure CKFetchRecordZoneChangesOperation with that record zone ID and execute the operation to fetch the records.
If you use CKFetchShareMetadataOperation to fetch the metadata for a shared record zone, the operation ignores the CKFetchShareMetadataOperation.ShouldFetchRootRecord and CKFetchShareMetadataOperation.RootRecordDesiredKeys properties because, unlike a shared record hierarchy, a record zone doesn’t have a nominated root record.
See: https://developer.apple.com/documentation/CloudKit/CKShare/init(recordZoneID:)
func (CKShare) InitWithRootRecord ¶
Creates a new share for the specified record.
rootRecord: The record to share.
Discussion ¶
When saving a newly created CKShare, you must save the share and its CKShareMetadata.RootRecord in the same CKModifyRecordsOperation batch.
See: https://developer.apple.com/documentation/CloudKit/CKShare/init(rootRecord:)
func (CKShare) InitWithRootRecordShareID ¶
func (c CKShare) InitWithRootRecordShareID(rootRecord ICKRecord, shareID ICKRecordID) CKShare
Creates a new share for the specified record and record ID.
rootRecord: The record to share.
shareID: The CKRecordID for the share.
Discussion ¶
When saving a newly created CKShare, save the share and its CKShareMetadata.RootRecord in the same CKModifyRecordsOperation batch.
See: https://developer.apple.com/documentation/CloudKit/CKShare/init(rootRecord:shareID:)
func (CKShare) Owner ¶
func (c CKShare) Owner() ICKShareParticipant
The participant that represents the share’s owner.
See: https://developer.apple.com/documentation/CloudKit/CKShare/owner
func (CKShare) Participants ¶
func (c CKShare) Participants() []CKShareParticipant
An array that contains the share’s participants.
Discussion ¶
The property’s value contains all of the share’s participants that the current user has permissions to see. At a minimum, it includes the share’s owner and the current user.
See: https://developer.apple.com/documentation/CloudKit/CKShare/participants
func (CKShare) PublicPermission ¶
func (c CKShare) PublicPermission() CKShareParticipantPermission
The permission for anyone with access to the share’s URL.
Discussion ¶
Setting this property’s value to be more permissive than CKShare.ParticipantPermission.none allows any user with the share’s URL to join. CloudKit removes all public participants when you save the share if you set the property’s value to CKShare.ParticipantPermission.none.
The default value is CKShare.ParticipantPermission.none
See: https://developer.apple.com/documentation/CloudKit/CKShare/publicPermission
func (CKShare) RemoveParticipant ¶
func (c CKShare) RemoveParticipant(participant ICKShareParticipant)
Removes a participant from the share.
participant: The participant to remove from the share.
Discussion ¶
To modify the list of participants, a share’s CKShare.PublicPermission must be CKShare.ParticipantPermission.none. You can’t mix and match public and private users in the same share. You can only add certain participant types with this API. See CKShareParticipant for more information.
See: https://developer.apple.com/documentation/CloudKit/CKShare/removeParticipant(_:)
func (CKShare) Requesters ¶
func (c CKShare) Requesters() []CKShareAccessRequester
A list of all uninvited users who have requested access to this share.
Discussion ¶
When share access requests are allowed, uninvited users can request to join the share. All pending access requests appear in this array. Each requester is returned with name components and either an email or phone number.
Either share owners or administrators can respond to these access requests.
Responding to Access Requests: ¶
- - Fetch the participant information by running CKFetchShareParticipantsOperation with the requester’s CKShareAccessRequester.ParticipantLookupInfo. - Add the resulting participant to the share. - - Use CKShare.DenyRequesters to remove the requester from the requesters list. - - Use CKShare.BlockRequesters to block requesters. - Blocking a requester prevents them from sending future access requests to the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/requesters
func (CKShare) SetAllowsAccessRequests ¶
func (CKShare) SetPublicPermission ¶
func (c CKShare) SetPublicPermission(value CKShareParticipantPermission)
func (CKShare) SetUserIdentity ¶
func (c CKShare) SetUserIdentity(value ICKUserIdentity)
func (CKShare) URL ¶
func (c CKShare) URL() foundation.NSURL
The URL for inviting participants to the share.
Discussion ¶
This property is only available after saving a share record to the server. This URL is stable and persists across shares and reshares of the same root record.
See: https://developer.apple.com/documentation/CloudKit/CKShare/url
func (CKShare) UnblockIdentities ¶
func (c CKShare) UnblockIdentities(blockedIdentities []CKShareBlockedIdentity)
Unblocks previously blocked users, allowing them to request access again.
blockedIdentities: An array of CKShareBlockedIdentity objects to unblock.
Discussion ¶
Use this method to remove specified identities from the CKShare.BlockedIdentities array. Unblocked identities can request access again if access requests are enabled.
To persist this change, save the share to the server after calling this method.
Only the share owner or an administrator can invoke this method. Attempts by other participants result in an exception.
See: https://developer.apple.com/documentation/CloudKit/CKShare/unblockIdentities(_:)
func (CKShare) UserIdentity ¶
func (c CKShare) UserIdentity() ICKUserIdentity
The identity of the participant.
See: https://developer.apple.com/documentation/cloudkit/ckshare/participant/useridentity
type CKShareAccessRequester ¶
type CKShareAccessRequester struct {
}
Instance Properties ¶
- CKShareAccessRequester.Contact: A displayable [CNContact] representing the requester.
- CKShareAccessRequester.ParticipantLookupInfo: Lookup information for the requester.
- CKShareAccessRequester.UserIdentity: The identity of the user requesting access to the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/AccessRequester
func CKShareAccessRequesterFromID ¶
func CKShareAccessRequesterFromID(id objc.ID) CKShareAccessRequester
CKShareAccessRequesterFromID constructs a CKShareAccessRequester from an objc.ID.
func NewCKShareAccessRequester ¶
func NewCKShareAccessRequester() CKShareAccessRequester
NewCKShareAccessRequester creates a new CKShareAccessRequester instance.
func (CKShareAccessRequester) Autorelease ¶
func (c CKShareAccessRequester) Autorelease() CKShareAccessRequester
Autorelease adds the receiver to the current autorelease pool.
func (CKShareAccessRequester) Contact ¶
func (c CKShareAccessRequester) Contact() unsafe.Pointer
A displayable [CNContact] representing the requester.
Discussion ¶
If the requester doesn’t exist in the user’s contacts or is not accessible, returns a newly created [CNContact]. This provides formatted requester information suitable for display in the application’s UI.
See: https://developer.apple.com/documentation/CloudKit/CKShare/AccessRequester/contact
func (CKShareAccessRequester) EncodeWithCoder ¶
func (c CKShareAccessRequester) EncodeWithCoder(coder foundation.INSCoder)
func (CKShareAccessRequester) Init ¶
func (c CKShareAccessRequester) Init() CKShareAccessRequester
Init initializes the instance.
func (CKShareAccessRequester) ParticipantLookupInfo ¶
func (c CKShareAccessRequester) ParticipantLookupInfo() ICKUserIdentityLookupInfo
Lookup information for the requester.
Discussion ¶
Use this lookup info with CKFetchShareParticipantsOperation to fetch the corresponding participant. Once fetched, add the participant to the share to approve the requester.
See: https://developer.apple.com/documentation/CloudKit/CKShare/AccessRequester/participantLookupInfo
func (CKShareAccessRequester) UserIdentity ¶
func (c CKShareAccessRequester) UserIdentity() ICKUserIdentity
The identity of the user requesting access to the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/AccessRequester/userIdentity
type CKShareAccessRequesterClass ¶
type CKShareAccessRequesterClass struct {
// contains filtered or unexported fields
}
func GetCKShareAccessRequesterClass ¶
func GetCKShareAccessRequesterClass() CKShareAccessRequesterClass
GetCKShareAccessRequesterClass returns the class object for CKShareAccessRequester.
func (CKShareAccessRequesterClass) Alloc ¶
func (cc CKShareAccessRequesterClass) Alloc() CKShareAccessRequester
Alloc allocates memory for a new instance of the class.
func (CKShareAccessRequesterClass) Class ¶
func (cc CKShareAccessRequesterClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKShareBlockedIdentity ¶
type CKShareBlockedIdentity struct {
}
Instance Properties ¶
- CKShareBlockedIdentity.Contact: A displayable [CNContact] representing the blocked user.
- CKShareBlockedIdentity.UserIdentity: The identity of the user who has been blocked from requesting access to the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/BlockedIdentity
func CKShareBlockedIdentityFromID ¶
func CKShareBlockedIdentityFromID(id objc.ID) CKShareBlockedIdentity
CKShareBlockedIdentityFromID constructs a CKShareBlockedIdentity from an objc.ID.
func NewCKShareBlockedIdentity ¶
func NewCKShareBlockedIdentity() CKShareBlockedIdentity
NewCKShareBlockedIdentity creates a new CKShareBlockedIdentity instance.
func (CKShareBlockedIdentity) Autorelease ¶
func (c CKShareBlockedIdentity) Autorelease() CKShareBlockedIdentity
Autorelease adds the receiver to the current autorelease pool.
func (CKShareBlockedIdentity) Contact ¶
func (c CKShareBlockedIdentity) Contact() unsafe.Pointer
A displayable [CNContact] representing the blocked user.
Discussion ¶
If the blocked identity does not exist in the user’s contacts or is not accessible, returns a newly created [CNContact]. This provides formatted blocked identity information suitable for display in the application’s UI.
See: https://developer.apple.com/documentation/CloudKit/CKShare/BlockedIdentity/contact
func (CKShareBlockedIdentity) EncodeWithCoder ¶
func (c CKShareBlockedIdentity) EncodeWithCoder(coder foundation.INSCoder)
func (CKShareBlockedIdentity) Init ¶
func (c CKShareBlockedIdentity) Init() CKShareBlockedIdentity
Init initializes the instance.
func (CKShareBlockedIdentity) UserIdentity ¶
func (c CKShareBlockedIdentity) UserIdentity() ICKUserIdentity
The identity of the user who has been blocked from requesting access to the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/BlockedIdentity/userIdentity
type CKShareBlockedIdentityClass ¶
type CKShareBlockedIdentityClass struct {
// contains filtered or unexported fields
}
func GetCKShareBlockedIdentityClass ¶
func GetCKShareBlockedIdentityClass() CKShareBlockedIdentityClass
GetCKShareBlockedIdentityClass returns the class object for CKShareBlockedIdentity.
func (CKShareBlockedIdentityClass) Alloc ¶
func (cc CKShareBlockedIdentityClass) Alloc() CKShareBlockedIdentity
Alloc allocates memory for a new instance of the class.
func (CKShareBlockedIdentityClass) Class ¶
func (cc CKShareBlockedIdentityClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKShareClass ¶
type CKShareClass struct {
// contains filtered or unexported fields
}
func GetCKShareClass ¶
func GetCKShareClass() CKShareClass
GetCKShareClass returns the class object for CKShare.
func (CKShareClass) Alloc ¶
func (cc CKShareClass) Alloc() CKShare
Alloc allocates memory for a new instance of the class.
func (CKShareClass) Class ¶
func (cc CKShareClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKShareErrorHandler ¶
CKShareErrorHandler handles The handler to execute when the process finishes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKShareMetadata ¶
type CKShareMetadata struct {
}
An object that describes a shared record’s metadata.
Overview ¶
A share’s metadata is an intermediary object that provides access to the share, its owner, and, for a shared record hierarchy, its root record. Metadata also includes details about the current user’s participation in the share.
You don’t create metadata. CloudKit provides it to your app when the user taps or clicks a share’s CKShare.URL, such as in an email or a message. The method CloudKit calls varies by platform and app configuration, and includes the following:
- For a scene-based iOS app in a running or suspended state, CloudKit calls the windowScene(_:userDidAcceptCloudKitShareWith:) method on your window scene delegate. - For a scene-based iOS app that’s not running, the system launches your app in response to the tap or click, and calls the scene(_:willConnectTo:options:) method on your scene delegate. The `connectionOptions` parameter contains the metadata. Use its cloudKitShareMetadata property to access it. - For an iOS app that doesn’t use scenes, CloudKit calls your app delegate’s application(_:userDidAcceptCloudKitShareWith:) method. - For a macOS app, CloudKit calls your app delegate’s application(_:userDidAcceptCloudKitShareWith:) method. - For a watchOS app, CloudKit calls the userDidAcceptCloudKitShare(with:) method on your watch extension delegate.
Respond by checking the CKShareMetadata.ParticipantStatus of the provided metadata. If the status is `pending`, use CKAcceptSharesOperation to accept participation in the share. You can also fetch metadata independent of this flow using CKFetchShareMetadataOperation.
For a shared record hierarchy, the CKShareMetadata.HierarchicalRootRecordID property contains the ID of the share’s root record. When using CKFetchShareMetadataOperation to fetch metadata, you can include the entire root record by setting the operation’s CKFetchShareMetadataOperation.ShouldFetchRootRecord property to true. CloudKit then populates the CKShareMetadata.RootRecord property before it returns the metadata. You can further customize this behavior using the operation’s CKFetchShareMetadataOperation.RootRecordDesiredKeys property to specify which fields to return. This functionality isn’t applicable for a shared record zone because, unlike a shared record hierarchy, it doesn’t have a nominated root record.
The participant properties provide the current user’s acceptance status, permissions, and role. Use these values to determine what functionality to provide to the user. For example, only display editing controls for accepted participants with `readWrite` permissions.
Accessing the Share ¶
- CKShareMetadata.Share: The share that owns the metadata.
- CKShareMetadata.ContainerIdentifier: The ID of the share’s container.
- CKShareMetadata.OwnerIdentity: The identity of the share’s owner.
Accessing the Root Record ¶
- CKShareMetadata.HierarchicalRootRecordID: The record ID of the shared hierarchy’s root record.
- CKShareMetadata.RootRecord: The share’s root record.
Accessing the Participant’s Capabilities ¶
- CKShareMetadata.ParticipantRole: The share’s participant role for the user who retrieves the metadata.
- CKShareMetadata.ParticipantPermission: The share’s permissions for the user who retrieves the metadata.
- CKShareMetadata.ParticipantStatus: The share’s participation status for the user who retrieves the metadata.
- CKShareMetadata.ParticipantType: The share’s participation type for the user who retrieves the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata
func CKShareMetadataFromID ¶
func CKShareMetadataFromID(id objc.ID) CKShareMetadata
CKShareMetadataFromID constructs a CKShareMetadata from an objc.ID.
An object that describes a shared record’s metadata.
func NewCKShareMetadata ¶
func NewCKShareMetadata() CKShareMetadata
NewCKShareMetadata creates a new CKShareMetadata instance.
func (CKShareMetadata) Autorelease ¶
func (c CKShareMetadata) Autorelease() CKShareMetadata
Autorelease adds the receiver to the current autorelease pool.
func (CKShareMetadata) ContainerIdentifier ¶
func (c CKShareMetadata) ContainerIdentifier() string
The ID of the share’s container.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/containerIdentifier
func (CKShareMetadata) EncodeWithCoder ¶
func (c CKShareMetadata) EncodeWithCoder(coder foundation.INSCoder)
func (CKShareMetadata) HierarchicalRootRecordID ¶
func (c CKShareMetadata) HierarchicalRootRecordID() ICKRecordID
The record ID of the shared hierarchy’s root record.
Discussion ¶
CloudKit populates this property only for metadata that belongs to a shared record hierarchy. If the metadata is part of a shared record zone, the property is `nil`. This is because, unlike a shared record hierarchy, a shared record zone doesn’t have a nominated root record.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/hierarchicalRootRecordID
func (CKShareMetadata) Init ¶
func (c CKShareMetadata) Init() CKShareMetadata
Init initializes the instance.
func (CKShareMetadata) OwnerIdentity ¶
func (c CKShareMetadata) OwnerIdentity() ICKUserIdentity
The identity of the share’s owner.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/ownerIdentity
func (CKShareMetadata) ParticipantPermission ¶
func (c CKShareMetadata) ParticipantPermission() CKShareParticipantPermission
The share’s permissions for the user who retrieves the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/participantPermission
func (CKShareMetadata) ParticipantRole ¶
func (c CKShareMetadata) ParticipantRole() CKShareParticipantRole
The share’s participant role for the user who retrieves the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/participantRole
func (CKShareMetadata) ParticipantStatus ¶
func (c CKShareMetadata) ParticipantStatus() CKShareParticipantAcceptanceStatus
The share’s participation status for the user who retrieves the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/participantStatus
func (CKShareMetadata) ParticipantType ¶
func (c CKShareMetadata) ParticipantType() unsafe.Pointer
The share’s participation type for the user who retrieves the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/participantType
func (CKShareMetadata) RootRecord ¶
func (c CKShareMetadata) RootRecord() ICKRecord
The share’s root record.
Discussion ¶
This property contains the root record of the shared record hierarchy if you set the CKFetchShareMetadataOperation.ShouldFetchRootRecord property of the operation that fetches the metadata to true. You can specify which fields CloudKit returns by setting the same operation’s CKFetchShareMetadataOperation.RootRecordDesiredKeys property.
The operation ignores the CKFetchShareMetadataOperation.ShouldFetchRootRecord and CKFetchShareMetadataOperation.RootRecordDesiredKeys properties when fetching a shared record zone’s metadata because, unlike a shared record hierarchy, a record zone doesn’t have a nominated root record.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/rootRecord
func (CKShareMetadata) Share ¶
func (c CKShareMetadata) Share() ICKShare
The share that owns the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata/share
type CKShareMetadataClass ¶
type CKShareMetadataClass struct {
// contains filtered or unexported fields
}
func GetCKShareMetadataClass ¶
func GetCKShareMetadataClass() CKShareMetadataClass
GetCKShareMetadataClass returns the class object for CKShareMetadata.
func (CKShareMetadataClass) Alloc ¶
func (cc CKShareMetadataClass) Alloc() CKShareMetadata
Alloc allocates memory for a new instance of the class.
func (CKShareMetadataClass) Class ¶
func (cc CKShareMetadataClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKShareMetadataErrorHandler ¶
type CKShareMetadataErrorHandler = func(*CKShareMetadata, error)
CKShareMetadataErrorHandler handles The handler to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKShareParticipant ¶
type CKShareParticipant struct {
}
An object that describes a user’s participation in a share.
Overview ¶
Participants are a key element of sharing in CloudKit. A participant provides information about an iCloud user and their participation in a share, including their identity, acceptance status, permissions, and role.
The acceptance status determines the participant’s visibilty of the shared records. Statuses are: `pending`, `accepted`, `removed`, and `unknown`. If the status is `pending`, use CKAcceptSharesOperation to accept the share. Upon acceptance, CloudKit makes the shared records available in the participant’s shared database. The records remain accessible for as long as the participant’s status is `accepted`.
You don’t create participants. Use the share’s CKShare.Participants property to access its existing participants. Use UICloudSharingController to manage the share’s participants and their permissions. Alternatively, you can generate participants using CKFetchShareParticipantsOperation. Participants must have an active iCloud account.
Anyone with the URL of a public share can become a participant in that share. Participants of a public share assume the `publicUser` role. For private shares, the owner manages the participants. An owner is any participant with the `owner` role. A participant of a private share can’t accept the share unless the owner adds them first. Private share participants assume the `privateUser` role. CloudKit removes any pending participants if the owner changes the share’s CKShare.PublicPermission. CloudKit removes all participants if the new permission is `none`.
Participants with write permissions can modify or delete any record that you include in the share. However, only the owner can delete a shared hierarchy’s root record. If a participant attempts to delete the share, CloudKit removes the participant. The share remains active for all other participants.
Accessing the Participant’s Status ¶
- CKShareParticipant.AcceptanceStatus: The current state of the user’s acceptance of the share.
Accessing the Participant’s Identity ¶
- CKShareParticipant.UserIdentity: The identity of the participant.
Managing the Participant’s Capabilites ¶
- CKShareParticipant.Permission: The participant’s permission level for the share.
- CKShareParticipant.SetPermission
- CKShareParticipant.Role: The participant’s role for the share.
- CKShareParticipant.SetRole
Instance Properties ¶
- CKShareParticipant.DateAddedToShare: The date and time when the participant was added to the share.
- CKShareParticipant.IsApprovedRequester: Indicates whether the participant was originally a requester who was approved to join the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant
func CKShareParticipantFromID ¶
func CKShareParticipantFromID(id objc.ID) CKShareParticipant
CKShareParticipantFromID constructs a CKShareParticipant from an objc.ID.
An object that describes a user’s participation in a share.
func NewCKShareParticipant ¶
func NewCKShareParticipant() CKShareParticipant
NewCKShareParticipant creates a new CKShareParticipant instance.
func (CKShareParticipant) AcceptanceStatus ¶
func (c CKShareParticipant) AcceptanceStatus() CKShareParticipantAcceptanceStatus
The current state of the user’s acceptance of the share.
Discussion ¶
This property contains the current state of the participant’s acceptance of the share. For a list of possible values, see CKShare.ParticipantAcceptanceStatus.
func (CKShareParticipant) Autorelease ¶
func (c CKShareParticipant) Autorelease() CKShareParticipant
Autorelease adds the receiver to the current autorelease pool.
func (CKShareParticipant) DateAddedToShare ¶
func (c CKShareParticipant) DateAddedToShare() foundation.NSDate
The date and time when the participant was added to the share.
Discussion ¶
This timestamp is set when the share is successfully saved to the server.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant/dateAddedToShare
func (CKShareParticipant) EncodeWithCoder ¶
func (c CKShareParticipant) EncodeWithCoder(coder foundation.INSCoder)
func (CKShareParticipant) Init ¶
func (c CKShareParticipant) Init() CKShareParticipant
Init initializes the instance.
func (CKShareParticipant) IsApprovedRequester ¶
func (c CKShareParticipant) IsApprovedRequester() bool
Indicates whether the participant was originally a requester who was approved to join the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant/isApprovedRequester
func (CKShareParticipant) Permission ¶
func (c CKShareParticipant) Permission() CKShareParticipantPermission
The participant’s permission level for the share.
Discussion ¶
This property controls the permissions that the participant has for the share. For a list of possible values, see CKShare.ParticipantPermission.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant/permission-swift.property
func (CKShareParticipant) Role ¶
func (c CKShareParticipant) Role() CKShareParticipantRole
The participant’s role for the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant/role-swift.property
func (CKShareParticipant) SetPermission ¶
func (c CKShareParticipant) SetPermission(value CKShareParticipantPermission)
func (CKShareParticipant) SetRole ¶
func (c CKShareParticipant) SetRole(value CKShareParticipantRole)
func (CKShareParticipant) UserIdentity ¶
func (c CKShareParticipant) UserIdentity() ICKUserIdentity
The identity of the participant.
Discussion ¶
This property contains a reference to the user identity for the share participant.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant/userIdentity
type CKShareParticipantAcceptanceStatus ¶
type CKShareParticipantAcceptanceStatus int
See: https://developer.apple.com/documentation/CloudKit/CKShare/ParticipantAcceptanceStatus
const ( CKShareParticipantAcceptanceStatusAccepted CKShareParticipantAcceptanceStatus = 2 CKShareParticipantAcceptanceStatusPending CKShareParticipantAcceptanceStatus = 1 CKShareParticipantAcceptanceStatusRemoved CKShareParticipantAcceptanceStatus = 3 CKShareParticipantAcceptanceStatusUnknown CKShareParticipantAcceptanceStatus = 0 )
func (CKShareParticipantAcceptanceStatus) String ¶
func (e CKShareParticipantAcceptanceStatus) String() string
type CKShareParticipantClass ¶
type CKShareParticipantClass struct {
// contains filtered or unexported fields
}
func GetCKShareParticipantClass ¶
func GetCKShareParticipantClass() CKShareParticipantClass
GetCKShareParticipantClass returns the class object for CKShareParticipant.
func (CKShareParticipantClass) Alloc ¶
func (cc CKShareParticipantClass) Alloc() CKShareParticipant
Alloc allocates memory for a new instance of the class.
func (CKShareParticipantClass) Class ¶
func (cc CKShareParticipantClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKShareParticipantClass) OneTimeURLParticipant ¶
func (_CKShareParticipantClass CKShareParticipantClass) OneTimeURLParticipant() CKShareParticipant
Generate a unique URL for inviting a participant without knowing their handle
Discussion ¶
When a participant’s email address / phone number / userRecordID isn’t known up-front, a CKShareParticipantClass.OneTimeURLParticipant can be added to the share. Once the share is saved, a custom invitation link or one-time URL is available for the added participant via oneTimeURLForParticipantID:. This custom link can be used by any recipient user to fetch share metadata and accept the share.
Note that a one-time URL participant in the CKShare.ParticipantAcceptanceStatus.pending state has empty CKUserIdentity.NameComponents and a nil CKUserIdentity.LookupInfo.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant/oneTimeURLParticipant()
type CKShareParticipantErrorHandler ¶
type CKShareParticipantErrorHandler = func(*CKShareParticipant, error)
CKShareParticipantErrorHandler handles The handler to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKShareParticipantPermission ¶
type CKShareParticipantPermission int
See: https://developer.apple.com/documentation/CloudKit/CKShare/ParticipantPermission
const ( CKShareParticipantPermissionNone CKShareParticipantPermission = 1 CKShareParticipantPermissionReadOnly CKShareParticipantPermission = 2 CKShareParticipantPermissionReadWrite CKShareParticipantPermission = 3 CKShareParticipantPermissionUnknown CKShareParticipantPermission = 0 )
func (CKShareParticipantPermission) String ¶
func (e CKShareParticipantPermission) String() string
type CKShareParticipantRole ¶
type CKShareParticipantRole int
See: https://developer.apple.com/documentation/CloudKit/CKShare/ParticipantRole
const ( CKShareParticipantRoleAdministrator CKShareParticipantRole = 2 CKShareParticipantRoleOwner CKShareParticipantRole = 1 CKShareParticipantRolePrivateUser CKShareParticipantRole = 3 CKShareParticipantRolePublicUser CKShareParticipantRole = 4 CKShareParticipantRoleUnknown CKShareParticipantRole = 0 )
func (CKShareParticipantRole) String ¶
func (e CKShareParticipantRole) String() string
type CKSharePreparationCompletionHandler ¶
type CKSharePreparationCompletionHandler = func(CKShare, foundation.NSError)
See: https://developer.apple.com/documentation/CloudKit/CKSharePreparationCompletionHandler
type CKSharePreparationHandler ¶
type CKSharePreparationHandler = func(func(*CKShare, *foundation.NSError))
See: https://developer.apple.com/documentation/CloudKit/CKSharePreparationHandler
type CKShareRequestAccessOperation ¶
type CKShareRequestAccessOperation struct {
}
Initializers ¶
- CKShareRequestAccessOperation.InitWithShareURLs: Creates a share request access operation configured with specified share URLs.
Instance Properties ¶
- CKShareRequestAccessOperation.ShareURLs: The URLs of the shares to request access to.
- CKShareRequestAccessOperation.SetShareURLs
See: https://developer.apple.com/documentation/CloudKit/CKShareRequestAccessOperation
func CKShareRequestAccessOperationFromID ¶
func CKShareRequestAccessOperationFromID(id objc.ID) CKShareRequestAccessOperation
CKShareRequestAccessOperationFromID constructs a CKShareRequestAccessOperation from an objc.ID.
func NewCKShareRequestAccessOperation ¶
func NewCKShareRequestAccessOperation() CKShareRequestAccessOperation
NewCKShareRequestAccessOperation creates a new CKShareRequestAccessOperation instance.
func NewCKShareRequestAccessOperationWithShareURLs ¶
func NewCKShareRequestAccessOperationWithShareURLs(shareURLs []foundation.NSURL) CKShareRequestAccessOperation
Creates a share request access operation configured with specified share URLs.
shareURLs: An array of [NSURL] objects representing the shares to request access to.
Return Value ¶
A configured CKShareRequestAccessOperation instance.
See: https://developer.apple.com/documentation/CloudKit/CKShareRequestAccessOperation/init(shareURLs:)
func (CKShareRequestAccessOperation) Autorelease ¶
func (c CKShareRequestAccessOperation) Autorelease() CKShareRequestAccessOperation
Autorelease adds the receiver to the current autorelease pool.
func (CKShareRequestAccessOperation) Init ¶
func (c CKShareRequestAccessOperation) Init() CKShareRequestAccessOperation
Init initializes the instance.
func (CKShareRequestAccessOperation) InitWithShareURLs ¶
func (c CKShareRequestAccessOperation) InitWithShareURLs(shareURLs []foundation.NSURL) CKShareRequestAccessOperation
Creates a share request access operation configured with specified share URLs.
shareURLs: An array of [NSURL] objects representing the shares to request access to.
Return Value ¶
A configured CKShareRequestAccessOperation instance.
See: https://developer.apple.com/documentation/CloudKit/CKShareRequestAccessOperation/init(shareURLs:)
func (CKShareRequestAccessOperation) SetShareURLs ¶
func (c CKShareRequestAccessOperation) SetShareURLs(value []foundation.NSURL)
func (CKShareRequestAccessOperation) ShareURLs ¶
func (c CKShareRequestAccessOperation) ShareURLs() []foundation.NSURL
The URLs of the shares to request access to.
Discussion ¶
Include multiple URLs to request access to multiple shares simultaneously. The server processes each URL independently.
See: https://developer.apple.com/documentation/CloudKit/CKShareRequestAccessOperation/shareURLs
type CKShareRequestAccessOperationClass ¶
type CKShareRequestAccessOperationClass struct {
// contains filtered or unexported fields
}
func GetCKShareRequestAccessOperationClass ¶
func GetCKShareRequestAccessOperationClass() CKShareRequestAccessOperationClass
GetCKShareRequestAccessOperationClass returns the class object for CKShareRequestAccessOperation.
func (CKShareRequestAccessOperationClass) Alloc ¶
func (cc CKShareRequestAccessOperationClass) Alloc() CKShareRequestAccessOperation
Alloc allocates memory for a new instance of the class.
func (CKShareRequestAccessOperationClass) Class ¶
func (cc CKShareRequestAccessOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSharingParticipantAccessOption ¶
type CKSharingParticipantAccessOption uint
See: https://developer.apple.com/documentation/CloudKit/CKSharingParticipantAccessOption
const ( // CKSharingParticipantAccessOptionAny: The permission option the system uses to control whether a user can share publicly or privately. CKSharingParticipantAccessOptionAny CKSharingParticipantAccessOption = 1 // CKSharingParticipantAccessOptionAnyoneWithLink: The permission option the system uses to control whether a user can share publicly. CKSharingParticipantAccessOptionAnyoneWithLink CKSharingParticipantAccessOption = 1 // CKSharingParticipantAccessOptionSpecifiedRecipientsOnly: The permission option the system uses to control whether a user can share privately. CKSharingParticipantAccessOptionSpecifiedRecipientsOnly CKSharingParticipantAccessOption = 2 )
func (CKSharingParticipantAccessOption) String ¶
func (e CKSharingParticipantAccessOption) String() string
type CKSharingParticipantPermissionOption ¶
type CKSharingParticipantPermissionOption uint
See: https://developer.apple.com/documentation/CloudKit/CKSharingParticipantPermissionOption
const ( // CKSharingParticipantPermissionOptionAny: The permission option the system uses to control whether a user can grant read-only or write access. CKSharingParticipantPermissionOptionAny CKSharingParticipantPermissionOption = 1 // CKSharingParticipantPermissionOptionReadOnly: The permission option the system uses to control whether a user can grant read-only access. CKSharingParticipantPermissionOptionReadOnly CKSharingParticipantPermissionOption = 1 // CKSharingParticipantPermissionOptionReadWrite: The permission option the system uses to control whether a user can grant write access. CKSharingParticipantPermissionOptionReadWrite CKSharingParticipantPermissionOption = 2 )
func (CKSharingParticipantPermissionOption) String ¶
func (e CKSharingParticipantPermissionOption) String() string
type CKSubscription ¶
type CKSubscription struct {
objectivec.Object
}
An abstract base class for subscriptions.
Overview ¶
A subscription acts like a persistent query on the server that can track the creation, deletion, and modification of records. When changes occur, they trigger the delivery of push notifications so that your app can respond appropriately.
Subscriptions don’t become active until you save them to the server and the server has time to index them. To save a subscription, use an instance of CKModifySubscriptionsOperation or the CKDatabase.SaveSubscriptionCompletionHandler method of CKDatabase. To cancel a subscription, delete the corresponding subscription from the server.
Most of a subscription’s configuration happens at initialization time. You must, however, specify how to deliver push notifications to the user’s device. Use the CKSubscription.NotificationInfo property to configure the delivery options. You must save the subscription before the changes take effect.
Handling the Resulting Push Notifications ¶
When CloudKit modifies a record and triggers a subscription, the server sends push notifications to all devices with that subscription except for the one that makes the original changes. For subscription-based push notifications, the server can add data to the notification payload that indicates the condition that triggers the notification. In the application(_:didReceiveRemoteNotification:fetchCompletionHandler:) method of your app delegate, create a CKNotification object from the provided `userInfo` dictionary. You can then query it for the information that’s relevant to the notification.
In addition to sending a record ID with a push notification, you can ask the server to send a limited amount of data from the record that triggers the notification. Use the CKSubscription.DesiredKeys property of the object you assign to CKSubscription.NotificationInfo to specify the keys to include.
APNs limits the size of a push notification’s payload and CloudKit may omit keys and other pieces of data to keep the payload’s size under that limit. If this happens, you can fetch the entire payload from the server using an instance of [CKFetchNotificationChangesOperation]. This operation provides instances of CKQueryNotification or CKRecordZoneNotification, which contain information about the push notifications that CloudKit delivers to your app.
Specifying the Push Notification Data ¶
- CKSubscription.NotificationInfo: The configuration for a subscription’s push notifications.
- CKSubscription.SetNotificationInfo
Accessing the Subscription Metadata ¶
- CKSubscription.SubscriptionID: The subscription’s unique identifier.
- CKSubscription.SetSubscriptionID
- CKSubscription.SubscriptionType: The behavior that a subscription provides.
Initializers ¶
See: https://developer.apple.com/documentation/CloudKit/CKSubscription
func CKSubscriptionFromID ¶
func CKSubscriptionFromID(id objc.ID) CKSubscription
CKSubscriptionFromID constructs a CKSubscription from an objc.ID.
An abstract base class for subscriptions.
func NewCKSubscription ¶
func NewCKSubscription() CKSubscription
NewCKSubscription creates a new CKSubscription instance.
func NewCKSubscriptionWithCoder ¶ added in v0.6.10
func NewCKSubscriptionWithCoder(coder foundation.INSCoder) CKSubscription
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/init(coder:)
func (CKSubscription) Autorelease ¶
func (c CKSubscription) Autorelease() CKSubscription
Autorelease adds the receiver to the current autorelease pool.
func (CKSubscription) DesiredKeys ¶
func (c CKSubscription) DesiredKeys() unsafe.Pointer
The names of fields to include in the push notification’s payload.
func (CKSubscription) EncodeWithCoder ¶
func (c CKSubscription) EncodeWithCoder(coder foundation.INSCoder)
func (CKSubscription) Init ¶
func (c CKSubscription) Init() CKSubscription
Init initializes the instance.
func (CKSubscription) InitWithCoder ¶ added in v0.6.10
func (c CKSubscription) InitWithCoder(coder foundation.INSCoder) CKSubscription
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/init(coder:)
func (CKSubscription) NotificationInfo ¶
func (c CKSubscription) NotificationInfo() ICKNotificationInfo
The configuration for a subscription’s push notifications.
Discussion ¶
If you want the system to display your subscription’s push notifications, assign a value to this property. The server uses the configuration you provide to determine the delivery options for notifications. For example, you can specify the text to display to the user, and the sound to play. You can also specify which fields of the record to include in the notification’s payload.
If you don’t assign a value to this property, CloudKit still sends push notifications, but the system doesn’t display them to the user. The default value of this property is `nil`.
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/notificationInfo-swift.property
func (CKSubscription) SetDesiredKeys ¶
func (c CKSubscription) SetDesiredKeys(value kernel.Pointer)
func (CKSubscription) SetNotificationInfo ¶
func (c CKSubscription) SetNotificationInfo(value ICKNotificationInfo)
func (CKSubscription) SetSubscriptionID ¶
func (c CKSubscription) SetSubscriptionID(value CKSubscriptionID)
func (CKSubscription) SubscriptionID ¶
func (c CKSubscription) SubscriptionID() CKSubscriptionID
The subscription’s unique identifier.
See: https://developer.apple.com/documentation/cloudkit/cksubscription/subscriptionid-6fp3j
func (CKSubscription) SubscriptionType ¶
func (c CKSubscription) SubscriptionType() CKSubscriptionType
The behavior that a subscription provides.
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/subscriptionType-swift.property
type CKSubscriptionArrayErrorHandler ¶
type CKSubscriptionArrayErrorHandler = func(*[]CKSubscription, error)
CKSubscriptionArrayErrorHandler handles The closure to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKSubscriptionClass ¶
type CKSubscriptionClass struct {
// contains filtered or unexported fields
}
func GetCKSubscriptionClass ¶
func GetCKSubscriptionClass() CKSubscriptionClass
GetCKSubscriptionClass returns the class object for CKSubscription.
func (CKSubscriptionClass) Alloc ¶
func (cc CKSubscriptionClass) Alloc() CKSubscription
Alloc allocates memory for a new instance of the class.
func (CKSubscriptionClass) Class ¶
func (cc CKSubscriptionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSubscriptionErrorHandler ¶
type CKSubscriptionErrorHandler = func(*CKSubscription, error)
CKSubscriptionErrorHandler handles The closure to execute after CloudKit saves the subscription. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type CKSubscriptionID ¶
type CKSubscriptionID = string
CKSubscriptionID is a type that represents a subscription’s identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSubscriptionID
type CKSubscriptionType ¶
type CKSubscriptionType int
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/SubscriptionType-swift.enum
const ( // CKSubscriptionTypeDatabase: A constant that indicates the subscription is database-based. CKSubscriptionTypeDatabase CKSubscriptionType = 3 // CKSubscriptionTypeQuery: A constant that indicates the subscription is query-based. CKSubscriptionTypeQuery CKSubscriptionType = 1 // CKSubscriptionTypeRecordZone: A constant that indicates the subscription is zone-based. CKSubscriptionTypeRecordZone CKSubscriptionType = 2 )
func (CKSubscriptionType) String ¶
func (e CKSubscriptionType) String() string
type CKSyncEngine ¶
type CKSyncEngine struct {
objectivec.Object
}
An object that manages the synchronization of local and remote record data.
Overview ¶
Use CKSyncEngine to handle your app’s CloudKit sync operations and benefit from the performance and reliability it provides. To use the class, create an instance early in your app’s launch process and specify a database to sync. Thereafter, and depending on good system conditions, the sync engine periodically pushes and pulls database and record zone changes on the app’s behalf. To participate in those sync operations and to provide the engine with the changes to send, create an object that conforms to CKSyncEngineDelegate and assign an instance of it to the engine’s configuration. You can have multiple instances of CKSyncEngine in a single process, each targeting a different database. For example, you may have one syncing a person’s private database and another syncing their shared database.
Because periodic sync relies on good system conditions — adequate battery charge, an active network connection, a signed-in iCloud account, and so on — the engine’s sync schedule is indeterminate. If you need to sync immediately, like when your app requires it has the most recent changes before continuing, use the CKSyncEngine.FetchChangesWithOptionsCompletionHandler and CKSyncEngine.SendChangesWithOptionsCompletionHandler methods.
The sync engine uses an opaque type to track its internal state, and it’s your responsibility to persist that state to disk and make it available across app launches so the engine can function properly. For more information, see [SyncEngineHandleEvent] and CKSyncEngineStateUpdateEvent.
CKSyncEngine requires the CloudKit and Remote notifications entitlements. For more information, see Configuring iCloud services and Configuring background execution modes.
Send changes to iCloud ¶
A sync engine requires you to tell it about any changes to send, which you do by invoking the CKSyncEngineState.AddPendingDatabaseChanges and CKSyncEngineState.AddPendingRecordZoneChanges methods on the engine’s CKSyncEngine.State property. If there are no scheduled sync operations when you invoke these methods, the engine automatically schedules one. Database changes don’t require any additional input, but the sync engine does expect you to provide the individual record zone changes — in batches — and return them from your delegate’s implementation of [SyncEngineNextRecordZoneChangeBatchForContext]. After the engine sends the changes, it notifies your delegate about their success (or failure) by dispatching events of type CKSyncEngineSentDatabaseChangesEvent and CKSyncEngineSentRecordZoneChangesEvent.
Fetch changes from iCloud ¶
By default, a sync engine attempts to discover an existing CKDatabaseSubscription for the associated database and uses that to receive silent notifications about remote record changes. If the engine doesn’t find a subscription, it automatically creates one to use. On receipt of a notification, the engine schedules a sync operation to fetch the related changes. When that operation runs, the engine dispatches an instance of CKSyncEngineWillFetchChangesEvent to your delegate. As it receives fetched changes, the engine dispatches CKSyncEngineFetchedDatabaseChangesEvent and CKSyncEngineFetchedRecordZoneChangesEvent, accordingly. After the operation finishes, the sync engine notifies your delegate by dispatching an instance of CKSyncEngineDidFetchChangesEvent. You handle all dispatched events in your delegate’s implementation of [SyncEngineHandleEvent].
Sync Scheduling ¶
Automatic sync ¶
By default, the sync engine automatically schedules sync tasks on your behalf. If the user is signed in, the device has a network connection, and the system is generally in a good state, these scheduled syncs happen relatively quickly. However, if the device has no network, is low on power, or is otherwise under a heavy load, these automatic syncs might be delayed. Similarly, if the user isn’t signed in to an account, the sync engine won’t perform any sync tasks at all.
Manual sync ¶
There may be some cases where you want to manually trigger a sync. For example, if you have a pull-to-refresh UI, you can call CKSyncEngine.FetchChangesWithOptionsCompletionHandler to tell the sync engine to fetch immediately. Or, if you have a “backup now” UI, you can call CKSyncEngine.SendChangesWithOptionsCompletionHandler to send to the server immediately.
Error Handling ¶
There are some transient errors that the sync engine handles automatically behind the scenes. The sync engine retries the operations for these transient errors automatically when it makes sense to do so. Specifically, the sync engine will handle the following errors on your behalf:
- CKError.Code.notAuthenticated - CKError.Code.accountTemporarilyUnavailable - CKError.Code.networkFailure - CKError.Code.networkUnavailable - CKError.Code.requestRateLimited - CKError.Code.serviceUnavailable - CKError.Code.zoneBusy
When the sync engine encounters one of these errors, it waits for the system to be in a good state, and tries again. For example, if the server sends back a CKError.Code.requestRateLimited error, the sync engine respects this throttle and tries again after the error’s retry-after time.
CKSyncEngine does handle errors that require application-specific logic. For example, if you try to save a record and get a CKError.Code.serverRecordChanged, you need to handle that error yourself. There are plenty of errors that the sync engine cannot handle on your behalf, see CKError for a list of all the possible errors.
Accounts ¶
CKSyncEngine monitors for account status, and it only syncs if there’s an account signed in. Because of this, you can initialize your CKSyncEngine at any time, regardless of account status. If there is no account, or if the user disabled sync in settings, the sync engine stays dormant in the background. Once an account is available, the sync engine starts syncing automatically.
The sync engine listens for when the user signs in or out of their account. When it notices an account change, it sends an CKSyncEngineAccountChangeEvent to your delegate. It’s your responsibility to react appropriately to this change and update your local persistence.
Creating a sync engine ¶
- CKSyncEngine.InitWithConfiguration: Creates a sync engine with the specified configuration.
Accessing the engine’s attributes ¶
- CKSyncEngine.Database: The associated database.
- CKSyncEngine.State: The sync engine’s state.
Invoking manual sync operations ¶
- CKSyncEngine.FetchChangesWithCompletionHandler: Fetches pending remote changes from the server.
- CKSyncEngine.FetchChangesWithOptionsCompletionHandler: Fetches pending remote changes from the server using the specified options.
- CKSyncEngine.SendChangesWithCompletionHandler: Sends pending local changes to the server.
- CKSyncEngine.SendChangesWithOptionsCompletionHandler: Sends pending local changes to the server using the specified options.
Canceling operations ¶
- CKSyncEngine.CancelOperationsWithCompletionHandler: Cancels any in-progress or pending sync operations.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngine-4b4w9
func CKSyncEngineFromID ¶
func CKSyncEngineFromID(id objc.ID) CKSyncEngine
CKSyncEngineFromID constructs a CKSyncEngine from an objc.ID.
An object that manages the synchronization of local and remote record data.
func NewCKSyncEngine ¶
func NewCKSyncEngine() CKSyncEngine
NewCKSyncEngine creates a new CKSyncEngine instance.
func NewCKSyncEngineWithConfiguration ¶
func NewCKSyncEngineWithConfiguration(configuration ICKSyncEngineConfiguration) CKSyncEngine
Creates a sync engine with the specified configuration.
configuration: The attributes of the new sync engine, such as the associated database and the object to use as the engine’s delegate. For more information, see CKSyncEngineConfiguration.
Return Value ¶
A configured sync engine, or `nil` if CloudKit can’t create one.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngine-4b4w9/initWithConfiguration:
func (CKSyncEngine) Autorelease ¶
func (c CKSyncEngine) Autorelease() CKSyncEngine
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngine) CancelOperations ¶
func (c CKSyncEngine) CancelOperations(ctx context.Context) error
CancelOperations is a synchronous wrapper around CKSyncEngine.CancelOperationsWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKSyncEngine) CancelOperationsWithCompletionHandler ¶
func (c CKSyncEngine) CancelOperationsWithCompletionHandler(completionHandler VoidHandler)
Cancels any in-progress or pending sync operations.
Discussion ¶
The sync engine processes cancelation requests asynchronously, meaning it’s possible for in-progress operations to complete even after this method returns.
func (CKSyncEngine) Database ¶
func (c CKSyncEngine) Database() ICKDatabase
The associated database.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngine-4b4w9/database
func (CKSyncEngine) FetchChanges ¶
func (c CKSyncEngine) FetchChanges(ctx context.Context) error
FetchChanges is a synchronous wrapper around CKSyncEngine.FetchChangesWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKSyncEngine) FetchChangesWithCompletionHandler ¶
func (c CKSyncEngine) FetchChangesWithCompletionHandler(completionHandler ErrorHandler)
Fetches pending remote changes from the server.
completionHandler: The block to execute when the fetch completes.
Discussion ¶
If the fetch fails, the completion handler’s `error` parameter is an object that describes that failure; otherwise, it’s `nil`.
Use this method to ensure the sync engine immediatley fetches all pending remote changes before your app continues. This isn’t necessary in normal use, as the engine automatically syncs your app’s records. It is useful, however, in scenarios where you require more control over sync, such as pull-to-refresh or unit tests.
func (CKSyncEngine) FetchChangesWithOptions ¶
func (c CKSyncEngine) FetchChangesWithOptions(ctx context.Context, options ICKSyncEngineFetchChangesOptions) error
FetchChangesWithOptions is a synchronous wrapper around CKSyncEngine.FetchChangesWithOptionsCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKSyncEngine) FetchChangesWithOptionsCompletionHandler ¶
func (c CKSyncEngine) FetchChangesWithOptionsCompletionHandler(options ICKSyncEngineFetchChangesOptions, completionHandler ErrorHandler)
Fetches pending remote changes from the server using the specified options.
options: The options to use when fetching changes. For more information, see CKSyncEngineFetchChangesOptions.
completionHandler: The block to execute when the fetch completes.
Discussion ¶
If the fetch fails, the completion handler’s `error` parameter is an object that describes that failure; otherwise, it’s `nil`.
Use this method to ensure the sync engine immediatley fetches all pending remote changes before your app continues. This isn’t necessary in normal use, as the engine automatically syncs your app’s records. It is useful, however, in scenarios where you require more control over sync, such as pull-to-refresh or unit tests.
func (CKSyncEngine) InitWithConfiguration ¶
func (c CKSyncEngine) InitWithConfiguration(configuration ICKSyncEngineConfiguration) CKSyncEngine
Creates a sync engine with the specified configuration.
configuration: The attributes of the new sync engine, such as the associated database and the object to use as the engine’s delegate. For more information, see CKSyncEngineConfiguration.
Return Value ¶
A configured sync engine, or `nil` if CloudKit can’t create one.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngine-4b4w9/initWithConfiguration:
func (CKSyncEngine) SendChanges ¶
func (c CKSyncEngine) SendChanges(ctx context.Context) error
SendChanges is a synchronous wrapper around CKSyncEngine.SendChangesWithCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKSyncEngine) SendChangesWithCompletionHandler ¶
func (c CKSyncEngine) SendChangesWithCompletionHandler(completionHandler ErrorHandler)
Sends pending local changes to the server.
completionHandler: The block to execute when the send completes.
Discussion ¶
If the send fails, the completion handler’s `error` parameter is an object that describes that failure; otherwise, it’s `nil`.
Use this method to ensure the sync engine sends all pending local changes to the server before your app continues. This isn’t necessary in normal use, as the engine automatically syncs your app’s records. It is useful, however, in scenarios where you require greater control over sync, such as a “Backup now” button or unit tests.
func (CKSyncEngine) SendChangesWithOptions ¶
func (c CKSyncEngine) SendChangesWithOptions(ctx context.Context, options ICKSyncEngineSendChangesOptions) error
SendChangesWithOptions is a synchronous wrapper around CKSyncEngine.SendChangesWithOptionsCompletionHandler. It blocks until the completion handler fires or the context is cancelled.
func (CKSyncEngine) SendChangesWithOptionsCompletionHandler ¶
func (c CKSyncEngine) SendChangesWithOptionsCompletionHandler(options ICKSyncEngineSendChangesOptions, completionHandler ErrorHandler)
Sends pending local changes to the server using the specified options.
options: The options to use when sending changes. For more information, see CKSyncEngineSendChangesOptions.
completionHandler: The block to execute when the send completes.
Discussion ¶
If the send fails, the completion handler’s `error` parameter is an object that describes that failure; otherwise, it’s `nil`.
Use this method to ensure the sync engine sends all pending local changes to the server before your app continues. This isn’t necessary in normal use, as the engine automatically syncs your app’s records. It is useful, however, in scenarios where you require greater control over sync, such as a “Backup now” button or unit tests.
func (CKSyncEngine) State ¶
func (c CKSyncEngine) State() ICKSyncEngineState
The sync engine’s state.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngine-4b4w9/state
type CKSyncEngineAccountChangeEvent ¶
type CKSyncEngineAccountChangeEvent struct {
CKSyncEngineEvent
}
The user signed in or out of their account.
Overview ¶
The sync engine automatically listens for account changes, and it sends this event when the user signs in or out. It’s your responsibility to react appropriately to this change and update your local persistence.
When the logged-in account changes, the sync engine resets its internal state. This means that it clears any pending database or record zone changes that you may have added.
Note that it’s possible the account changes multiple times while your app is quit. If this happens, you only receive one account change event representing the transition between the last known state and the current state.
Understanding the change ¶
- CKSyncEngineAccountChangeEvent.ChangeType: The iCloud account’s change type.
- CKSyncEngineAccountChangeEvent.PreviousUser: The previous iCloud account’s record identifier.
- CKSyncEngineAccountChangeEvent.CurrentUser: The current iCloud account’s record identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineAccountChangeEvent
func CKSyncEngineAccountChangeEventFromID ¶
func CKSyncEngineAccountChangeEventFromID(id objc.ID) CKSyncEngineAccountChangeEvent
CKSyncEngineAccountChangeEventFromID constructs a CKSyncEngineAccountChangeEvent from an objc.ID.
The user signed in or out of their account.
func NewCKSyncEngineAccountChangeEvent ¶
func NewCKSyncEngineAccountChangeEvent() CKSyncEngineAccountChangeEvent
NewCKSyncEngineAccountChangeEvent creates a new CKSyncEngineAccountChangeEvent instance.
func (CKSyncEngineAccountChangeEvent) Autorelease ¶
func (c CKSyncEngineAccountChangeEvent) Autorelease() CKSyncEngineAccountChangeEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineAccountChangeEvent) ChangeType ¶
func (c CKSyncEngineAccountChangeEvent) ChangeType() CKSyncEngineAccountChangeType
The iCloud account’s change type.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineAccountChangeEvent/changeType
func (CKSyncEngineAccountChangeEvent) CurrentUser ¶
func (c CKSyncEngineAccountChangeEvent) CurrentUser() ICKRecordID
The current iCloud account’s record identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineAccountChangeEvent/currentUser
func (CKSyncEngineAccountChangeEvent) Init ¶
func (c CKSyncEngineAccountChangeEvent) Init() CKSyncEngineAccountChangeEvent
Init initializes the instance.
func (CKSyncEngineAccountChangeEvent) PreviousUser ¶
func (c CKSyncEngineAccountChangeEvent) PreviousUser() ICKRecordID
The previous iCloud account’s record identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineAccountChangeEvent/previousUser
type CKSyncEngineAccountChangeEventClass ¶
type CKSyncEngineAccountChangeEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineAccountChangeEventClass ¶
func GetCKSyncEngineAccountChangeEventClass() CKSyncEngineAccountChangeEventClass
GetCKSyncEngineAccountChangeEventClass returns the class object for CKSyncEngineAccountChangeEvent.
func (CKSyncEngineAccountChangeEventClass) Alloc ¶
func (cc CKSyncEngineAccountChangeEventClass) Alloc() CKSyncEngineAccountChangeEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineAccountChangeEventClass) Class ¶
func (cc CKSyncEngineAccountChangeEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineAccountChangeType ¶
type CKSyncEngineAccountChangeType int
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineAccountChangeType
const ( // CKSyncEngineAccountChangeTypeSignIn: A change indicating a sign-in to an iCloud account. CKSyncEngineAccountChangeTypeSignIn CKSyncEngineAccountChangeType = 0 // CKSyncEngineAccountChangeTypeSignOut: A change indicating a sign-out of an iCloud account. CKSyncEngineAccountChangeTypeSignOut CKSyncEngineAccountChangeType = 1 // CKSyncEngineAccountChangeTypeSwitchAccounts: A change indicating a switch between two iCloud accounts. CKSyncEngineAccountChangeTypeSwitchAccounts CKSyncEngineAccountChangeType = 2 )
func (CKSyncEngineAccountChangeType) String ¶
func (e CKSyncEngineAccountChangeType) String() string
type CKSyncEngineClass ¶
type CKSyncEngineClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineClass ¶
func GetCKSyncEngineClass() CKSyncEngineClass
GetCKSyncEngineClass returns the class object for CKSyncEngine.
func (CKSyncEngineClass) Alloc ¶
func (cc CKSyncEngineClass) Alloc() CKSyncEngine
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineClass) Class ¶
func (cc CKSyncEngineClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineConfiguration ¶
type CKSyncEngineConfiguration struct {
objectivec.Object
}
A type that configures the attributes and behavior of a sync engine.
Creating configurations ¶
- CKSyncEngineConfiguration.InitWithDatabaseStateSerializationDelegate: Creates a configuration for the specified database and serialized state.
Handling record changes ¶
- CKSyncEngineConfiguration.Delegate: The object that provides the records to sync and handles any related events.
- CKSyncEngineConfiguration.SetDelegate
Managing attributes ¶
- CKSyncEngineConfiguration.AutomaticallySync: A Boolean value that determines whether the engine syncs automatically.
- CKSyncEngineConfiguration.SetAutomaticallySync
- CKSyncEngineConfiguration.Database: The associated database.
- CKSyncEngineConfiguration.SetDatabase
- CKSyncEngineConfiguration.SubscriptionID: The subscription identifier for the associated database.
- CKSyncEngineConfiguration.SetSubscriptionID
- CKSyncEngineConfiguration.StateSerialization: The sync engine’s serialized state.
- CKSyncEngineConfiguration.SetStateSerialization
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineConfiguration
func CKSyncEngineConfigurationFromID ¶
func CKSyncEngineConfigurationFromID(id objc.ID) CKSyncEngineConfiguration
CKSyncEngineConfigurationFromID constructs a CKSyncEngineConfiguration from an objc.ID.
A type that configures the attributes and behavior of a sync engine.
func NewCKSyncEngineConfiguration ¶
func NewCKSyncEngineConfiguration() CKSyncEngineConfiguration
NewCKSyncEngineConfiguration creates a new CKSyncEngineConfiguration instance.
func NewCKSyncEngineConfigurationWithDatabaseStateSerializationDelegate ¶
func NewCKSyncEngineConfigurationWithDatabaseStateSerializationDelegate(database ICKDatabase, stateSerialization ICKSyncEngineStateSerialization, delegate CKSyncEngineDelegate) CKSyncEngineConfiguration
Creates a configuration for the specified database and serialized state.
database: The database to sync — either a person’s private database or their shared database.
stateSerialization: If this is the first initialization of the associated sync engine, specify `nil`; otherwise, specify the state from the most recent CKSyncEngineStateUpdateEvent that your delegate handled.
delegate: The object that provides the records to sync and handles any related events.
Return Value ¶
An initialized configuration instance, or `nil` if CloudKit can’t create one.
func (CKSyncEngineConfiguration) AutomaticallySync ¶
func (c CKSyncEngineConfiguration) AutomaticallySync() bool
A Boolean value that determines whether the engine syncs automatically.
Discussion ¶
By default, the sync engine uses the system scheduler to automatically schedule both send and fetch operations. If an operation fails due to a recoverable error, such as a network failure or when the server is enforcing request limits, the engine reschedules those operations as necessary. Unless you have a specific need, prefer to use the default behavior in your app.
If you set this property’s value to false, use CKSyncEngine.FetchChangesWithCompletionHandler and CKSyncEngine.SendChangesWithCompletionHandler to invoke immediate sync operations, allowing for more control over when your app syncs its records. For example, you may want to sync at a specific time of day or deterministically simulate certain conditions in your unit tests.
The default value is true.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineConfiguration/automaticallySync
func (CKSyncEngineConfiguration) Autorelease ¶
func (c CKSyncEngineConfiguration) Autorelease() CKSyncEngineConfiguration
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineConfiguration) Database ¶
func (c CKSyncEngineConfiguration) Database() ICKDatabase
The associated database.
Discussion ¶
Multiple sync engines can run in the same process, each targeting a different database. For example, you may use one sync engine for a person’s private database and another for their shared database.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineConfiguration/database
func (CKSyncEngineConfiguration) Delegate ¶
func (c CKSyncEngineConfiguration) Delegate() CKSyncEngineDelegate
The object that provides the records to sync and handles any related events.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineConfiguration/delegate
func (CKSyncEngineConfiguration) Init ¶
func (c CKSyncEngineConfiguration) Init() CKSyncEngineConfiguration
Init initializes the instance.
func (CKSyncEngineConfiguration) InitWithDatabaseStateSerializationDelegate ¶
func (c CKSyncEngineConfiguration) InitWithDatabaseStateSerializationDelegate(database ICKDatabase, stateSerialization ICKSyncEngineStateSerialization, delegate CKSyncEngineDelegate) CKSyncEngineConfiguration
Creates a configuration for the specified database and serialized state.
database: The database to sync — either a person’s private database or their shared database.
stateSerialization: If this is the first initialization of the associated sync engine, specify `nil`; otherwise, specify the state from the most recent CKSyncEngineStateUpdateEvent that your delegate handled.
delegate: The object that provides the records to sync and handles any related events.
Return Value ¶
An initialized configuration instance, or `nil` if CloudKit can’t create one.
func (CKSyncEngineConfiguration) SetAutomaticallySync ¶
func (c CKSyncEngineConfiguration) SetAutomaticallySync(value bool)
func (CKSyncEngineConfiguration) SetDatabase ¶
func (c CKSyncEngineConfiguration) SetDatabase(value ICKDatabase)
func (CKSyncEngineConfiguration) SetDelegate ¶
func (c CKSyncEngineConfiguration) SetDelegate(value CKSyncEngineDelegate)
func (CKSyncEngineConfiguration) SetStateSerialization ¶
func (c CKSyncEngineConfiguration) SetStateSerialization(value ICKSyncEngineStateSerialization)
func (CKSyncEngineConfiguration) SetSubscriptionID ¶
func (c CKSyncEngineConfiguration) SetSubscriptionID(value CKSubscriptionID)
func (CKSyncEngineConfiguration) StateSerialization ¶
func (c CKSyncEngineConfiguration) StateSerialization() ICKSyncEngineStateSerialization
The sync engine’s serialized state.
Discussion ¶
This property returns the value you specify for the initializer’s `stateSerialization` parameter. If you choose to set this property after initialization, assign the state from the most recent CKSyncEngineStateUpdateEvent handled by your delegate. However, If this is the first initialization of the associated sync engine, specify `nil` instead.
The default value is `nil`.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineConfiguration/stateSerialization
func (CKSyncEngineConfiguration) SubscriptionID ¶
func (c CKSyncEngineConfiguration) SubscriptionID() CKSubscriptionID
The subscription identifier for the associated database.
Discussion ¶
By default, a sync engine attempts to discover an existing subscription for the synced database. If one isn’t found, the engine creates an internal CKDatabaseSubscription and uses that to receive notifications about remote record changes.
If you require the sync engine to use a specific database subscription, assign that subscription’s identifier to this property. Doing so enables your app to be backwards compatible if you’re migrating to CKSyncEngine from a custom CloudKit sync implementation.
The default value is `nil`.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineConfiguration/subscriptionID
type CKSyncEngineConfigurationClass ¶
type CKSyncEngineConfigurationClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineConfigurationClass ¶
func GetCKSyncEngineConfigurationClass() CKSyncEngineConfigurationClass
GetCKSyncEngineConfigurationClass returns the class object for CKSyncEngineConfiguration.
func (CKSyncEngineConfigurationClass) Alloc ¶
func (cc CKSyncEngineConfigurationClass) Alloc() CKSyncEngineConfiguration
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineConfigurationClass) Class ¶
func (cc CKSyncEngineConfigurationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineDelegate ¶
type CKSyncEngineDelegate interface {
objectivec.IObject
// Tells the delegate to handle the specified sync event.
//
// See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDelegate-3c38p/syncEngine:handleEvent:
SyncEngineHandleEvent(syncEngine ICKSyncEngine, event ICKSyncEngineEvent)
// Asks the delegate to provide the next set of record changes to send to the server.
//
// See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDelegate-3c38p/syncEngine:nextRecordZoneChangeBatchForContext:
SyncEngineNextRecordZoneChangeBatchForContext(syncEngine ICKSyncEngine, context ICKSyncEngineSendChangesContext) ICKSyncEngineRecordZoneChangeBatch
// SyncEngineNextFetchChangesOptionsForContext protocol.
//
// See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDelegate-3c38p/syncEngine:nextFetchChangesOptionsForContext:
SyncEngineNextFetchChangesOptionsForContext(syncEngine ICKSyncEngine, context ICKSyncEngineFetchChangesContext) ICKSyncEngineFetchChangesOptions
}
An interface for providing record data to a sync engine and customizing that engine’s behavior.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDelegate-3c38p
type CKSyncEngineDelegateConfig ¶
type CKSyncEngineDelegateConfig struct {
// Other Methods
// SyncEngineHandleEvent — Tells the delegate to handle the specified sync event.
SyncEngineHandleEvent func(syncEngine CKSyncEngine, event CKSyncEngineEvent)
// SyncEngineNextRecordZoneChangeBatchForContext — Asks the delegate to provide the next set of record changes to send to the server.
SyncEngineNextRecordZoneChangeBatchForContext func(syncEngine CKSyncEngine, context CKSyncEngineSendChangesContext) CKSyncEngineRecordZoneChangeBatch
SyncEngineNextFetchChangesOptionsForContext func(syncEngine CKSyncEngine, context CKSyncEngineFetchChangesContext) CKSyncEngineFetchChangesOptions
}
CKSyncEngineDelegateConfig holds optional typed callbacks for CKSyncEngineDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type CKSyncEngineDelegateObject ¶
type CKSyncEngineDelegateObject struct {
objectivec.Object
}
CKSyncEngineDelegateObject wraps an existing Objective-C object that conforms to the CKSyncEngineDelegate protocol.
func CKSyncEngineDelegateObjectFromID ¶
func CKSyncEngineDelegateObjectFromID(id objc.ID) CKSyncEngineDelegateObject
CKSyncEngineDelegateObjectFromID constructs a CKSyncEngineDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func NewCKSyncEngineDelegate ¶
func NewCKSyncEngineDelegate(config CKSyncEngineDelegateConfig) CKSyncEngineDelegateObject
NewCKSyncEngineDelegate creates an Objective-C object implementing the CKSyncEngineDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned CKSyncEngineDelegateObject satisfies the CKSyncEngineDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func (CKSyncEngineDelegateObject) BaseObject ¶
func (o CKSyncEngineDelegateObject) BaseObject() objectivec.Object
func (CKSyncEngineDelegateObject) SyncEngineHandleEvent ¶
func (o CKSyncEngineDelegateObject) SyncEngineHandleEvent(syncEngine ICKSyncEngine, event ICKSyncEngineEvent)
Tells the delegate to handle the specified sync event.
syncEngine: Information about the event. An event may occur for a number of reasons, such as when new data is available or when the device’s iCloud account changes. For more information, see CKSyncEngineEvent.
event: The sync engine that generates the event.
Discussion ¶
The sync engines provides events serially; your delegate won’t receive the subsequent event until it finishes processing the current one and returns from this method.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDelegate-3c38p/syncEngine:handleEvent:
func (CKSyncEngineDelegateObject) SyncEngineNextFetchChangesOptionsForContext ¶
func (o CKSyncEngineDelegateObject) SyncEngineNextFetchChangesOptionsForContext(syncEngine ICKSyncEngine, context ICKSyncEngineFetchChangesContext) ICKSyncEngineFetchChangesOptions
func (CKSyncEngineDelegateObject) SyncEngineNextRecordZoneChangeBatchForContext ¶
func (o CKSyncEngineDelegateObject) SyncEngineNextRecordZoneChangeBatchForContext(syncEngine ICKSyncEngine, context ICKSyncEngineSendChangesContext) ICKSyncEngineRecordZoneChangeBatch
Asks the delegate to provide the next set of record changes to send to the server.
syncEngine: The sync engine requesting changes.
context: The reason for the sync engine’s request, and any additional options that request is using.
Return Value ¶
If there are pending record changes, a batch of those changes for the sync engine to process; otherwise, `nil` to indicate there are no changes to send.
Discussion ¶
In your implementation, ask the sync engine’s state for any pending record zone changes and then return a change batch containing an instance of CKRecord for each record identifier the state provides. For both scheduled and manual send operations, the sync engine calls this method repeatedly until your app has no more changes and returns `nil`.
type CKSyncEngineDidFetchChangesEvent ¶
type CKSyncEngineDidFetchChangesEvent struct {
CKSyncEngineEvent
}
The sync engine finished fetching changes from the server.
Overview ¶
You should receive one CKSyncEngineDidFetchChangesEvent for each CKSyncEngineWillFetchChangesEvent.
Instance Properties ¶
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidFetchChangesEvent
func CKSyncEngineDidFetchChangesEventFromID ¶
func CKSyncEngineDidFetchChangesEventFromID(id objc.ID) CKSyncEngineDidFetchChangesEvent
CKSyncEngineDidFetchChangesEventFromID constructs a CKSyncEngineDidFetchChangesEvent from an objc.ID.
The sync engine finished fetching changes from the server.
func NewCKSyncEngineDidFetchChangesEvent ¶
func NewCKSyncEngineDidFetchChangesEvent() CKSyncEngineDidFetchChangesEvent
NewCKSyncEngineDidFetchChangesEvent creates a new CKSyncEngineDidFetchChangesEvent instance.
func (CKSyncEngineDidFetchChangesEvent) Autorelease ¶
func (c CKSyncEngineDidFetchChangesEvent) Autorelease() CKSyncEngineDidFetchChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineDidFetchChangesEvent) Context ¶
func (c CKSyncEngineDidFetchChangesEvent) Context() ICKSyncEngineFetchChangesContext
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidFetchChangesEvent/context
func (CKSyncEngineDidFetchChangesEvent) Init ¶
func (c CKSyncEngineDidFetchChangesEvent) Init() CKSyncEngineDidFetchChangesEvent
Init initializes the instance.
type CKSyncEngineDidFetchChangesEventClass ¶
type CKSyncEngineDidFetchChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineDidFetchChangesEventClass ¶
func GetCKSyncEngineDidFetchChangesEventClass() CKSyncEngineDidFetchChangesEventClass
GetCKSyncEngineDidFetchChangesEventClass returns the class object for CKSyncEngineDidFetchChangesEvent.
func (CKSyncEngineDidFetchChangesEventClass) Alloc ¶
func (cc CKSyncEngineDidFetchChangesEventClass) Alloc() CKSyncEngineDidFetchChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineDidFetchChangesEventClass) Class ¶
func (cc CKSyncEngineDidFetchChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineDidFetchRecordZoneChangesEvent ¶
type CKSyncEngineDidFetchRecordZoneChangesEvent struct {
CKSyncEngineEvent
}
An object that provides information about a finished record zone fetch.
Identifying the record zone ¶
- CKSyncEngineDidFetchRecordZoneChangesEvent.ZoneID: The associated record zone’s unique identifier.
Handling errors ¶
- CKSyncEngineDidFetchRecordZoneChangesEvent.Error: An error that describes the cause of a failed fetch operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidFetchRecordZoneChangesEvent
func CKSyncEngineDidFetchRecordZoneChangesEventFromID ¶
func CKSyncEngineDidFetchRecordZoneChangesEventFromID(id objc.ID) CKSyncEngineDidFetchRecordZoneChangesEvent
CKSyncEngineDidFetchRecordZoneChangesEventFromID constructs a CKSyncEngineDidFetchRecordZoneChangesEvent from an objc.ID.
An object that provides information about a finished record zone fetch.
func NewCKSyncEngineDidFetchRecordZoneChangesEvent ¶
func NewCKSyncEngineDidFetchRecordZoneChangesEvent() CKSyncEngineDidFetchRecordZoneChangesEvent
NewCKSyncEngineDidFetchRecordZoneChangesEvent creates a new CKSyncEngineDidFetchRecordZoneChangesEvent instance.
func (CKSyncEngineDidFetchRecordZoneChangesEvent) Autorelease ¶
func (c CKSyncEngineDidFetchRecordZoneChangesEvent) Autorelease() CKSyncEngineDidFetchRecordZoneChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineDidFetchRecordZoneChangesEvent) Error ¶
func (c CKSyncEngineDidFetchRecordZoneChangesEvent) Error() foundation.NSError
An error that describes the cause of a failed fetch operation.
Discussion ¶
A `nil` value indicates a successful fetch.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidFetchRecordZoneChangesEvent/error
func (CKSyncEngineDidFetchRecordZoneChangesEvent) Init ¶
func (c CKSyncEngineDidFetchRecordZoneChangesEvent) Init() CKSyncEngineDidFetchRecordZoneChangesEvent
Init initializes the instance.
func (CKSyncEngineDidFetchRecordZoneChangesEvent) ZoneID ¶
func (c CKSyncEngineDidFetchRecordZoneChangesEvent) ZoneID() ICKRecordZoneID
The associated record zone’s unique identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidFetchRecordZoneChangesEvent/zoneID
type CKSyncEngineDidFetchRecordZoneChangesEventClass ¶
type CKSyncEngineDidFetchRecordZoneChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineDidFetchRecordZoneChangesEventClass ¶
func GetCKSyncEngineDidFetchRecordZoneChangesEventClass() CKSyncEngineDidFetchRecordZoneChangesEventClass
GetCKSyncEngineDidFetchRecordZoneChangesEventClass returns the class object for CKSyncEngineDidFetchRecordZoneChangesEvent.
func (CKSyncEngineDidFetchRecordZoneChangesEventClass) Alloc ¶
func (cc CKSyncEngineDidFetchRecordZoneChangesEventClass) Alloc() CKSyncEngineDidFetchRecordZoneChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineDidFetchRecordZoneChangesEventClass) Class ¶
func (cc CKSyncEngineDidFetchRecordZoneChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineDidSendChangesEvent ¶
type CKSyncEngineDidSendChangesEvent struct {
CKSyncEngineEvent
}
An object that provides information about a finished send operation.
Accessing the context ¶
- CKSyncEngineDidSendChangesEvent.Context: The context of the finished send request.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidSendChangesEvent
func CKSyncEngineDidSendChangesEventFromID ¶
func CKSyncEngineDidSendChangesEventFromID(id objc.ID) CKSyncEngineDidSendChangesEvent
CKSyncEngineDidSendChangesEventFromID constructs a CKSyncEngineDidSendChangesEvent from an objc.ID.
An object that provides information about a finished send operation.
func NewCKSyncEngineDidSendChangesEvent ¶
func NewCKSyncEngineDidSendChangesEvent() CKSyncEngineDidSendChangesEvent
NewCKSyncEngineDidSendChangesEvent creates a new CKSyncEngineDidSendChangesEvent instance.
func (CKSyncEngineDidSendChangesEvent) Autorelease ¶
func (c CKSyncEngineDidSendChangesEvent) Autorelease() CKSyncEngineDidSendChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineDidSendChangesEvent) Context ¶
func (c CKSyncEngineDidSendChangesEvent) Context() ICKSyncEngineSendChangesContext
The context of the finished send request.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidSendChangesEvent/context
func (CKSyncEngineDidSendChangesEvent) Init ¶
func (c CKSyncEngineDidSendChangesEvent) Init() CKSyncEngineDidSendChangesEvent
Init initializes the instance.
type CKSyncEngineDidSendChangesEventClass ¶
type CKSyncEngineDidSendChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineDidSendChangesEventClass ¶
func GetCKSyncEngineDidSendChangesEventClass() CKSyncEngineDidSendChangesEventClass
GetCKSyncEngineDidSendChangesEventClass returns the class object for CKSyncEngineDidSendChangesEvent.
func (CKSyncEngineDidSendChangesEventClass) Alloc ¶
func (cc CKSyncEngineDidSendChangesEventClass) Alloc() CKSyncEngineDidSendChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineDidSendChangesEventClass) Class ¶
func (cc CKSyncEngineDidSendChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineEvent ¶
type CKSyncEngineEvent struct {
objectivec.Object
}
An event that occurs during a sync operation.
Overview ¶
All sync operation events descend from this base class, and as such you don’t create instances of it directly. Instead, the sync engine dispatches them to your app’s delegate, periodically, throughout a sync operation.
See the documentation for each event class for more details about when and why an event is posted.
Use the CKSyncEngineEvent.Type property to determine the event’s proper type, and then use the corresponding convenience property to retrieve a reference to the event that’s downcast to the appropriate subclass. For example, when CloudKit vends an event with CKSyncEngineEvent.Type set to CKSyncEngineEventType.stateUpdate, use the CKSyncEngineEvent.StateUpdateEvent property to get the downcast reference.
Determining the type ¶
- CKSyncEngineEvent.Type: The type of event.
Accessing account changes ¶
- CKSyncEngineEvent.AccountChangeEvent: The event downcast to the subclass that represents a change to the device’s iCloud account.
Accessing fetch events ¶
- CKSyncEngineEvent.WillFetchChangesEvent: The event downcast to the subclass that represents an imminent database fetch.
- CKSyncEngineEvent.WillFetchRecordZoneChangesEvent: The event downcast to the subclass that represents an imminent fetch of record zone changes.
- CKSyncEngineEvent.FetchedDatabaseChangesEvent: The event downcast to the subclass that represents a set of fetched database changes to process.
- CKSyncEngineEvent.FetchedRecordZoneChangesEvent: The event downcast to the subclass that represents a set of fetched record zone changes to process.
- CKSyncEngineEvent.DidFetchRecordZoneChangesEvent: The event downcast to the subclass that represents a completed record zone fetch.
- CKSyncEngineEvent.DidFetchChangesEvent: The event downcast to the subclass that represents a completed database fetch.
Accessing send events ¶
- CKSyncEngineEvent.WillSendChangesEvent: The event downcast to the subclass that represents an imminent send operation.
- CKSyncEngineEvent.SentDatabaseChangesEvent: The event downcast to the subclass that represents a sent batch of database changes.
- CKSyncEngineEvent.SentRecordZoneChangesEvent: The event downcast to the subclass that represents a sent batch of record zone changes.
- CKSyncEngineEvent.DidSendChangesEvent: The event downcast to the subclass that represents a completed send operation.
Accessing state updates ¶
- CKSyncEngineEvent.StateUpdateEvent: The event downcast to the subclass that represents an update to the sync engine’s state.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent
func CKSyncEngineEventFromID ¶
func CKSyncEngineEventFromID(id objc.ID) CKSyncEngineEvent
CKSyncEngineEventFromID constructs a CKSyncEngineEvent from an objc.ID.
An event that occurs during a sync operation.
func NewCKSyncEngineEvent ¶
func NewCKSyncEngineEvent() CKSyncEngineEvent
NewCKSyncEngineEvent creates a new CKSyncEngineEvent instance.
func (CKSyncEngineEvent) AccountChangeEvent ¶
func (c CKSyncEngineEvent) AccountChangeEvent() ICKSyncEngineAccountChangeEvent
The event downcast to the subclass that represents a change to the device’s iCloud account.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/accountChangeEvent
func (CKSyncEngineEvent) Autorelease ¶
func (c CKSyncEngineEvent) Autorelease() CKSyncEngineEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineEvent) DidFetchChangesEvent ¶
func (c CKSyncEngineEvent) DidFetchChangesEvent() ICKSyncEngineDidFetchChangesEvent
The event downcast to the subclass that represents a completed database fetch.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/didFetchChangesEvent
func (CKSyncEngineEvent) DidFetchRecordZoneChangesEvent ¶
func (c CKSyncEngineEvent) DidFetchRecordZoneChangesEvent() ICKSyncEngineDidFetchRecordZoneChangesEvent
The event downcast to the subclass that represents a completed record zone fetch.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/didFetchRecordZoneChangesEvent
func (CKSyncEngineEvent) DidSendChangesEvent ¶
func (c CKSyncEngineEvent) DidSendChangesEvent() ICKSyncEngineDidSendChangesEvent
The event downcast to the subclass that represents a completed send operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/didSendChangesEvent
func (CKSyncEngineEvent) FetchedDatabaseChangesEvent ¶
func (c CKSyncEngineEvent) FetchedDatabaseChangesEvent() ICKSyncEngineFetchedDatabaseChangesEvent
The event downcast to the subclass that represents a set of fetched database changes to process.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/fetchedDatabaseChangesEvent
func (CKSyncEngineEvent) FetchedRecordZoneChangesEvent ¶
func (c CKSyncEngineEvent) FetchedRecordZoneChangesEvent() ICKSyncEngineFetchedRecordZoneChangesEvent
The event downcast to the subclass that represents a set of fetched record zone changes to process.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/fetchedRecordZoneChangesEvent
func (CKSyncEngineEvent) Init ¶
func (c CKSyncEngineEvent) Init() CKSyncEngineEvent
Init initializes the instance.
func (CKSyncEngineEvent) SentDatabaseChangesEvent ¶
func (c CKSyncEngineEvent) SentDatabaseChangesEvent() ICKSyncEngineSentDatabaseChangesEvent
The event downcast to the subclass that represents a sent batch of database changes.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/sentDatabaseChangesEvent
func (CKSyncEngineEvent) SentRecordZoneChangesEvent ¶
func (c CKSyncEngineEvent) SentRecordZoneChangesEvent() ICKSyncEngineSentRecordZoneChangesEvent
The event downcast to the subclass that represents a sent batch of record zone changes.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/sentRecordZoneChangesEvent
func (CKSyncEngineEvent) StateUpdateEvent ¶
func (c CKSyncEngineEvent) StateUpdateEvent() ICKSyncEngineStateUpdateEvent
The event downcast to the subclass that represents an update to the sync engine’s state.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/stateUpdateEvent
func (CKSyncEngineEvent) Type ¶
func (c CKSyncEngineEvent) Type() CKSyncEngineEventType
The type of event.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/type
func (CKSyncEngineEvent) WillFetchChangesEvent ¶
func (c CKSyncEngineEvent) WillFetchChangesEvent() ICKSyncEngineWillFetchChangesEvent
The event downcast to the subclass that represents an imminent database fetch.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/willFetchChangesEvent
func (CKSyncEngineEvent) WillFetchRecordZoneChangesEvent ¶
func (c CKSyncEngineEvent) WillFetchRecordZoneChangesEvent() ICKSyncEngineWillFetchRecordZoneChangesEvent
The event downcast to the subclass that represents an imminent fetch of record zone changes.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/willFetchRecordZoneChangesEvent
func (CKSyncEngineEvent) WillSendChangesEvent ¶
func (c CKSyncEngineEvent) WillSendChangesEvent() ICKSyncEngineWillSendChangesEvent
The event downcast to the subclass that represents an imminent send operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent/willSendChangesEvent
type CKSyncEngineEventClass ¶
type CKSyncEngineEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineEventClass ¶
func GetCKSyncEngineEventClass() CKSyncEngineEventClass
GetCKSyncEngineEventClass returns the class object for CKSyncEngineEvent.
func (CKSyncEngineEventClass) Alloc ¶
func (cc CKSyncEngineEventClass) Alloc() CKSyncEngineEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineEventClass) Class ¶
func (cc CKSyncEngineEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineEventType ¶
type CKSyncEngineEventType int
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEventType
const ( // CKSyncEngineEventTypeAccountChange: The user signed in or out of their account. CKSyncEngineEventTypeAccountChange CKSyncEngineEventType = 1 // CKSyncEngineEventTypeDidFetchChanges: The sync engine finished fetching changes from the server. CKSyncEngineEventTypeDidFetchChanges CKSyncEngineEventType = 9 // CKSyncEngineEventTypeDidFetchRecordZoneChanges: The sync engine has completed fetching record zone changes from the server for a specific zone. CKSyncEngineEventTypeDidFetchRecordZoneChanges CKSyncEngineEventType = 8 // CKSyncEngineEventTypeDidSendChanges: The sync engine finished sending changes to the server. CKSyncEngineEventTypeDidSendChanges CKSyncEngineEventType = 11 // CKSyncEngineEventTypeFetchedDatabaseChanges: The sync engine has fetched new database changes from the server. CKSyncEngineEventTypeFetchedDatabaseChanges CKSyncEngineEventType = 2 // CKSyncEngineEventTypeFetchedRecordZoneChanges: The sync engine fetched new record zone changes from the server. CKSyncEngineEventTypeFetchedRecordZoneChanges CKSyncEngineEventType = 3 // CKSyncEngineEventTypeSentDatabaseChanges: The sync engine sent a batch of database changes to the server. CKSyncEngineEventTypeSentDatabaseChanges CKSyncEngineEventType = 4 // CKSyncEngineEventTypeSentRecordZoneChanges: The sync engine sent a batch of record zone changes to the server. CKSyncEngineEventTypeSentRecordZoneChanges CKSyncEngineEventType = 5 // CKSyncEngineEventTypeStateUpdate: The sync engine updated its state. CKSyncEngineEventTypeStateUpdate CKSyncEngineEventType = 0 // CKSyncEngineEventTypeWillFetchChanges: The sync engine is about to fetch changes from the server. CKSyncEngineEventTypeWillFetchChanges CKSyncEngineEventType = 6 // CKSyncEngineEventTypeWillFetchRecordZoneChanges: The sync engine is about to fetch record zone changes from the server for a specific zone. CKSyncEngineEventTypeWillFetchRecordZoneChanges CKSyncEngineEventType = 7 // CKSyncEngineEventTypeWillSendChanges: The sync engine is about to send changes to the server. CKSyncEngineEventTypeWillSendChanges CKSyncEngineEventType = 10 )
func (CKSyncEngineEventType) String ¶
func (e CKSyncEngineEventType) String() string
type CKSyncEngineFailedRecordSave ¶
type CKSyncEngineFailedRecordSave struct {
objectivec.Object
}
A type that describes an unsuccessful attempt to modify an individual record.
Accessing the record ¶
- CKSyncEngineFailedRecordSave.Record: The record that CloudKit is unable to modify.
Accessing the error ¶
- CKSyncEngineFailedRecordSave.Error: A error that describes the reason for the unsuccessful attempt to modify the associated record.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedRecordSave
func CKSyncEngineFailedRecordSaveFromID ¶
func CKSyncEngineFailedRecordSaveFromID(id objc.ID) CKSyncEngineFailedRecordSave
CKSyncEngineFailedRecordSaveFromID constructs a CKSyncEngineFailedRecordSave from an objc.ID.
A type that describes an unsuccessful attempt to modify an individual record.
func NewCKSyncEngineFailedRecordSave ¶
func NewCKSyncEngineFailedRecordSave() CKSyncEngineFailedRecordSave
NewCKSyncEngineFailedRecordSave creates a new CKSyncEngineFailedRecordSave instance.
func (CKSyncEngineFailedRecordSave) Autorelease ¶
func (c CKSyncEngineFailedRecordSave) Autorelease() CKSyncEngineFailedRecordSave
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFailedRecordSave) Error ¶
func (c CKSyncEngineFailedRecordSave) Error() foundation.NSError
A error that describes the reason for the unsuccessful attempt to modify the associated record.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedRecordSave/error
func (CKSyncEngineFailedRecordSave) Init ¶
func (c CKSyncEngineFailedRecordSave) Init() CKSyncEngineFailedRecordSave
Init initializes the instance.
func (CKSyncEngineFailedRecordSave) Record ¶
func (c CKSyncEngineFailedRecordSave) Record() ICKRecord
The record that CloudKit is unable to modify.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedRecordSave/record
type CKSyncEngineFailedRecordSaveClass ¶
type CKSyncEngineFailedRecordSaveClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFailedRecordSaveClass ¶
func GetCKSyncEngineFailedRecordSaveClass() CKSyncEngineFailedRecordSaveClass
GetCKSyncEngineFailedRecordSaveClass returns the class object for CKSyncEngineFailedRecordSave.
func (CKSyncEngineFailedRecordSaveClass) Alloc ¶
func (cc CKSyncEngineFailedRecordSaveClass) Alloc() CKSyncEngineFailedRecordSave
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFailedRecordSaveClass) Class ¶
func (cc CKSyncEngineFailedRecordSaveClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFailedZoneSave ¶
type CKSyncEngineFailedZoneSave struct {
objectivec.Object
}
An object that describes an unsuccessful attempt to modify a single record zone.
Accessing the record zone ¶
- CKSyncEngineFailedZoneSave.RecordZone: The record zone that CloudKit is unable to modify.
Accessing the error ¶
- CKSyncEngineFailedZoneSave.Error: A error that describes the reason for the unsuccessful attempt to modify the associated record zone.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedZoneSave
func CKSyncEngineFailedZoneSaveFromID ¶
func CKSyncEngineFailedZoneSaveFromID(id objc.ID) CKSyncEngineFailedZoneSave
CKSyncEngineFailedZoneSaveFromID constructs a CKSyncEngineFailedZoneSave from an objc.ID.
An object that describes an unsuccessful attempt to modify a single record zone.
func NewCKSyncEngineFailedZoneSave ¶
func NewCKSyncEngineFailedZoneSave() CKSyncEngineFailedZoneSave
NewCKSyncEngineFailedZoneSave creates a new CKSyncEngineFailedZoneSave instance.
func (CKSyncEngineFailedZoneSave) Autorelease ¶
func (c CKSyncEngineFailedZoneSave) Autorelease() CKSyncEngineFailedZoneSave
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFailedZoneSave) Error ¶
func (c CKSyncEngineFailedZoneSave) Error() foundation.NSError
A error that describes the reason for the unsuccessful attempt to modify the associated record zone.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedZoneSave/error
func (CKSyncEngineFailedZoneSave) Init ¶
func (c CKSyncEngineFailedZoneSave) Init() CKSyncEngineFailedZoneSave
Init initializes the instance.
func (CKSyncEngineFailedZoneSave) RecordZone ¶
func (c CKSyncEngineFailedZoneSave) RecordZone() ICKRecordZone
The record zone that CloudKit is unable to modify.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedZoneSave/recordZone
type CKSyncEngineFailedZoneSaveClass ¶
type CKSyncEngineFailedZoneSaveClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFailedZoneSaveClass ¶
func GetCKSyncEngineFailedZoneSaveClass() CKSyncEngineFailedZoneSaveClass
GetCKSyncEngineFailedZoneSaveClass returns the class object for CKSyncEngineFailedZoneSave.
func (CKSyncEngineFailedZoneSaveClass) Alloc ¶
func (cc CKSyncEngineFailedZoneSaveClass) Alloc() CKSyncEngineFailedZoneSave
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFailedZoneSaveClass) Class ¶
func (cc CKSyncEngineFailedZoneSaveClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFetchChangesContext ¶
type CKSyncEngineFetchChangesContext struct {
objectivec.Object
}
The context of an attempt to fetch changes from the server.
Overview ¶
The sync engine might attempt to fetch changes to the server for many reasons. For example, if you call CKSyncEngine.FetchChangesWithCompletionHandler, it tries to fetch changes immediately. Or if it receives a push notification, it schedules a sync and fetch changes when the scheduler task runs.
Instance Properties ¶
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesContext
func CKSyncEngineFetchChangesContextFromID ¶
func CKSyncEngineFetchChangesContextFromID(id objc.ID) CKSyncEngineFetchChangesContext
CKSyncEngineFetchChangesContextFromID constructs a CKSyncEngineFetchChangesContext from an objc.ID.
The context of an attempt to fetch changes from the server.
func NewCKSyncEngineFetchChangesContext ¶
func NewCKSyncEngineFetchChangesContext() CKSyncEngineFetchChangesContext
NewCKSyncEngineFetchChangesContext creates a new CKSyncEngineFetchChangesContext instance.
func (CKSyncEngineFetchChangesContext) Autorelease ¶
func (c CKSyncEngineFetchChangesContext) Autorelease() CKSyncEngineFetchChangesContext
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFetchChangesContext) Init ¶
func (c CKSyncEngineFetchChangesContext) Init() CKSyncEngineFetchChangesContext
Init initializes the instance.
func (CKSyncEngineFetchChangesContext) Options ¶
func (c CKSyncEngineFetchChangesContext) Options() ICKSyncEngineFetchChangesOptions
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesContext/options
func (CKSyncEngineFetchChangesContext) Reason ¶
func (c CKSyncEngineFetchChangesContext) Reason() CKSyncEngineSyncReason
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesContext/reason
type CKSyncEngineFetchChangesContextClass ¶
type CKSyncEngineFetchChangesContextClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFetchChangesContextClass ¶
func GetCKSyncEngineFetchChangesContextClass() CKSyncEngineFetchChangesContextClass
GetCKSyncEngineFetchChangesContextClass returns the class object for CKSyncEngineFetchChangesContext.
func (CKSyncEngineFetchChangesContextClass) Alloc ¶
func (cc CKSyncEngineFetchChangesContextClass) Alloc() CKSyncEngineFetchChangesContext
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFetchChangesContextClass) Class ¶
func (cc CKSyncEngineFetchChangesContextClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFetchChangesOptions ¶
type CKSyncEngineFetchChangesOptions struct {
objectivec.Object
}
A set of options to use with a fetch operation.
Managing attributes ¶
- CKSyncEngineFetchChangesOptions.OperationGroup: The operation group to use for the underlying CloudKit operations.
- CKSyncEngineFetchChangesOptions.SetOperationGroup
Instance Properties ¶
- CKSyncEngineFetchChangesOptions.PrioritizedZoneIDs
- CKSyncEngineFetchChangesOptions.SetPrioritizedZoneIDs
- CKSyncEngineFetchChangesOptions.Scope
- CKSyncEngineFetchChangesOptions.SetScope
Instance Methods ¶
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesOptions
func CKSyncEngineFetchChangesOptionsFromID ¶
func CKSyncEngineFetchChangesOptionsFromID(id objc.ID) CKSyncEngineFetchChangesOptions
CKSyncEngineFetchChangesOptionsFromID constructs a CKSyncEngineFetchChangesOptions from an objc.ID.
A set of options to use with a fetch operation.
func NewCKSyncEngineFetchChangesOptions ¶
func NewCKSyncEngineFetchChangesOptions() CKSyncEngineFetchChangesOptions
NewCKSyncEngineFetchChangesOptions creates a new CKSyncEngineFetchChangesOptions instance.
func NewCKSyncEngineFetchChangesOptionsWithScope ¶
func NewCKSyncEngineFetchChangesOptionsWithScope(scope ICKSyncEngineFetchChangesScope) CKSyncEngineFetchChangesOptions
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesOptions/initWithScope:
func (CKSyncEngineFetchChangesOptions) Autorelease ¶
func (c CKSyncEngineFetchChangesOptions) Autorelease() CKSyncEngineFetchChangesOptions
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFetchChangesOptions) Init ¶
func (c CKSyncEngineFetchChangesOptions) Init() CKSyncEngineFetchChangesOptions
Init initializes the instance.
func (CKSyncEngineFetchChangesOptions) InitWithScope ¶
func (c CKSyncEngineFetchChangesOptions) InitWithScope(scope ICKSyncEngineFetchChangesScope) CKSyncEngineFetchChangesOptions
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesOptions/initWithScope:
func (CKSyncEngineFetchChangesOptions) OperationGroup ¶
func (c CKSyncEngineFetchChangesOptions) OperationGroup() ICKOperationGroup
The operation group to use for the underlying CloudKit operations.
Discussion ¶
The default value is `nil`.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesOptions/operationGroup
func (CKSyncEngineFetchChangesOptions) PrioritizedZoneIDs ¶
func (c CKSyncEngineFetchChangesOptions) PrioritizedZoneIDs() []CKRecordZoneID
func (CKSyncEngineFetchChangesOptions) Scope ¶
func (c CKSyncEngineFetchChangesOptions) Scope() ICKSyncEngineFetchChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesOptions/scope
func (CKSyncEngineFetchChangesOptions) SetOperationGroup ¶
func (c CKSyncEngineFetchChangesOptions) SetOperationGroup(value ICKOperationGroup)
func (CKSyncEngineFetchChangesOptions) SetPrioritizedZoneIDs ¶
func (c CKSyncEngineFetchChangesOptions) SetPrioritizedZoneIDs(value []CKRecordZoneID)
func (CKSyncEngineFetchChangesOptions) SetScope ¶
func (c CKSyncEngineFetchChangesOptions) SetScope(value ICKSyncEngineFetchChangesScope)
type CKSyncEngineFetchChangesOptionsClass ¶
type CKSyncEngineFetchChangesOptionsClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFetchChangesOptionsClass ¶
func GetCKSyncEngineFetchChangesOptionsClass() CKSyncEngineFetchChangesOptionsClass
GetCKSyncEngineFetchChangesOptionsClass returns the class object for CKSyncEngineFetchChangesOptions.
func (CKSyncEngineFetchChangesOptionsClass) Alloc ¶
func (cc CKSyncEngineFetchChangesOptionsClass) Alloc() CKSyncEngineFetchChangesOptions
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFetchChangesOptionsClass) Class ¶
func (cc CKSyncEngineFetchChangesOptionsClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFetchChangesScope ¶
type CKSyncEngineFetchChangesScope struct {
objectivec.Object
}
A scope in which the sync engine will fetch changes from the server.
Instance Properties ¶
Instance Methods ¶
- CKSyncEngineFetchChangesScope.ContainsZoneID
- CKSyncEngineFetchChangesScope.InitWithExcludedZoneIDs
- CKSyncEngineFetchChangesScope.InitWithZoneIDs
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesScope
func CKSyncEngineFetchChangesScopeFromID ¶
func CKSyncEngineFetchChangesScopeFromID(id objc.ID) CKSyncEngineFetchChangesScope
CKSyncEngineFetchChangesScopeFromID constructs a CKSyncEngineFetchChangesScope from an objc.ID.
A scope in which the sync engine will fetch changes from the server.
func NewCKSyncEngineFetchChangesScope ¶
func NewCKSyncEngineFetchChangesScope() CKSyncEngineFetchChangesScope
NewCKSyncEngineFetchChangesScope creates a new CKSyncEngineFetchChangesScope instance.
func NewCKSyncEngineFetchChangesScopeWithExcludedZoneIDs ¶
func NewCKSyncEngineFetchChangesScopeWithExcludedZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
func NewCKSyncEngineFetchChangesScopeWithZoneIDs ¶
func NewCKSyncEngineFetchChangesScopeWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesScope/initWithZoneIDs:
func (CKSyncEngineFetchChangesScope) Autorelease ¶
func (c CKSyncEngineFetchChangesScope) Autorelease() CKSyncEngineFetchChangesScope
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFetchChangesScope) ContainsZoneID ¶
func (c CKSyncEngineFetchChangesScope) ContainsZoneID(zoneID ICKRecordZoneID) bool
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesScope/containsZoneID:
func (CKSyncEngineFetchChangesScope) ExcludedZoneIDs ¶
func (c CKSyncEngineFetchChangesScope) ExcludedZoneIDs() foundation.INSSet
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesScope/excludedZoneIDs
func (CKSyncEngineFetchChangesScope) Init ¶
func (c CKSyncEngineFetchChangesScope) Init() CKSyncEngineFetchChangesScope
Init initializes the instance.
func (CKSyncEngineFetchChangesScope) InitWithExcludedZoneIDs ¶
func (c CKSyncEngineFetchChangesScope) InitWithExcludedZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
func (CKSyncEngineFetchChangesScope) InitWithZoneIDs ¶
func (c CKSyncEngineFetchChangesScope) InitWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesScope/initWithZoneIDs:
func (CKSyncEngineFetchChangesScope) ZoneIDs ¶
func (c CKSyncEngineFetchChangesScope) ZoneIDs() foundation.INSSet
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesScope/zoneIDs
type CKSyncEngineFetchChangesScopeClass ¶
type CKSyncEngineFetchChangesScopeClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFetchChangesScopeClass ¶
func GetCKSyncEngineFetchChangesScopeClass() CKSyncEngineFetchChangesScopeClass
GetCKSyncEngineFetchChangesScopeClass returns the class object for CKSyncEngineFetchChangesScope.
func (CKSyncEngineFetchChangesScopeClass) Alloc ¶
func (cc CKSyncEngineFetchChangesScopeClass) Alloc() CKSyncEngineFetchChangesScope
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFetchChangesScopeClass) Class ¶
func (cc CKSyncEngineFetchChangesScopeClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFetchedDatabaseChangesEvent ¶
type CKSyncEngineFetchedDatabaseChangesEvent struct {
CKSyncEngineEvent
}
An object that provides information about fetched database changes.
Overview ¶
Accessing changes ¶
- CKSyncEngineFetchedDatabaseChangesEvent.Deletions: The deleted record zones.
- CKSyncEngineFetchedDatabaseChangesEvent.Modifications: The modified record zones.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedDatabaseChangesEvent
func CKSyncEngineFetchedDatabaseChangesEventFromID ¶
func CKSyncEngineFetchedDatabaseChangesEventFromID(id objc.ID) CKSyncEngineFetchedDatabaseChangesEvent
CKSyncEngineFetchedDatabaseChangesEventFromID constructs a CKSyncEngineFetchedDatabaseChangesEvent from an objc.ID.
An object that provides information about fetched database changes.
func NewCKSyncEngineFetchedDatabaseChangesEvent ¶
func NewCKSyncEngineFetchedDatabaseChangesEvent() CKSyncEngineFetchedDatabaseChangesEvent
NewCKSyncEngineFetchedDatabaseChangesEvent creates a new CKSyncEngineFetchedDatabaseChangesEvent instance.
func (CKSyncEngineFetchedDatabaseChangesEvent) Autorelease ¶
func (c CKSyncEngineFetchedDatabaseChangesEvent) Autorelease() CKSyncEngineFetchedDatabaseChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFetchedDatabaseChangesEvent) Deletions ¶
func (c CKSyncEngineFetchedDatabaseChangesEvent) Deletions() []CKSyncEngineFetchedZoneDeletion
The deleted record zones.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedDatabaseChangesEvent/deletions
func (CKSyncEngineFetchedDatabaseChangesEvent) Modifications ¶
func (c CKSyncEngineFetchedDatabaseChangesEvent) Modifications() []CKRecordZone
The modified record zones.
type CKSyncEngineFetchedDatabaseChangesEventClass ¶
type CKSyncEngineFetchedDatabaseChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFetchedDatabaseChangesEventClass ¶
func GetCKSyncEngineFetchedDatabaseChangesEventClass() CKSyncEngineFetchedDatabaseChangesEventClass
GetCKSyncEngineFetchedDatabaseChangesEventClass returns the class object for CKSyncEngineFetchedDatabaseChangesEvent.
func (CKSyncEngineFetchedDatabaseChangesEventClass) Alloc ¶
func (cc CKSyncEngineFetchedDatabaseChangesEventClass) Alloc() CKSyncEngineFetchedDatabaseChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFetchedDatabaseChangesEventClass) Class ¶
func (cc CKSyncEngineFetchedDatabaseChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFetchedRecordDeletion ¶
type CKSyncEngineFetchedRecordDeletion struct {
objectivec.Object
}
An object that describes the deletion of an individual record.
Understanding the deletion ¶
- CKSyncEngineFetchedRecordDeletion.RecordID: The deleted record’s unique identifier.
- CKSyncEngineFetchedRecordDeletion.RecordType: The record type of the deleted record.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedRecordDeletion
func CKSyncEngineFetchedRecordDeletionFromID ¶
func CKSyncEngineFetchedRecordDeletionFromID(id objc.ID) CKSyncEngineFetchedRecordDeletion
CKSyncEngineFetchedRecordDeletionFromID constructs a CKSyncEngineFetchedRecordDeletion from an objc.ID.
An object that describes the deletion of an individual record.
func NewCKSyncEngineFetchedRecordDeletion ¶
func NewCKSyncEngineFetchedRecordDeletion() CKSyncEngineFetchedRecordDeletion
NewCKSyncEngineFetchedRecordDeletion creates a new CKSyncEngineFetchedRecordDeletion instance.
func (CKSyncEngineFetchedRecordDeletion) Autorelease ¶
func (c CKSyncEngineFetchedRecordDeletion) Autorelease() CKSyncEngineFetchedRecordDeletion
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFetchedRecordDeletion) Init ¶
func (c CKSyncEngineFetchedRecordDeletion) Init() CKSyncEngineFetchedRecordDeletion
Init initializes the instance.
func (CKSyncEngineFetchedRecordDeletion) RecordID ¶
func (c CKSyncEngineFetchedRecordDeletion) RecordID() ICKRecordID
The deleted record’s unique identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedRecordDeletion/recordID
func (CKSyncEngineFetchedRecordDeletion) RecordType ¶
func (c CKSyncEngineFetchedRecordDeletion) RecordType() CKRecordType
The record type of the deleted record.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedRecordDeletion/recordType
type CKSyncEngineFetchedRecordDeletionClass ¶
type CKSyncEngineFetchedRecordDeletionClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFetchedRecordDeletionClass ¶
func GetCKSyncEngineFetchedRecordDeletionClass() CKSyncEngineFetchedRecordDeletionClass
GetCKSyncEngineFetchedRecordDeletionClass returns the class object for CKSyncEngineFetchedRecordDeletion.
func (CKSyncEngineFetchedRecordDeletionClass) Alloc ¶
func (cc CKSyncEngineFetchedRecordDeletionClass) Alloc() CKSyncEngineFetchedRecordDeletion
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFetchedRecordDeletionClass) Class ¶
func (cc CKSyncEngineFetchedRecordDeletionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFetchedRecordZoneChangesEvent ¶
type CKSyncEngineFetchedRecordZoneChangesEvent struct {
CKSyncEngineEvent
}
An object that provides information about fetched record zone changes.
Overview ¶
Accessing changes ¶
- CKSyncEngineFetchedRecordZoneChangesEvent.Deletions: The deleted records.
- CKSyncEngineFetchedRecordZoneChangesEvent.Modifications: The modified records.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedRecordZoneChangesEvent
func CKSyncEngineFetchedRecordZoneChangesEventFromID ¶
func CKSyncEngineFetchedRecordZoneChangesEventFromID(id objc.ID) CKSyncEngineFetchedRecordZoneChangesEvent
CKSyncEngineFetchedRecordZoneChangesEventFromID constructs a CKSyncEngineFetchedRecordZoneChangesEvent from an objc.ID.
An object that provides information about fetched record zone changes.
func NewCKSyncEngineFetchedRecordZoneChangesEvent ¶
func NewCKSyncEngineFetchedRecordZoneChangesEvent() CKSyncEngineFetchedRecordZoneChangesEvent
NewCKSyncEngineFetchedRecordZoneChangesEvent creates a new CKSyncEngineFetchedRecordZoneChangesEvent instance.
func (CKSyncEngineFetchedRecordZoneChangesEvent) Autorelease ¶
func (c CKSyncEngineFetchedRecordZoneChangesEvent) Autorelease() CKSyncEngineFetchedRecordZoneChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFetchedRecordZoneChangesEvent) Deletions ¶
func (c CKSyncEngineFetchedRecordZoneChangesEvent) Deletions() []CKSyncEngineFetchedRecordDeletion
The deleted records.
func (CKSyncEngineFetchedRecordZoneChangesEvent) Modifications ¶
func (c CKSyncEngineFetchedRecordZoneChangesEvent) Modifications() []CKRecord
The modified records.
type CKSyncEngineFetchedRecordZoneChangesEventClass ¶
type CKSyncEngineFetchedRecordZoneChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFetchedRecordZoneChangesEventClass ¶
func GetCKSyncEngineFetchedRecordZoneChangesEventClass() CKSyncEngineFetchedRecordZoneChangesEventClass
GetCKSyncEngineFetchedRecordZoneChangesEventClass returns the class object for CKSyncEngineFetchedRecordZoneChangesEvent.
func (CKSyncEngineFetchedRecordZoneChangesEventClass) Alloc ¶
func (cc CKSyncEngineFetchedRecordZoneChangesEventClass) Alloc() CKSyncEngineFetchedRecordZoneChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFetchedRecordZoneChangesEventClass) Class ¶
func (cc CKSyncEngineFetchedRecordZoneChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineFetchedZoneDeletion ¶
type CKSyncEngineFetchedZoneDeletion struct {
objectivec.Object
}
An object that describes the deletion of a record zone.
Understanding the deletion ¶
- CKSyncEngineFetchedZoneDeletion.ZoneID: The identifier of the deleted record zone.
- CKSyncEngineFetchedZoneDeletion.Reason: The reason for the deletion.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedZoneDeletion
func CKSyncEngineFetchedZoneDeletionFromID ¶
func CKSyncEngineFetchedZoneDeletionFromID(id objc.ID) CKSyncEngineFetchedZoneDeletion
CKSyncEngineFetchedZoneDeletionFromID constructs a CKSyncEngineFetchedZoneDeletion from an objc.ID.
An object that describes the deletion of a record zone.
func NewCKSyncEngineFetchedZoneDeletion ¶
func NewCKSyncEngineFetchedZoneDeletion() CKSyncEngineFetchedZoneDeletion
NewCKSyncEngineFetchedZoneDeletion creates a new CKSyncEngineFetchedZoneDeletion instance.
func (CKSyncEngineFetchedZoneDeletion) Autorelease ¶
func (c CKSyncEngineFetchedZoneDeletion) Autorelease() CKSyncEngineFetchedZoneDeletion
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineFetchedZoneDeletion) Init ¶
func (c CKSyncEngineFetchedZoneDeletion) Init() CKSyncEngineFetchedZoneDeletion
Init initializes the instance.
func (CKSyncEngineFetchedZoneDeletion) Reason ¶
func (c CKSyncEngineFetchedZoneDeletion) Reason() CKSyncEngineZoneDeletionReason
The reason for the deletion.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedZoneDeletion/reason
func (CKSyncEngineFetchedZoneDeletion) ZoneID ¶
func (c CKSyncEngineFetchedZoneDeletion) ZoneID() ICKRecordZoneID
The identifier of the deleted record zone.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedZoneDeletion/zoneID
type CKSyncEngineFetchedZoneDeletionClass ¶
type CKSyncEngineFetchedZoneDeletionClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineFetchedZoneDeletionClass ¶
func GetCKSyncEngineFetchedZoneDeletionClass() CKSyncEngineFetchedZoneDeletionClass
GetCKSyncEngineFetchedZoneDeletionClass returns the class object for CKSyncEngineFetchedZoneDeletion.
func (CKSyncEngineFetchedZoneDeletionClass) Alloc ¶
func (cc CKSyncEngineFetchedZoneDeletionClass) Alloc() CKSyncEngineFetchedZoneDeletion
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineFetchedZoneDeletionClass) Class ¶
func (cc CKSyncEngineFetchedZoneDeletionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEnginePendingDatabaseChange ¶
type CKSyncEnginePendingDatabaseChange struct {
objectivec.Object
}
An object that describes an unsent database modification.
Understanding the change ¶
- CKSyncEnginePendingDatabaseChange.Type: The type of database change.
- CKSyncEnginePendingDatabaseChange.ZoneID: The identifier of the record zone to change.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingDatabaseChange
func CKSyncEnginePendingDatabaseChangeFromID ¶
func CKSyncEnginePendingDatabaseChangeFromID(id objc.ID) CKSyncEnginePendingDatabaseChange
CKSyncEnginePendingDatabaseChangeFromID constructs a CKSyncEnginePendingDatabaseChange from an objc.ID.
An object that describes an unsent database modification.
func NewCKSyncEnginePendingDatabaseChange ¶
func NewCKSyncEnginePendingDatabaseChange() CKSyncEnginePendingDatabaseChange
NewCKSyncEnginePendingDatabaseChange creates a new CKSyncEnginePendingDatabaseChange instance.
func (CKSyncEnginePendingDatabaseChange) Autorelease ¶
func (c CKSyncEnginePendingDatabaseChange) Autorelease() CKSyncEnginePendingDatabaseChange
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEnginePendingDatabaseChange) Init ¶
func (c CKSyncEnginePendingDatabaseChange) Init() CKSyncEnginePendingDatabaseChange
Init initializes the instance.
func (CKSyncEnginePendingDatabaseChange) Type ¶
The type of database change.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingDatabaseChange/type
func (CKSyncEnginePendingDatabaseChange) ZoneID ¶
func (c CKSyncEnginePendingDatabaseChange) ZoneID() ICKRecordZoneID
The identifier of the record zone to change.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingDatabaseChange/zoneID
type CKSyncEnginePendingDatabaseChangeClass ¶
type CKSyncEnginePendingDatabaseChangeClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEnginePendingDatabaseChangeClass ¶
func GetCKSyncEnginePendingDatabaseChangeClass() CKSyncEnginePendingDatabaseChangeClass
GetCKSyncEnginePendingDatabaseChangeClass returns the class object for CKSyncEnginePendingDatabaseChange.
func (CKSyncEnginePendingDatabaseChangeClass) Alloc ¶
func (cc CKSyncEnginePendingDatabaseChangeClass) Alloc() CKSyncEnginePendingDatabaseChange
Alloc allocates memory for a new instance of the class.
func (CKSyncEnginePendingDatabaseChangeClass) Class ¶
func (cc CKSyncEnginePendingDatabaseChangeClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEnginePendingDatabaseChangeType ¶
type CKSyncEnginePendingDatabaseChangeType int
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingDatabaseChangeType
const ( CKSyncEnginePendingDatabaseChangeTypeDeleteZone CKSyncEnginePendingDatabaseChangeType = 1 CKSyncEnginePendingDatabaseChangeTypeSaveZone CKSyncEnginePendingDatabaseChangeType = 0 )
func (CKSyncEnginePendingDatabaseChangeType) String ¶
func (e CKSyncEnginePendingDatabaseChangeType) String() string
type CKSyncEnginePendingRecordZoneChange ¶
type CKSyncEnginePendingRecordZoneChange struct {
objectivec.Object
}
An object that describes an unsent record modification.
Creating a record zone change ¶
- CKSyncEnginePendingRecordZoneChange.InitWithRecordIDType: Creates a record zone change of the specified type for the given record.
Accessing the modified record ¶
- CKSyncEnginePendingRecordZoneChange.RecordID: The identifier of the modified record.
- CKSyncEnginePendingRecordZoneChange.Type: The type of change to make.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingRecordZoneChange
func CKSyncEnginePendingRecordZoneChangeFromID ¶
func CKSyncEnginePendingRecordZoneChangeFromID(id objc.ID) CKSyncEnginePendingRecordZoneChange
CKSyncEnginePendingRecordZoneChangeFromID constructs a CKSyncEnginePendingRecordZoneChange from an objc.ID.
An object that describes an unsent record modification.
func NewCKSyncEnginePendingRecordZoneChange ¶
func NewCKSyncEnginePendingRecordZoneChange() CKSyncEnginePendingRecordZoneChange
NewCKSyncEnginePendingRecordZoneChange creates a new CKSyncEnginePendingRecordZoneChange instance.
func NewCKSyncEnginePendingRecordZoneChangeWithRecordIDType ¶
func NewCKSyncEnginePendingRecordZoneChangeWithRecordIDType(recordID ICKRecordID, type_ CKSyncEnginePendingRecordZoneChangeType) CKSyncEnginePendingRecordZoneChange
Creates a record zone change of the specified type for the given record.
recordID: The identifier of the record to change.
type: The type of change to make.
Return Value ¶
An initialized record zone change, or `nil` if CloudKit can’t create one.
func (CKSyncEnginePendingRecordZoneChange) Autorelease ¶
func (c CKSyncEnginePendingRecordZoneChange) Autorelease() CKSyncEnginePendingRecordZoneChange
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEnginePendingRecordZoneChange) InitWithRecordIDType ¶
func (c CKSyncEnginePendingRecordZoneChange) InitWithRecordIDType(recordID ICKRecordID, type_ CKSyncEnginePendingRecordZoneChangeType) CKSyncEnginePendingRecordZoneChange
Creates a record zone change of the specified type for the given record.
recordID: The identifier of the record to change.
type: The type of change to make.
Return Value ¶
An initialized record zone change, or `nil` if CloudKit can’t create one.
func (CKSyncEnginePendingRecordZoneChange) RecordID ¶
func (c CKSyncEnginePendingRecordZoneChange) RecordID() ICKRecordID
The identifier of the modified record.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingRecordZoneChange/recordID
func (CKSyncEnginePendingRecordZoneChange) Type ¶
The type of change to make.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingRecordZoneChange/type
type CKSyncEnginePendingRecordZoneChangeClass ¶
type CKSyncEnginePendingRecordZoneChangeClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEnginePendingRecordZoneChangeClass ¶
func GetCKSyncEnginePendingRecordZoneChangeClass() CKSyncEnginePendingRecordZoneChangeClass
GetCKSyncEnginePendingRecordZoneChangeClass returns the class object for CKSyncEnginePendingRecordZoneChange.
func (CKSyncEnginePendingRecordZoneChangeClass) Alloc ¶
func (cc CKSyncEnginePendingRecordZoneChangeClass) Alloc() CKSyncEnginePendingRecordZoneChange
Alloc allocates memory for a new instance of the class.
func (CKSyncEnginePendingRecordZoneChangeClass) Class ¶
func (cc CKSyncEnginePendingRecordZoneChangeClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEnginePendingRecordZoneChangeType ¶
type CKSyncEnginePendingRecordZoneChangeType int
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingRecordZoneChangeType
const ( CKSyncEnginePendingRecordZoneChangeTypeDeleteRecord CKSyncEnginePendingRecordZoneChangeType = 1 CKSyncEnginePendingRecordZoneChangeTypeSaveRecord CKSyncEnginePendingRecordZoneChangeType = 0 )
func (CKSyncEnginePendingRecordZoneChangeType) String ¶
func (e CKSyncEnginePendingRecordZoneChangeType) String() string
type CKSyncEnginePendingZoneDelete ¶
type CKSyncEnginePendingZoneDelete struct {
CKSyncEnginePendingDatabaseChange
}
An object that describes an unsent record zone deletion.
Creating a pending zone delete ¶
- CKSyncEnginePendingZoneDelete.InitWithZoneID: Creates a pending zone delete for the specified record zone identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneDelete
func CKSyncEnginePendingZoneDeleteFromID ¶
func CKSyncEnginePendingZoneDeleteFromID(id objc.ID) CKSyncEnginePendingZoneDelete
CKSyncEnginePendingZoneDeleteFromID constructs a CKSyncEnginePendingZoneDelete from an objc.ID.
An object that describes an unsent record zone deletion.
func NewCKSyncEnginePendingZoneDelete ¶
func NewCKSyncEnginePendingZoneDelete() CKSyncEnginePendingZoneDelete
NewCKSyncEnginePendingZoneDelete creates a new CKSyncEnginePendingZoneDelete instance.
func NewCKSyncEnginePendingZoneDeleteWithZoneID ¶
func NewCKSyncEnginePendingZoneDeleteWithZoneID(zoneID ICKRecordZoneID) CKSyncEnginePendingZoneDelete
Creates a pending zone delete for the specified record zone identifier.
zoneID: The unique identifier of the record zone to delete.
Return Value ¶
An initialized pending zone delete, or `nil` if CloudKit can’t create it.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneDelete/initWithZoneID:
func (CKSyncEnginePendingZoneDelete) Autorelease ¶
func (c CKSyncEnginePendingZoneDelete) Autorelease() CKSyncEnginePendingZoneDelete
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEnginePendingZoneDelete) Init ¶
func (c CKSyncEnginePendingZoneDelete) Init() CKSyncEnginePendingZoneDelete
Init initializes the instance.
func (CKSyncEnginePendingZoneDelete) InitWithZoneID ¶
func (c CKSyncEnginePendingZoneDelete) InitWithZoneID(zoneID ICKRecordZoneID) CKSyncEnginePendingZoneDelete
Creates a pending zone delete for the specified record zone identifier.
zoneID: The unique identifier of the record zone to delete.
Return Value ¶
An initialized pending zone delete, or `nil` if CloudKit can’t create it.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneDelete/initWithZoneID:
type CKSyncEnginePendingZoneDeleteClass ¶
type CKSyncEnginePendingZoneDeleteClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEnginePendingZoneDeleteClass ¶
func GetCKSyncEnginePendingZoneDeleteClass() CKSyncEnginePendingZoneDeleteClass
GetCKSyncEnginePendingZoneDeleteClass returns the class object for CKSyncEnginePendingZoneDelete.
func (CKSyncEnginePendingZoneDeleteClass) Alloc ¶
func (cc CKSyncEnginePendingZoneDeleteClass) Alloc() CKSyncEnginePendingZoneDelete
Alloc allocates memory for a new instance of the class.
func (CKSyncEnginePendingZoneDeleteClass) Class ¶
func (cc CKSyncEnginePendingZoneDeleteClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEnginePendingZoneSave ¶
type CKSyncEnginePendingZoneSave struct {
CKSyncEnginePendingDatabaseChange
}
An object that describes an unsent record zone modification.
Creating a pending zone save ¶
- CKSyncEnginePendingZoneSave.InitWithZone: Creates a pending zone save for the specified record zone.
Identifying the record zone ¶
- CKSyncEnginePendingZoneSave.Zone: The record zone to save.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneSave
func CKSyncEnginePendingZoneSaveFromID ¶
func CKSyncEnginePendingZoneSaveFromID(id objc.ID) CKSyncEnginePendingZoneSave
CKSyncEnginePendingZoneSaveFromID constructs a CKSyncEnginePendingZoneSave from an objc.ID.
An object that describes an unsent record zone modification.
func NewCKSyncEnginePendingZoneSave ¶
func NewCKSyncEnginePendingZoneSave() CKSyncEnginePendingZoneSave
NewCKSyncEnginePendingZoneSave creates a new CKSyncEnginePendingZoneSave instance.
func NewCKSyncEnginePendingZoneSaveWithZone ¶
func NewCKSyncEnginePendingZoneSaveWithZone(zone ICKRecordZone) CKSyncEnginePendingZoneSave
Creates a pending zone save for the specified record zone.
zone: The record zone to save.
Return Value ¶
An initialized pending zone save, or `nil` if CloudKit can’t create it.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneSave/initWithZone:
func (CKSyncEnginePendingZoneSave) Autorelease ¶
func (c CKSyncEnginePendingZoneSave) Autorelease() CKSyncEnginePendingZoneSave
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEnginePendingZoneSave) Init ¶
func (c CKSyncEnginePendingZoneSave) Init() CKSyncEnginePendingZoneSave
Init initializes the instance.
func (CKSyncEnginePendingZoneSave) InitWithZone ¶
func (c CKSyncEnginePendingZoneSave) InitWithZone(zone ICKRecordZone) CKSyncEnginePendingZoneSave
Creates a pending zone save for the specified record zone.
zone: The record zone to save.
Return Value ¶
An initialized pending zone save, or `nil` if CloudKit can’t create it.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneSave/initWithZone:
func (CKSyncEnginePendingZoneSave) Zone ¶
func (c CKSyncEnginePendingZoneSave) Zone() ICKRecordZone
The record zone to save.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneSave/zone
type CKSyncEnginePendingZoneSaveClass ¶
type CKSyncEnginePendingZoneSaveClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEnginePendingZoneSaveClass ¶
func GetCKSyncEnginePendingZoneSaveClass() CKSyncEnginePendingZoneSaveClass
GetCKSyncEnginePendingZoneSaveClass returns the class object for CKSyncEnginePendingZoneSave.
func (CKSyncEnginePendingZoneSaveClass) Alloc ¶
func (cc CKSyncEnginePendingZoneSaveClass) Alloc() CKSyncEnginePendingZoneSave
Alloc allocates memory for a new instance of the class.
func (CKSyncEnginePendingZoneSaveClass) Class ¶
func (cc CKSyncEnginePendingZoneSaveClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineRecordZoneChangeBatch ¶
type CKSyncEngineRecordZoneChangeBatch struct {
objectivec.Object
}
An object that contains the record changes for a single send operation.
Creating a batch ¶
- CKSyncEngineRecordZoneChangeBatch.InitWithPendingChangesRecordProvider: Creates a batch of records to modify using the provided record zone changes.
- CKSyncEngineRecordZoneChangeBatch.InitWithRecordsToSaveRecordIDsToDeleteAtomicByZone: Creates a batch of records to modify.
Managing atomicity ¶
- CKSyncEngineRecordZoneChangeBatch.AtomicByZone: A Boolean value that determines whether CloudKit modifies records atomically by record zone.
- CKSyncEngineRecordZoneChangeBatch.SetAtomicByZone
Managing the records ¶
- CKSyncEngineRecordZoneChangeBatch.RecordIDsToDelete: The unique identifiers of the records to delete.
- CKSyncEngineRecordZoneChangeBatch.RecordsToSave: The records to save.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineRecordZoneChangeBatch
func CKSyncEngineRecordZoneChangeBatchFromID ¶
func CKSyncEngineRecordZoneChangeBatchFromID(id objc.ID) CKSyncEngineRecordZoneChangeBatch
CKSyncEngineRecordZoneChangeBatchFromID constructs a CKSyncEngineRecordZoneChangeBatch from an objc.ID.
An object that contains the record changes for a single send operation.
func NewCKSyncEngineRecordZoneChangeBatch ¶
func NewCKSyncEngineRecordZoneChangeBatch() CKSyncEngineRecordZoneChangeBatch
NewCKSyncEngineRecordZoneChangeBatch creates a new CKSyncEngineRecordZoneChangeBatch instance.
func NewCKSyncEngineRecordZoneChangeBatchWithRecordsToSaveRecordIDsToDeleteAtomicByZone ¶
func NewCKSyncEngineRecordZoneChangeBatchWithRecordsToSaveRecordIDsToDeleteAtomicByZone(recordsToSave []CKRecord, recordIDsToDelete []CKRecordID, atomicByZone bool) CKSyncEngineRecordZoneChangeBatch
Creates a batch of records to modify.
recordsToSave: The records to save.
recordIDsToDelete: The identifiers of the records to delete.
atomicByZone: A Boolean value that determines whether CloudKit modifies the specified records atomically by record zone.
Return Value ¶
An initialized change batch, or `nil` if CloudKit can’t create one.
Discussion ¶
func (CKSyncEngineRecordZoneChangeBatch) AtomicByZone ¶
func (c CKSyncEngineRecordZoneChangeBatch) AtomicByZone() bool
A Boolean value that determines whether CloudKit modifies records atomically by record zone.
Discussion ¶
When true, CloudKit processes record changes atomically by record zone, and if any individual change fails, all other changes in that record’s record zone fail and return an error of type CKError.Code.batchRequestFailed.
The default value is false.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineRecordZoneChangeBatch/atomicByZone
func (CKSyncEngineRecordZoneChangeBatch) Autorelease ¶
func (c CKSyncEngineRecordZoneChangeBatch) Autorelease() CKSyncEngineRecordZoneChangeBatch
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineRecordZoneChangeBatch) Init ¶
func (c CKSyncEngineRecordZoneChangeBatch) Init() CKSyncEngineRecordZoneChangeBatch
Init initializes the instance.
func (CKSyncEngineRecordZoneChangeBatch) InitWithPendingChangesRecordProvider ¶
func (c CKSyncEngineRecordZoneChangeBatch) InitWithPendingChangesRecordProvider(pendingChanges []CKSyncEnginePendingRecordZoneChange, recordProvider CKRecordIDHandler) CKSyncEngineRecordZoneChangeBatch
Creates a batch of records to modify using the provided record zone changes.
pendingChanges: The record zone changes to process.
recordProvider: A block that returns the record for the specified record identifier.
Return Value ¶
The batch of records to modify, or `nil` if there are no pending changes.
Discussion ¶
This method iterates over `pendingChanges` and adds the necessary information to the new batch, until there are no more changes or the size of the batch reaches the maximum limit. If the type of change is a record save, the method asks the specified `recordProvider` block for that record. If the closure returns `nil`, the method skips that change.
func (CKSyncEngineRecordZoneChangeBatch) InitWithRecordsToSaveRecordIDsToDeleteAtomicByZone ¶
func (c CKSyncEngineRecordZoneChangeBatch) InitWithRecordsToSaveRecordIDsToDeleteAtomicByZone(recordsToSave []CKRecord, recordIDsToDelete []CKRecordID, atomicByZone bool) CKSyncEngineRecordZoneChangeBatch
Creates a batch of records to modify.
recordsToSave: The records to save.
recordIDsToDelete: The identifiers of the records to delete.
atomicByZone: A Boolean value that determines whether CloudKit modifies the specified records atomically by record zone.
Return Value ¶
An initialized change batch, or `nil` if CloudKit can’t create one.
Discussion ¶
func (CKSyncEngineRecordZoneChangeBatch) RecordIDsToDelete ¶
func (c CKSyncEngineRecordZoneChangeBatch) RecordIDsToDelete() []CKRecordID
The unique identifiers of the records to delete.
func (CKSyncEngineRecordZoneChangeBatch) RecordsToSave ¶
func (c CKSyncEngineRecordZoneChangeBatch) RecordsToSave() []CKRecord
The records to save.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineRecordZoneChangeBatch/recordsToSave
func (CKSyncEngineRecordZoneChangeBatch) SetAtomicByZone ¶
func (c CKSyncEngineRecordZoneChangeBatch) SetAtomicByZone(value bool)
type CKSyncEngineRecordZoneChangeBatchClass ¶
type CKSyncEngineRecordZoneChangeBatchClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineRecordZoneChangeBatchClass ¶
func GetCKSyncEngineRecordZoneChangeBatchClass() CKSyncEngineRecordZoneChangeBatchClass
GetCKSyncEngineRecordZoneChangeBatchClass returns the class object for CKSyncEngineRecordZoneChangeBatch.
func (CKSyncEngineRecordZoneChangeBatchClass) Alloc ¶
func (cc CKSyncEngineRecordZoneChangeBatchClass) Alloc() CKSyncEngineRecordZoneChangeBatch
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineRecordZoneChangeBatchClass) Class ¶
func (cc CKSyncEngineRecordZoneChangeBatchClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineSendChangesContext ¶
type CKSyncEngineSendChangesContext struct {
objectivec.Object
}
The context of an attempt to send changes to the server.
Overview ¶
A sync engine has two ways to send changes to iCloud — periodically, in cooperation with the system scheduler, and manually, whenever your app invokes the CKSyncEngine.SendChangesWithCompletionHandler method. This object provides information about a single attempt to send changes that includes both the reason for the attempt and any additional options in use by the attempt.
Accessing specific attributes ¶
- CKSyncEngineSendChangesContext.Reason: The reason for the send operation.
- CKSyncEngineSendChangesContext.Options: The additional options for the send operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesContext
func CKSyncEngineSendChangesContextFromID ¶
func CKSyncEngineSendChangesContextFromID(id objc.ID) CKSyncEngineSendChangesContext
CKSyncEngineSendChangesContextFromID constructs a CKSyncEngineSendChangesContext from an objc.ID.
The context of an attempt to send changes to the server.
func NewCKSyncEngineSendChangesContext ¶
func NewCKSyncEngineSendChangesContext() CKSyncEngineSendChangesContext
NewCKSyncEngineSendChangesContext creates a new CKSyncEngineSendChangesContext instance.
func (CKSyncEngineSendChangesContext) Autorelease ¶
func (c CKSyncEngineSendChangesContext) Autorelease() CKSyncEngineSendChangesContext
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineSendChangesContext) Init ¶
func (c CKSyncEngineSendChangesContext) Init() CKSyncEngineSendChangesContext
Init initializes the instance.
func (CKSyncEngineSendChangesContext) Options ¶
func (c CKSyncEngineSendChangesContext) Options() ICKSyncEngineSendChangesOptions
The additional options for the send operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesContext/options
func (CKSyncEngineSendChangesContext) Reason ¶
func (c CKSyncEngineSendChangesContext) Reason() CKSyncEngineSyncReason
The reason for the send operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesContext/reason
type CKSyncEngineSendChangesContextClass ¶
type CKSyncEngineSendChangesContextClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineSendChangesContextClass ¶
func GetCKSyncEngineSendChangesContextClass() CKSyncEngineSendChangesContextClass
GetCKSyncEngineSendChangesContextClass returns the class object for CKSyncEngineSendChangesContext.
func (CKSyncEngineSendChangesContextClass) Alloc ¶
func (cc CKSyncEngineSendChangesContextClass) Alloc() CKSyncEngineSendChangesContext
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineSendChangesContextClass) Class ¶
func (cc CKSyncEngineSendChangesContextClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineSendChangesOptions ¶
type CKSyncEngineSendChangesOptions struct {
objectivec.Object
}
A set of options to use with a send operation.
Managing attributes ¶
- CKSyncEngineSendChangesOptions.OperationGroup: The operation group to use for the underlying CloudKit operations.
- CKSyncEngineSendChangesOptions.SetOperationGroup
Instance Properties ¶
Instance Methods ¶
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesOptions
func CKSyncEngineSendChangesOptionsFromID ¶
func CKSyncEngineSendChangesOptionsFromID(id objc.ID) CKSyncEngineSendChangesOptions
CKSyncEngineSendChangesOptionsFromID constructs a CKSyncEngineSendChangesOptions from an objc.ID.
A set of options to use with a send operation.
func NewCKSyncEngineSendChangesOptions ¶
func NewCKSyncEngineSendChangesOptions() CKSyncEngineSendChangesOptions
NewCKSyncEngineSendChangesOptions creates a new CKSyncEngineSendChangesOptions instance.
func NewCKSyncEngineSendChangesOptionsWithScope ¶
func NewCKSyncEngineSendChangesOptionsWithScope(scope ICKSyncEngineSendChangesScope) CKSyncEngineSendChangesOptions
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesOptions/initWithScope:
func (CKSyncEngineSendChangesOptions) Autorelease ¶
func (c CKSyncEngineSendChangesOptions) Autorelease() CKSyncEngineSendChangesOptions
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineSendChangesOptions) Init ¶
func (c CKSyncEngineSendChangesOptions) Init() CKSyncEngineSendChangesOptions
Init initializes the instance.
func (CKSyncEngineSendChangesOptions) InitWithScope ¶
func (c CKSyncEngineSendChangesOptions) InitWithScope(scope ICKSyncEngineSendChangesScope) CKSyncEngineSendChangesOptions
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesOptions/initWithScope:
func (CKSyncEngineSendChangesOptions) OperationGroup ¶
func (c CKSyncEngineSendChangesOptions) OperationGroup() ICKOperationGroup
The operation group to use for the underlying CloudKit operations.
Discussion ¶
The default value is `nil`.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesOptions/operationGroup
func (CKSyncEngineSendChangesOptions) Scope ¶
func (c CKSyncEngineSendChangesOptions) Scope() ICKSyncEngineSendChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesOptions/scope
func (CKSyncEngineSendChangesOptions) SetOperationGroup ¶
func (c CKSyncEngineSendChangesOptions) SetOperationGroup(value ICKOperationGroup)
func (CKSyncEngineSendChangesOptions) SetScope ¶
func (c CKSyncEngineSendChangesOptions) SetScope(value ICKSyncEngineSendChangesScope)
type CKSyncEngineSendChangesOptionsClass ¶
type CKSyncEngineSendChangesOptionsClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineSendChangesOptionsClass ¶
func GetCKSyncEngineSendChangesOptionsClass() CKSyncEngineSendChangesOptionsClass
GetCKSyncEngineSendChangesOptionsClass returns the class object for CKSyncEngineSendChangesOptions.
func (CKSyncEngineSendChangesOptionsClass) Alloc ¶
func (cc CKSyncEngineSendChangesOptionsClass) Alloc() CKSyncEngineSendChangesOptions
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineSendChangesOptionsClass) Class ¶
func (cc CKSyncEngineSendChangesOptionsClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineSendChangesScope ¶
type CKSyncEngineSendChangesScope struct {
objectivec.Object
}
A scope in which the sync engine will send changes to the server.
Instance Properties ¶
- CKSyncEngineSendChangesScope.ExcludedZoneIDs
- CKSyncEngineSendChangesScope.RecordIDs
- CKSyncEngineSendChangesScope.ZoneIDs
Instance Methods ¶
- CKSyncEngineSendChangesScope.ContainsPendingRecordZoneChange
- CKSyncEngineSendChangesScope.ContainsRecordID
- CKSyncEngineSendChangesScope.InitWithExcludedZoneIDs
- CKSyncEngineSendChangesScope.InitWithRecordIDs
- CKSyncEngineSendChangesScope.InitWithZoneIDs
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope
func CKSyncEngineSendChangesScopeFromID ¶
func CKSyncEngineSendChangesScopeFromID(id objc.ID) CKSyncEngineSendChangesScope
CKSyncEngineSendChangesScopeFromID constructs a CKSyncEngineSendChangesScope from an objc.ID.
A scope in which the sync engine will send changes to the server.
func NewCKSyncEngineSendChangesScope ¶
func NewCKSyncEngineSendChangesScope() CKSyncEngineSendChangesScope
NewCKSyncEngineSendChangesScope creates a new CKSyncEngineSendChangesScope instance.
func NewCKSyncEngineSendChangesScopeWithExcludedZoneIDs ¶
func NewCKSyncEngineSendChangesScopeWithExcludedZoneIDs(excludedZoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
func NewCKSyncEngineSendChangesScopeWithRecordIDs ¶
func NewCKSyncEngineSendChangesScopeWithRecordIDs(recordIDs foundation.INSSet) CKSyncEngineSendChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/initWithRecordIDs:
func NewCKSyncEngineSendChangesScopeWithZoneIDs ¶
func NewCKSyncEngineSendChangesScopeWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/initWithZoneIDs:
func (CKSyncEngineSendChangesScope) Autorelease ¶
func (c CKSyncEngineSendChangesScope) Autorelease() CKSyncEngineSendChangesScope
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineSendChangesScope) ContainsPendingRecordZoneChange ¶
func (c CKSyncEngineSendChangesScope) ContainsPendingRecordZoneChange(pendingRecordZoneChange ICKSyncEnginePendingRecordZoneChange) bool
func (CKSyncEngineSendChangesScope) ContainsRecordID ¶
func (c CKSyncEngineSendChangesScope) ContainsRecordID(recordID ICKRecordID) bool
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/containsRecordID:
func (CKSyncEngineSendChangesScope) ExcludedZoneIDs ¶
func (c CKSyncEngineSendChangesScope) ExcludedZoneIDs() foundation.INSSet
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/excludedZoneIDs
func (CKSyncEngineSendChangesScope) Init ¶
func (c CKSyncEngineSendChangesScope) Init() CKSyncEngineSendChangesScope
Init initializes the instance.
func (CKSyncEngineSendChangesScope) InitWithExcludedZoneIDs ¶
func (c CKSyncEngineSendChangesScope) InitWithExcludedZoneIDs(excludedZoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
func (CKSyncEngineSendChangesScope) InitWithRecordIDs ¶
func (c CKSyncEngineSendChangesScope) InitWithRecordIDs(recordIDs foundation.INSSet) CKSyncEngineSendChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/initWithRecordIDs:
func (CKSyncEngineSendChangesScope) InitWithZoneIDs ¶
func (c CKSyncEngineSendChangesScope) InitWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/initWithZoneIDs:
func (CKSyncEngineSendChangesScope) RecordIDs ¶
func (c CKSyncEngineSendChangesScope) RecordIDs() foundation.INSSet
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/recordIDs
func (CKSyncEngineSendChangesScope) ZoneIDs ¶
func (c CKSyncEngineSendChangesScope) ZoneIDs() foundation.INSSet
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope/zoneIDs
type CKSyncEngineSendChangesScopeClass ¶
type CKSyncEngineSendChangesScopeClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineSendChangesScopeClass ¶
func GetCKSyncEngineSendChangesScopeClass() CKSyncEngineSendChangesScopeClass
GetCKSyncEngineSendChangesScopeClass returns the class object for CKSyncEngineSendChangesScope.
func (CKSyncEngineSendChangesScopeClass) Alloc ¶
func (cc CKSyncEngineSendChangesScopeClass) Alloc() CKSyncEngineSendChangesScope
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineSendChangesScopeClass) Class ¶
func (cc CKSyncEngineSendChangesScopeClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineSentDatabaseChangesEvent ¶
type CKSyncEngineSentDatabaseChangesEvent struct {
CKSyncEngineEvent
}
An object that provides information about a sent batch of database changes.
Accessing successful changes ¶
- CKSyncEngineSentDatabaseChangesEvent.DeletedZoneIDs: The unique identifiers of the deleted record zones.
- CKSyncEngineSentDatabaseChangesEvent.SavedZones: The modified record zones.
Accessing failed changes ¶
- CKSyncEngineSentDatabaseChangesEvent.FailedZoneDeletes: The unique identifiers of the record zones CloudKit is unable to delete, and the reasons why.
- CKSyncEngineSentDatabaseChangesEvent.FailedZoneSaves: The record zones that CloudKit is unable to modify.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSentDatabaseChangesEvent
func CKSyncEngineSentDatabaseChangesEventFromID ¶
func CKSyncEngineSentDatabaseChangesEventFromID(id objc.ID) CKSyncEngineSentDatabaseChangesEvent
CKSyncEngineSentDatabaseChangesEventFromID constructs a CKSyncEngineSentDatabaseChangesEvent from an objc.ID.
An object that provides information about a sent batch of database changes.
func NewCKSyncEngineSentDatabaseChangesEvent ¶
func NewCKSyncEngineSentDatabaseChangesEvent() CKSyncEngineSentDatabaseChangesEvent
NewCKSyncEngineSentDatabaseChangesEvent creates a new CKSyncEngineSentDatabaseChangesEvent instance.
func (CKSyncEngineSentDatabaseChangesEvent) Autorelease ¶
func (c CKSyncEngineSentDatabaseChangesEvent) Autorelease() CKSyncEngineSentDatabaseChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineSentDatabaseChangesEvent) DeletedZoneIDs ¶
func (c CKSyncEngineSentDatabaseChangesEvent) DeletedZoneIDs() []CKRecordZoneID
The unique identifiers of the deleted record zones.
func (CKSyncEngineSentDatabaseChangesEvent) FailedZoneDeletes ¶
func (c CKSyncEngineSentDatabaseChangesEvent) FailedZoneDeletes() foundation.INSDictionary
The unique identifiers of the record zones CloudKit is unable to delete, and the reasons why.
func (CKSyncEngineSentDatabaseChangesEvent) FailedZoneSaves ¶
func (c CKSyncEngineSentDatabaseChangesEvent) FailedZoneSaves() []CKSyncEngineFailedZoneSave
The record zones that CloudKit is unable to modify.
func (CKSyncEngineSentDatabaseChangesEvent) SavedZones ¶
func (c CKSyncEngineSentDatabaseChangesEvent) SavedZones() []CKRecordZone
The modified record zones.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSentDatabaseChangesEvent/savedZones
type CKSyncEngineSentDatabaseChangesEventClass ¶
type CKSyncEngineSentDatabaseChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineSentDatabaseChangesEventClass ¶
func GetCKSyncEngineSentDatabaseChangesEventClass() CKSyncEngineSentDatabaseChangesEventClass
GetCKSyncEngineSentDatabaseChangesEventClass returns the class object for CKSyncEngineSentDatabaseChangesEvent.
func (CKSyncEngineSentDatabaseChangesEventClass) Alloc ¶
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineSentDatabaseChangesEventClass) Class ¶
func (cc CKSyncEngineSentDatabaseChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineSentRecordZoneChangesEvent ¶
type CKSyncEngineSentRecordZoneChangesEvent struct {
CKSyncEngineEvent
}
The sync engine finished sending a batch of record zone changes to the server.
Overview ¶
If a record save succeeded, you should encode the system fields of this record to use the next time you save. See CKRecord.EncodeSystemFieldsWithCoder.
If a record deletion succeeded, you should remove any local system fields for that record.
If the record change failed, try to resolve the issue causing the error and save the record again if necessary.
Accessing successful changes ¶
- CKSyncEngineSentRecordZoneChangesEvent.DeletedRecordIDs: The unique identifiers of the deleted records.
- CKSyncEngineSentRecordZoneChangesEvent.SavedRecords: The modified records.
Accessing failed changes ¶
- CKSyncEngineSentRecordZoneChangesEvent.FailedRecordDeletes: The unique identifiers of the records CloudKit is unable to delete, and the reasons why.
- CKSyncEngineSentRecordZoneChangesEvent.FailedRecordSaves: The records that CloudKit is unable to modify.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSentRecordZoneChangesEvent
func CKSyncEngineSentRecordZoneChangesEventFromID ¶
func CKSyncEngineSentRecordZoneChangesEventFromID(id objc.ID) CKSyncEngineSentRecordZoneChangesEvent
CKSyncEngineSentRecordZoneChangesEventFromID constructs a CKSyncEngineSentRecordZoneChangesEvent from an objc.ID.
The sync engine finished sending a batch of record zone changes to the server.
func NewCKSyncEngineSentRecordZoneChangesEvent ¶
func NewCKSyncEngineSentRecordZoneChangesEvent() CKSyncEngineSentRecordZoneChangesEvent
NewCKSyncEngineSentRecordZoneChangesEvent creates a new CKSyncEngineSentRecordZoneChangesEvent instance.
func (CKSyncEngineSentRecordZoneChangesEvent) Autorelease ¶
func (c CKSyncEngineSentRecordZoneChangesEvent) Autorelease() CKSyncEngineSentRecordZoneChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineSentRecordZoneChangesEvent) DeletedRecordIDs ¶
func (c CKSyncEngineSentRecordZoneChangesEvent) DeletedRecordIDs() []CKRecordID
The unique identifiers of the deleted records.
func (CKSyncEngineSentRecordZoneChangesEvent) FailedRecordDeletes ¶
func (c CKSyncEngineSentRecordZoneChangesEvent) FailedRecordDeletes() foundation.INSDictionary
The unique identifiers of the records CloudKit is unable to delete, and the reasons why.
func (CKSyncEngineSentRecordZoneChangesEvent) FailedRecordSaves ¶
func (c CKSyncEngineSentRecordZoneChangesEvent) FailedRecordSaves() []CKSyncEngineFailedRecordSave
The records that CloudKit is unable to modify.
func (CKSyncEngineSentRecordZoneChangesEvent) SavedRecords ¶
func (c CKSyncEngineSentRecordZoneChangesEvent) SavedRecords() []CKRecord
The modified records.
type CKSyncEngineSentRecordZoneChangesEventClass ¶
type CKSyncEngineSentRecordZoneChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineSentRecordZoneChangesEventClass ¶
func GetCKSyncEngineSentRecordZoneChangesEventClass() CKSyncEngineSentRecordZoneChangesEventClass
GetCKSyncEngineSentRecordZoneChangesEventClass returns the class object for CKSyncEngineSentRecordZoneChangesEvent.
func (CKSyncEngineSentRecordZoneChangesEventClass) Alloc ¶
func (cc CKSyncEngineSentRecordZoneChangesEventClass) Alloc() CKSyncEngineSentRecordZoneChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineSentRecordZoneChangesEventClass) Class ¶
func (cc CKSyncEngineSentRecordZoneChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineState ¶
type CKSyncEngineState struct {
objectivec.Object
}
An object that manages the sync engine’s state.
Overview ¶
To reliably and consistently sync your app’s data, a sync engine keeps a record of several important pieces of data, such as server changes tokens (for databases and record zones), subscription identifiers, the most recent CKUserIdentity.UserRecordID, and so on. This class automatically manages that state on behalf of your app, but there are certain elements you can modify. For example, you control the list of pending changes to send to the iCloud servers and manipulate that list using the CKSyncEngineState.AddPendingDatabaseChanges and CKSyncEngineState.AddPendingRecordZoneChanges methods. If there aren’t any scheduled sync operations when you invoke these methods, the engine automatically schedules one.
An engine’s state changes periodically and, when it does, the sync engine dispatches an event of type CKSyncEngineStateUpdateEvent to your delegate. The event contains an instance of CKSyncEngineStateSerialization and, on receipt of such an event, it’s your responsibility to persist the serialized state to disk so that it’s available across app launches. On the next initialization of the sync engine, you provide the most recently persisted state as part of the engine’s configuration. For more information, see CKSyncEngineConfiguration.InitWithDatabaseStateSerializationDelegate.
Accessing pending changes ¶
- CKSyncEngineState.HasPendingUntrackedChanges: A Boolean value that indicates whether there are pending changes that the sync engine is unaware of.
- CKSyncEngineState.SetHasPendingUntrackedChanges
- CKSyncEngineState.PendingDatabaseChanges: The database changes that the sync engine has yet to send to the iCloud servers.
- CKSyncEngineState.PendingRecordZoneChanges: The record zone changes that the sync engine has yet to send to the iCloud servers.
Modifying pending changes ¶
- CKSyncEngineState.AddPendingDatabaseChanges: Adds the specified database changes to the state.
- CKSyncEngineState.RemovePendingDatabaseChanges: Removes the specified database changes from the state.
- CKSyncEngineState.AddPendingRecordZoneChanges: Adds the specified record zone changes to the state.
- CKSyncEngineState.RemovePendingRecordZoneChanges: Removes the specified record zone changes from the state.
Instance Properties ¶
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState
func CKSyncEngineStateFromID ¶
func CKSyncEngineStateFromID(id objc.ID) CKSyncEngineState
CKSyncEngineStateFromID constructs a CKSyncEngineState from an objc.ID.
An object that manages the sync engine’s state.
func NewCKSyncEngineState ¶
func NewCKSyncEngineState() CKSyncEngineState
NewCKSyncEngineState creates a new CKSyncEngineState instance.
func (CKSyncEngineState) AddPendingDatabaseChanges ¶
func (c CKSyncEngineState) AddPendingDatabaseChanges(changes []CKSyncEnginePendingDatabaseChange)
Adds the specified database changes to the state.
changes: An array of database changes.
Discussion ¶
Use this method to enable the sync engine to manage your pending database changes. For example, when someone makes a change that your app needs to send to the server, use this method to record the change. If there are no scheduled sync operations when you invoke this method, the sync engine automatically schedules one to send the changes. After the engine sends those changes, it notifies your app’s sync delegate with an event of type CKSyncEngineSentDatabaseChangesEvent.
The sync engine ensures the consistency of any pending changes it’s tracking, deduplicating them as necessary. The engine removes changes from the list as it sends them, but retains any that fail due to a recoverable error, such as a network issue or exceeding the rate limit.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState/addPendingDatabaseChanges:
func (CKSyncEngineState) AddPendingRecordZoneChanges ¶
func (c CKSyncEngineState) AddPendingRecordZoneChanges(changes []CKSyncEnginePendingRecordZoneChange)
Adds the specified record zone changes to the state.
changes: An array of record zone changes.
Discussion ¶
Use this method to enable the sync engine to manage your pending record zone changes. For example, when someone makes a change that your app needs to send to the server, use this method to record the change. Then, when creating the change batch for the next send operation, retrieve the pending changes from the CKSyncEngineState.PendingRecordZoneChanges property.
If there are no scheduled sync operations when you invoke this method, the sync engine automatically schedules one to send the changes. After the engine sends those changes, it notifies your app’s sync delegate with an event of type CKSyncEngineSentRecordZoneChangesEvent.
The sync engine ensures the consistency of any pending changes it’s tracking, deduplicating them as necessary. The engine removes changes from the list as it sends them, but retains any that fail due to a recoverable error, such as a network issue or exceeding the rate limit.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState/addPendingRecordZoneChanges:
func (CKSyncEngineState) Autorelease ¶
func (c CKSyncEngineState) Autorelease() CKSyncEngineState
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineState) HasPendingUntrackedChanges ¶
func (c CKSyncEngineState) HasPendingUntrackedChanges() bool
A Boolean value that indicates whether there are pending changes that the sync engine is unaware of.
Discussion ¶
Use this property to inform the sync engine that there are pending changes other than those available in CKSyncEngineState.PendingRecordZoneChanges. After you set this property, the sync engine automatically schedules a send operation and, when that operation executes, asks your delegate to provide those changes by invoking the [SyncEngineNextRecordZoneChangeBatchForContext] method.
Using this property is optional and is necessary only if you track pending changes manually, outside of the sync engine’s state.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState/hasPendingUntrackedChanges
func (CKSyncEngineState) Init ¶
func (c CKSyncEngineState) Init() CKSyncEngineState
Init initializes the instance.
func (CKSyncEngineState) PendingDatabaseChanges ¶
func (c CKSyncEngineState) PendingDatabaseChanges() []CKSyncEnginePendingDatabaseChange
The database changes that the sync engine has yet to send to the iCloud servers.
Discussion ¶
This array contains any pending database changes to send to the iCloud servers in a subsequent send operation (scheduled or manual). After the sync engine sends those changes, your app’s sync delegate receives an event of type CKSyncEngineSentDatabaseChangesEvent.
Use the CKSyncEngineState.AddPendingDatabaseChanges and CKSyncEngineState.RemovePendingDatabaseChanges methods to modify the array’s contents.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState/pendingDatabaseChanges
func (CKSyncEngineState) PendingRecordZoneChanges ¶
func (c CKSyncEngineState) PendingRecordZoneChanges() []CKSyncEnginePendingRecordZoneChange
The record zone changes that the sync engine has yet to send to the iCloud servers.
Discussion ¶
This array contains any pending record zone changes to send to the iCloud servers in a subsequent send operation (scheduled or manual). After the sync engine sends those changes, your app’s sync delegate receives an event of type CKSyncEngineSentRecordZoneChangesEvent.
Use the CKSyncEngineState.AddPendingRecordZoneChanges and CKSyncEngineState.RemovePendingRecordZoneChanges methods to modify the array’s contents.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState/pendingRecordZoneChanges
func (CKSyncEngineState) RemovePendingDatabaseChanges ¶
func (c CKSyncEngineState) RemovePendingDatabaseChanges(changes []CKSyncEnginePendingDatabaseChange)
Removes the specified database changes from the state.
changes: An array of database changes.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState/removePendingDatabaseChanges:
func (CKSyncEngineState) RemovePendingRecordZoneChanges ¶
func (c CKSyncEngineState) RemovePendingRecordZoneChanges(changes []CKSyncEnginePendingRecordZoneChange)
Removes the specified record zone changes from the state.
changes: An array of record zone changes.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState/removePendingRecordZoneChanges:
func (CKSyncEngineState) SetHasPendingUntrackedChanges ¶
func (c CKSyncEngineState) SetHasPendingUntrackedChanges(value bool)
func (CKSyncEngineState) ZoneIDsWithUnfetchedServerChanges ¶
func (c CKSyncEngineState) ZoneIDsWithUnfetchedServerChanges() []CKRecordZoneID
type CKSyncEngineStateClass ¶
type CKSyncEngineStateClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineStateClass ¶
func GetCKSyncEngineStateClass() CKSyncEngineStateClass
GetCKSyncEngineStateClass returns the class object for CKSyncEngineState.
func (CKSyncEngineStateClass) Alloc ¶
func (cc CKSyncEngineStateClass) Alloc() CKSyncEngineState
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineStateClass) Class ¶
func (cc CKSyncEngineStateClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineStateSerialization ¶
type CKSyncEngineStateSerialization struct {
objectivec.Object
}
An opaque object that contains the serialized representation of a sync engine’s current state.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineStateSerialization
func CKSyncEngineStateSerializationFromID ¶
func CKSyncEngineStateSerializationFromID(id objc.ID) CKSyncEngineStateSerialization
CKSyncEngineStateSerializationFromID constructs a CKSyncEngineStateSerialization from an objc.ID.
An opaque object that contains the serialized representation of a sync engine’s current state.
func NewCKSyncEngineStateSerialization ¶
func NewCKSyncEngineStateSerialization() CKSyncEngineStateSerialization
NewCKSyncEngineStateSerialization creates a new CKSyncEngineStateSerialization instance.
func (CKSyncEngineStateSerialization) Autorelease ¶
func (c CKSyncEngineStateSerialization) Autorelease() CKSyncEngineStateSerialization
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineStateSerialization) EncodeWithCoder ¶
func (c CKSyncEngineStateSerialization) EncodeWithCoder(coder foundation.INSCoder)
func (CKSyncEngineStateSerialization) Init ¶
func (c CKSyncEngineStateSerialization) Init() CKSyncEngineStateSerialization
Init initializes the instance.
type CKSyncEngineStateSerializationClass ¶
type CKSyncEngineStateSerializationClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineStateSerializationClass ¶
func GetCKSyncEngineStateSerializationClass() CKSyncEngineStateSerializationClass
GetCKSyncEngineStateSerializationClass returns the class object for CKSyncEngineStateSerialization.
func (CKSyncEngineStateSerializationClass) Alloc ¶
func (cc CKSyncEngineStateSerializationClass) Alloc() CKSyncEngineStateSerialization
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineStateSerializationClass) Class ¶
func (cc CKSyncEngineStateSerializationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineStateUpdateEvent ¶
type CKSyncEngineStateUpdateEvent struct {
CKSyncEngineEvent
}
The sync engine state was updated, and you should persist it locally.
Overview ¶
In order to function properly and efficiently, CKSyncEngine tracks some state internally. When the sync engine state changes, it gives you the latest serialized version in a CKSyncEngine.Event.StateUpdate. This event happens occasionally when the sync engine modifies the state internally during normal sync operation. This event also happens when you change the state yourself.
The sync engine does not persist this state to disk, so you need to persist it in alongside your own local data. The next time your process launches, use this latest state serialization in CKSyncEngineConfiguration.StateSerialization to initialize your sync engine.
This state is directly tied to the changes you fetch and send with the sync engine. You should persist this state alongside any changes fetched prior to receiving this state.
Accessing the state ¶
- CKSyncEngineStateUpdateEvent.StateSerialization: The current state of the sync engine.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineStateUpdateEvent
func CKSyncEngineStateUpdateEventFromID ¶
func CKSyncEngineStateUpdateEventFromID(id objc.ID) CKSyncEngineStateUpdateEvent
CKSyncEngineStateUpdateEventFromID constructs a CKSyncEngineStateUpdateEvent from an objc.ID.
The sync engine state was updated, and you should persist it locally.
func NewCKSyncEngineStateUpdateEvent ¶
func NewCKSyncEngineStateUpdateEvent() CKSyncEngineStateUpdateEvent
NewCKSyncEngineStateUpdateEvent creates a new CKSyncEngineStateUpdateEvent instance.
func (CKSyncEngineStateUpdateEvent) Autorelease ¶
func (c CKSyncEngineStateUpdateEvent) Autorelease() CKSyncEngineStateUpdateEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineStateUpdateEvent) Init ¶
func (c CKSyncEngineStateUpdateEvent) Init() CKSyncEngineStateUpdateEvent
Init initializes the instance.
func (CKSyncEngineStateUpdateEvent) StateSerialization ¶
func (c CKSyncEngineStateUpdateEvent) StateSerialization() ICKSyncEngineStateSerialization
The current state of the sync engine.
Discussion ¶
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineStateUpdateEvent/stateSerialization
type CKSyncEngineStateUpdateEventClass ¶
type CKSyncEngineStateUpdateEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineStateUpdateEventClass ¶
func GetCKSyncEngineStateUpdateEventClass() CKSyncEngineStateUpdateEventClass
GetCKSyncEngineStateUpdateEventClass returns the class object for CKSyncEngineStateUpdateEvent.
func (CKSyncEngineStateUpdateEventClass) Alloc ¶
func (cc CKSyncEngineStateUpdateEventClass) Alloc() CKSyncEngineStateUpdateEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineStateUpdateEventClass) Class ¶
func (cc CKSyncEngineStateUpdateEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineSyncReason ¶
type CKSyncEngineSyncReason int
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSyncReason
const ( // CKSyncEngineSyncReasonManual: A manual sync operation. CKSyncEngineSyncReasonManual CKSyncEngineSyncReason = 1 // CKSyncEngineSyncReasonScheduled: The sync engine automatically scheduled this sync. CKSyncEngineSyncReasonScheduled CKSyncEngineSyncReason = 0 )
func (CKSyncEngineSyncReason) String ¶
func (e CKSyncEngineSyncReason) String() string
type CKSyncEngineWillFetchChangesEvent ¶
type CKSyncEngineWillFetchChangesEvent struct {
CKSyncEngineEvent
}
The sync engine is about to fetch changes from the server.
Overview ¶
The sync engine delivers the changes themselves via CKSyncEngineFetchedDatabaseChangesEvent and CKSyncEngineFetchedRecordZoneChangesEvent.
Note that this event might not always occur every time you call CKSyncEngine.FetchChangesWithCompletionHandler. For example, if you call CKSyncEngine.FetchChangesWithCompletionHandler concurrently while the engine is already fetching changes, this event might not be sent. Similarly, if there’s no logged-in account, the engine might short-circuit the call to `fetchChanges`, and this event won’t be sent.
Instance Properties ¶
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillFetchChangesEvent
func CKSyncEngineWillFetchChangesEventFromID ¶
func CKSyncEngineWillFetchChangesEventFromID(id objc.ID) CKSyncEngineWillFetchChangesEvent
CKSyncEngineWillFetchChangesEventFromID constructs a CKSyncEngineWillFetchChangesEvent from an objc.ID.
The sync engine is about to fetch changes from the server.
func NewCKSyncEngineWillFetchChangesEvent ¶
func NewCKSyncEngineWillFetchChangesEvent() CKSyncEngineWillFetchChangesEvent
NewCKSyncEngineWillFetchChangesEvent creates a new CKSyncEngineWillFetchChangesEvent instance.
func (CKSyncEngineWillFetchChangesEvent) Autorelease ¶
func (c CKSyncEngineWillFetchChangesEvent) Autorelease() CKSyncEngineWillFetchChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineWillFetchChangesEvent) Context ¶
func (c CKSyncEngineWillFetchChangesEvent) Context() ICKSyncEngineFetchChangesContext
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillFetchChangesEvent/context
func (CKSyncEngineWillFetchChangesEvent) Init ¶
func (c CKSyncEngineWillFetchChangesEvent) Init() CKSyncEngineWillFetchChangesEvent
Init initializes the instance.
type CKSyncEngineWillFetchChangesEventClass ¶
type CKSyncEngineWillFetchChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineWillFetchChangesEventClass ¶
func GetCKSyncEngineWillFetchChangesEventClass() CKSyncEngineWillFetchChangesEventClass
GetCKSyncEngineWillFetchChangesEventClass returns the class object for CKSyncEngineWillFetchChangesEvent.
func (CKSyncEngineWillFetchChangesEventClass) Alloc ¶
func (cc CKSyncEngineWillFetchChangesEventClass) Alloc() CKSyncEngineWillFetchChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineWillFetchChangesEventClass) Class ¶
func (cc CKSyncEngineWillFetchChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineWillFetchRecordZoneChangesEvent ¶
type CKSyncEngineWillFetchRecordZoneChangesEvent struct {
CKSyncEngineEvent
}
The sync engine finished fetching record zone changes from the server for a specific zone.
Overview ¶
This might be a good signal to perform any post-processing tasks on a per-zone basis if necessary.
You should receive one CKSyncEngineDidFetchRecordZoneChangesEvent for each CKSyncEngineWillFetchRecordZoneChangesEvent.
Identifying the record zone ¶
- CKSyncEngineWillFetchRecordZoneChangesEvent.ZoneID: The associated record zone’s unique identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillFetchRecordZoneChangesEvent
func CKSyncEngineWillFetchRecordZoneChangesEventFromID ¶
func CKSyncEngineWillFetchRecordZoneChangesEventFromID(id objc.ID) CKSyncEngineWillFetchRecordZoneChangesEvent
CKSyncEngineWillFetchRecordZoneChangesEventFromID constructs a CKSyncEngineWillFetchRecordZoneChangesEvent from an objc.ID.
The sync engine finished fetching record zone changes from the server for a specific zone.
func NewCKSyncEngineWillFetchRecordZoneChangesEvent ¶
func NewCKSyncEngineWillFetchRecordZoneChangesEvent() CKSyncEngineWillFetchRecordZoneChangesEvent
NewCKSyncEngineWillFetchRecordZoneChangesEvent creates a new CKSyncEngineWillFetchRecordZoneChangesEvent instance.
func (CKSyncEngineWillFetchRecordZoneChangesEvent) Autorelease ¶
func (c CKSyncEngineWillFetchRecordZoneChangesEvent) Autorelease() CKSyncEngineWillFetchRecordZoneChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineWillFetchRecordZoneChangesEvent) Init ¶
func (c CKSyncEngineWillFetchRecordZoneChangesEvent) Init() CKSyncEngineWillFetchRecordZoneChangesEvent
Init initializes the instance.
func (CKSyncEngineWillFetchRecordZoneChangesEvent) ZoneID ¶
func (c CKSyncEngineWillFetchRecordZoneChangesEvent) ZoneID() ICKRecordZoneID
The associated record zone’s unique identifier.
type CKSyncEngineWillFetchRecordZoneChangesEventClass ¶
type CKSyncEngineWillFetchRecordZoneChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineWillFetchRecordZoneChangesEventClass ¶
func GetCKSyncEngineWillFetchRecordZoneChangesEventClass() CKSyncEngineWillFetchRecordZoneChangesEventClass
GetCKSyncEngineWillFetchRecordZoneChangesEventClass returns the class object for CKSyncEngineWillFetchRecordZoneChangesEvent.
func (CKSyncEngineWillFetchRecordZoneChangesEventClass) Alloc ¶
func (cc CKSyncEngineWillFetchRecordZoneChangesEventClass) Alloc() CKSyncEngineWillFetchRecordZoneChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineWillFetchRecordZoneChangesEventClass) Class ¶
func (cc CKSyncEngineWillFetchRecordZoneChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineWillSendChangesEvent ¶
type CKSyncEngineWillSendChangesEvent struct {
CKSyncEngineEvent
}
An object that provides information about an imminent send of local changes.
Accessing the context ¶
- CKSyncEngineWillSendChangesEvent.Context: The context of the imminent send request.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillSendChangesEvent
func CKSyncEngineWillSendChangesEventFromID ¶
func CKSyncEngineWillSendChangesEventFromID(id objc.ID) CKSyncEngineWillSendChangesEvent
CKSyncEngineWillSendChangesEventFromID constructs a CKSyncEngineWillSendChangesEvent from an objc.ID.
An object that provides information about an imminent send of local changes.
func NewCKSyncEngineWillSendChangesEvent ¶
func NewCKSyncEngineWillSendChangesEvent() CKSyncEngineWillSendChangesEvent
NewCKSyncEngineWillSendChangesEvent creates a new CKSyncEngineWillSendChangesEvent instance.
func (CKSyncEngineWillSendChangesEvent) Autorelease ¶
func (c CKSyncEngineWillSendChangesEvent) Autorelease() CKSyncEngineWillSendChangesEvent
Autorelease adds the receiver to the current autorelease pool.
func (CKSyncEngineWillSendChangesEvent) Context ¶
func (c CKSyncEngineWillSendChangesEvent) Context() ICKSyncEngineSendChangesContext
The context of the imminent send request.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillSendChangesEvent/context
func (CKSyncEngineWillSendChangesEvent) Init ¶
func (c CKSyncEngineWillSendChangesEvent) Init() CKSyncEngineWillSendChangesEvent
Init initializes the instance.
type CKSyncEngineWillSendChangesEventClass ¶
type CKSyncEngineWillSendChangesEventClass struct {
// contains filtered or unexported fields
}
func GetCKSyncEngineWillSendChangesEventClass ¶
func GetCKSyncEngineWillSendChangesEventClass() CKSyncEngineWillSendChangesEventClass
GetCKSyncEngineWillSendChangesEventClass returns the class object for CKSyncEngineWillSendChangesEvent.
func (CKSyncEngineWillSendChangesEventClass) Alloc ¶
func (cc CKSyncEngineWillSendChangesEventClass) Alloc() CKSyncEngineWillSendChangesEvent
Alloc allocates memory for a new instance of the class.
func (CKSyncEngineWillSendChangesEventClass) Class ¶
func (cc CKSyncEngineWillSendChangesEventClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKSyncEngineZoneDeletionReason ¶
type CKSyncEngineZoneDeletionReason int
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineZoneDeletionReason
const ( // CKSyncEngineZoneDeletionReasonDeleted: Your app deleted the record zone. CKSyncEngineZoneDeletionReasonDeleted CKSyncEngineZoneDeletionReason = 0 // CKSyncEngineZoneDeletionReasonEncryptedDataReset: The owner of the iCloud account reset their encrypted data. CKSyncEngineZoneDeletionReasonEncryptedDataReset CKSyncEngineZoneDeletionReason = 2 // CKSyncEngineZoneDeletionReasonPurged: The owner of the iCloud account purged your app’s data using the Settings app. CKSyncEngineZoneDeletionReasonPurged CKSyncEngineZoneDeletionReason = 1 )
func (CKSyncEngineZoneDeletionReason) String ¶
func (e CKSyncEngineZoneDeletionReason) String() string
type CKSystemSharingUIObserver ¶
type CKSystemSharingUIObserver struct {
objectivec.Object
}
An object the system uses to monitor changes in sharing.
Overview ¶
Initialize a CKSystemSharingUIObserver instance with your CKContainer when preparing to share an item using the share sheet. Use your implementation to update the local state of a shared item when your app receives a CKShare, or to delete a locally cached share when the system notifies your app about a share deletion.
The system only propagates changes on the local device using CKSystemSharingUIObserver. The system doesn’t notify your app about any remote changes on the server. For more information about how to keep your local cache in sync with remote changes, see Remote Records.
Creating a sharing observer ¶
- CKSystemSharingUIObserver.InitWithContainer: Creates and initializes an observer using the provided container.
Accessing sharing blocks ¶
- CKSystemSharingUIObserver.SystemSharingUIDidSaveShareBlock: A callback block the system invokes after the success or failure of a share save by the system sharing UI.
- CKSystemSharingUIObserver.SetSystemSharingUIDidSaveShareBlock
- CKSystemSharingUIObserver.SystemSharingUIDidStopSharingBlock: A callback block the system invokes after the success or failure of a share delete by the system sharing UI.
- CKSystemSharingUIObserver.SetSystemSharingUIDidStopSharingBlock
See: https://developer.apple.com/documentation/CloudKit/CKSystemSharingUIObserver
func CKSystemSharingUIObserverFromID ¶
func CKSystemSharingUIObserverFromID(id objc.ID) CKSystemSharingUIObserver
CKSystemSharingUIObserverFromID constructs a CKSystemSharingUIObserver from an objc.ID.
An object the system uses to monitor changes in sharing.
func NewCKSystemSharingUIObserver ¶
func NewCKSystemSharingUIObserver() CKSystemSharingUIObserver
NewCKSystemSharingUIObserver creates a new CKSystemSharingUIObserver instance.
func NewCKSystemSharingUIObserverWithContainer ¶
func NewCKSystemSharingUIObserverWithContainer(container ICKContainer) CKSystemSharingUIObserver
Creates and initializes an observer using the provided container.
container: The CKContainer for the sharing observer.
See: https://developer.apple.com/documentation/CloudKit/CKSystemSharingUIObserver/init(container:)
func (CKSystemSharingUIObserver) Autorelease ¶
func (c CKSystemSharingUIObserver) Autorelease() CKSystemSharingUIObserver
Autorelease adds the receiver to the current autorelease pool.
func (CKSystemSharingUIObserver) Init ¶
func (c CKSystemSharingUIObserver) Init() CKSystemSharingUIObserver
Init initializes the instance.
func (CKSystemSharingUIObserver) InitWithContainer ¶
func (c CKSystemSharingUIObserver) InitWithContainer(container ICKContainer) CKSystemSharingUIObserver
Creates and initializes an observer using the provided container.
container: The CKContainer for the sharing observer.
See: https://developer.apple.com/documentation/CloudKit/CKSystemSharingUIObserver/init(container:)
func (CKSystemSharingUIObserver) SetSystemSharingUIDidSaveShareBlock ¶
func (c CKSystemSharingUIObserver) SetSystemSharingUIDidSaveShareBlock(value kernel.Pointer)
func (CKSystemSharingUIObserver) SetSystemSharingUIDidStopSharingBlock ¶
func (c CKSystemSharingUIObserver) SetSystemSharingUIDidStopSharingBlock(value kernel.Pointer)
func (CKSystemSharingUIObserver) SystemSharingUIDidSaveShareBlock ¶
func (c CKSystemSharingUIObserver) SystemSharingUIDidSaveShareBlock() unsafe.Pointer
A callback block the system invokes after the success or failure of a share save by the system sharing UI.
func (CKSystemSharingUIObserver) SystemSharingUIDidStopSharingBlock ¶
func (c CKSystemSharingUIObserver) SystemSharingUIDidStopSharingBlock() unsafe.Pointer
A callback block the system invokes after the success or failure of a share delete by the system sharing UI.
type CKSystemSharingUIObserverClass ¶
type CKSystemSharingUIObserverClass struct {
// contains filtered or unexported fields
}
func GetCKSystemSharingUIObserverClass ¶
func GetCKSystemSharingUIObserverClass() CKSystemSharingUIObserverClass
GetCKSystemSharingUIObserverClass returns the class object for CKSystemSharingUIObserver.
func (CKSystemSharingUIObserverClass) Alloc ¶
func (cc CKSystemSharingUIObserverClass) Alloc() CKSystemSharingUIObserver
Alloc allocates memory for a new instance of the class.
func (CKSystemSharingUIObserverClass) Class ¶
func (cc CKSystemSharingUIObserverClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKUserIdentity ¶
type CKUserIdentity struct {
objectivec.Object
}
The identity of a user.
Overview ¶
A user identity provides identifiable data about an iCloud user, including their name, user record ID, and an email address or phone number. CloudKit retrieves this information from the user’s iCloud account. A user must give their consent to be discoverable before CloudKit can provide this data to your app. For more information, see [CKContainer.RequestApplicationPermissionCompletionHandler].
You don’t create instances of this class. Instead, CloudKit provides them in certain contexts. A share’s owner has a user identity, as does each of its participants. When creating participants, CloudKit tries to find iCloud accounts it can use to populate their identities. If CloudKit doesn’t find an account, it sets the identity’s CKUserIdentity.HasiCloudAccount property to false.
You can also discover the identities of your app’s users by executing one of the user discovery operations: CKDiscoverAllUserIdentitiesOperation and CKDiscoverUserIdentitiesOperation. Identities that CloudKit discovers using CKDiscoverAllUserIdentitiesOperation correspond to entries in the device’s Contacts database. These identities contain the identifiers of their Contact records, which you can use to fetch those records from the Contacts database. For more information, see CKUserIdentity.ContactIdentifiers.
Accessing iCloud Information ¶
- CKUserIdentity.HasiCloudAccount: A Boolean value that indicates whether the user has an iCloud account.
- CKUserIdentity.LookupInfo: The lookup info for retrieving the user identity.
Accessing User Information ¶
- CKUserIdentity.UserRecordID: The user record ID for the corresponding user record.
- CKUserIdentity.ContactIdentifiers: Identifiers that match contacts in the local Contacts database.
- CKUserIdentity.NameComponents: The user’s name.
Initializers ¶
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity
func CKUserIdentityFromID ¶
func CKUserIdentityFromID(id objc.ID) CKUserIdentity
CKUserIdentityFromID constructs a CKUserIdentity from an objc.ID.
The identity of a user.
func NewCKUserIdentity ¶
func NewCKUserIdentity() CKUserIdentity
NewCKUserIdentity creates a new CKUserIdentity instance.
func NewCKUserIdentityWithCoder ¶ added in v0.6.10
func NewCKUserIdentityWithCoder(coder foundation.INSCoder) CKUserIdentity
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/init(coder:)
func (CKUserIdentity) Autorelease ¶
func (c CKUserIdentity) Autorelease() CKUserIdentity
Autorelease adds the receiver to the current autorelease pool.
func (CKUserIdentity) ContactIdentifiers ¶
func (c CKUserIdentity) ContactIdentifiers() []string
Identifiers that match contacts in the local Contacts database.
Discussion ¶
Identities that CloudKit discovers using CKDiscoverAllUserIdentitiesOperation correspond to entries in the local Contacts database, matching the identifier on CNContact. Use these identifiers with the Contacts database to get additional information about the contacts. Multiple identifiers can exist for a single discovered user because multiple contacts can contain the same email addresses or phone numbers.
To transform these identifiers into an array of unified contact identifiers, create a predicate by calling the predicateForContacts(withIdentifiers:) method, and then pass that predicate to the unifiedContacts(matching:keysToFetch:) method.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/contactIdentifiers
func (CKUserIdentity) EncodeWithCoder ¶
func (c CKUserIdentity) EncodeWithCoder(coder foundation.INSCoder)
func (CKUserIdentity) HasiCloudAccount ¶
func (c CKUserIdentity) HasiCloudAccount() bool
A Boolean value that indicates whether the user has an iCloud account.
Discussion ¶
true if the user identity has an iCloud account; otherwise, false.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/hasiCloudAccount
func (CKUserIdentity) Init ¶
func (c CKUserIdentity) Init() CKUserIdentity
Init initializes the instance.
func (CKUserIdentity) InitWithCoder ¶ added in v0.6.10
func (c CKUserIdentity) InitWithCoder(coder foundation.INSCoder) CKUserIdentity
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/init(coder:)
func (CKUserIdentity) LookupInfo ¶
func (c CKUserIdentity) LookupInfo() ICKUserIdentityLookupInfo
The lookup info for retrieving the user identity.
Discussion ¶
Use this property’s value to retrieve the user identity when using the CKDiscoverUserIdentitiesOperation and CKFetchShareParticipantsOperation operations.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/lookupInfo-swift.property
func (CKUserIdentity) NameComponents ¶
func (c CKUserIdentity) NameComponents() foundation.NSPersonNameComponents
The user’s name.
Discussion ¶
You can use this property to construct the user’s name for display. Use the components with an instance of PersonNameComponentsFormatter to create a string representation for the current locale.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/nameComponents
func (CKUserIdentity) UserRecordID ¶
func (c CKUserIdentity) UserRecordID() ICKRecordID
The user record ID for the corresponding user record.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/userRecordID
type CKUserIdentityArrayErrorHandler ¶
type CKUserIdentityArrayErrorHandler = func(*[]CKUserIdentity, error)
CKUserIdentityArrayErrorHandler handles The handler to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
- [CKContainer.DiscoverAllIdentitiesWithCompletionHandler]
type CKUserIdentityCKUserIdentityLookupInfoHandler ¶
type CKUserIdentityCKUserIdentityLookupInfoHandler = func(*CKUserIdentity, *CKUserIdentityLookupInfo)
CKUserIdentityCKUserIdentityLookupInfoHandler is the signature for a completion handler block.
type CKUserIdentityClass ¶
type CKUserIdentityClass struct {
// contains filtered or unexported fields
}
func GetCKUserIdentityClass ¶
func GetCKUserIdentityClass() CKUserIdentityClass
GetCKUserIdentityClass returns the class object for CKUserIdentity.
func (CKUserIdentityClass) Alloc ¶
func (cc CKUserIdentityClass) Alloc() CKUserIdentity
Alloc allocates memory for a new instance of the class.
func (CKUserIdentityClass) Class ¶
func (cc CKUserIdentityClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type CKUserIdentityErrorHandler ¶
type CKUserIdentityErrorHandler = func(*CKUserIdentity, error)
CKUserIdentityErrorHandler handles The handler to execute with the fetch results. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
- [CKContainer.DiscoverUserIdentityWithEmailAddressCompletionHandler]
- [CKContainer.DiscoverUserIdentityWithPhoneNumberCompletionHandler]
- [CKContainer.DiscoverUserIdentityWithUserRecordIDCompletionHandler]
type CKUserIdentityHandler ¶
type CKUserIdentityHandler = func(*CKUserIdentity)
CKUserIdentityHandler is the signature for a completion handler block.
type CKUserIdentityLookupInfo ¶
type CKUserIdentityLookupInfo struct {
objectivec.Object
}
The criteria to use when searching for discoverable iCloud users.
Overview ¶
Use this object when you want to discover the identities of your app’s users with CKDiscoverUserIdentitiesOperation, or to create a share’s participants with CKFetchShareParticipantsOperation.
You create individual instances by providing an email address, phone number, or user record ID. Alternatively, create an array of objects all at once by using one of the convenience methods, such as CKUserIdentityLookupInfoClass.LookupInfosWithEmails.
Creating a Lookup Info ¶
- CKUserIdentityLookupInfo.InitWithEmailAddress: Creates a lookup info for the specified email address.
- CKUserIdentityLookupInfo.InitWithPhoneNumber: Creates a lookup info for the specified phone number.
- CKUserIdentityLookupInfo.InitWithUserRecordID: Creates a lookup info for the specified user record ID.
Accessing the Criteria ¶
- CKUserIdentityLookupInfo.EmailAddress: The user’s email address.
- CKUserIdentityLookupInfo.PhoneNumber: The user’s phone number.
- CKUserIdentityLookupInfo.UserRecordID: The ID of the user record.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/LookupInfo-swift.class
func CKUserIdentityLookupInfoFromID ¶
func CKUserIdentityLookupInfoFromID(id objc.ID) CKUserIdentityLookupInfo
CKUserIdentityLookupInfoFromID constructs a CKUserIdentityLookupInfo from an objc.ID.
The criteria to use when searching for discoverable iCloud users.
func NewCKUserIdentityLookupInfo ¶
func NewCKUserIdentityLookupInfo() CKUserIdentityLookupInfo
NewCKUserIdentityLookupInfo creates a new CKUserIdentityLookupInfo instance.
func NewCKUserIdentityLookupInfoWithEmailAddress ¶
func NewCKUserIdentityLookupInfoWithEmailAddress(emailAddress string) CKUserIdentityLookupInfo
Creates a lookup info for the specified email address.
emailAddress: The email address for looking up the user identity.
Discussion ¶
After you create a lookup info, use the CKDiscoverUserIdentitiesOperation operation or the CKFetchShareParticipantsOperation operation to retrieve the corresponding user identity.
func NewCKUserIdentityLookupInfoWithPhoneNumber ¶
func NewCKUserIdentityLookupInfoWithPhoneNumber(phoneNumber string) CKUserIdentityLookupInfo
Creates a lookup info for the specified phone number.
phoneNumber: The phone number for looking up the user identity.
Discussion ¶
After you create a lookup info, use the CKDiscoverUserIdentitiesOperation operation or the CKFetchShareParticipantsOperation operation to retrieve the corresponding user identity.
func NewCKUserIdentityLookupInfoWithUserRecordID ¶
func NewCKUserIdentityLookupInfoWithUserRecordID(userRecordID ICKRecordID) CKUserIdentityLookupInfo
Creates a lookup info for the specified user record ID.
userRecordID: The user record ID for looking up the user identity.
Discussion ¶
After you create a lookup info, use the CKDiscoverUserIdentitiesOperation operation or the CKFetchShareParticipantsOperation operation to retrieve the corresponding user identity.
func (CKUserIdentityLookupInfo) Autorelease ¶
func (c CKUserIdentityLookupInfo) Autorelease() CKUserIdentityLookupInfo
Autorelease adds the receiver to the current autorelease pool.
func (CKUserIdentityLookupInfo) EmailAddress ¶
func (c CKUserIdentityLookupInfo) EmailAddress() string
The user’s email address.
func (CKUserIdentityLookupInfo) EncodeWithCoder ¶
func (c CKUserIdentityLookupInfo) EncodeWithCoder(coder foundation.INSCoder)
func (CKUserIdentityLookupInfo) Init ¶
func (c CKUserIdentityLookupInfo) Init() CKUserIdentityLookupInfo
Init initializes the instance.
func (CKUserIdentityLookupInfo) InitWithEmailAddress ¶
func (c CKUserIdentityLookupInfo) InitWithEmailAddress(emailAddress string) CKUserIdentityLookupInfo
Creates a lookup info for the specified email address.
emailAddress: The email address for looking up the user identity.
Discussion ¶
After you create a lookup info, use the CKDiscoverUserIdentitiesOperation operation or the CKFetchShareParticipantsOperation operation to retrieve the corresponding user identity.
func (CKUserIdentityLookupInfo) InitWithPhoneNumber ¶
func (c CKUserIdentityLookupInfo) InitWithPhoneNumber(phoneNumber string) CKUserIdentityLookupInfo
Creates a lookup info for the specified phone number.
phoneNumber: The phone number for looking up the user identity.
Discussion ¶
After you create a lookup info, use the CKDiscoverUserIdentitiesOperation operation or the CKFetchShareParticipantsOperation operation to retrieve the corresponding user identity.
func (CKUserIdentityLookupInfo) InitWithUserRecordID ¶
func (c CKUserIdentityLookupInfo) InitWithUserRecordID(userRecordID ICKRecordID) CKUserIdentityLookupInfo
Creates a lookup info for the specified user record ID.
userRecordID: The user record ID for looking up the user identity.
Discussion ¶
After you create a lookup info, use the CKDiscoverUserIdentitiesOperation operation or the CKFetchShareParticipantsOperation operation to retrieve the corresponding user identity.
func (CKUserIdentityLookupInfo) PhoneNumber ¶
func (c CKUserIdentityLookupInfo) PhoneNumber() string
The user’s phone number.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/LookupInfo-swift.class/phoneNumber
func (CKUserIdentityLookupInfo) UserRecordID ¶
func (c CKUserIdentityLookupInfo) UserRecordID() ICKRecordID
The ID of the user record.
Discussion ¶
Use this value to retrieve the user record for the user identity. The user record doesn’t contain any personal information about the user, by default. You can add data to the user record, but you shouldn’t add anything sensitive.
type CKUserIdentityLookupInfoClass ¶
type CKUserIdentityLookupInfoClass struct {
// contains filtered or unexported fields
}
func GetCKUserIdentityLookupInfoClass ¶
func GetCKUserIdentityLookupInfoClass() CKUserIdentityLookupInfoClass
GetCKUserIdentityLookupInfoClass returns the class object for CKUserIdentityLookupInfo.
func (CKUserIdentityLookupInfoClass) Alloc ¶
func (cc CKUserIdentityLookupInfoClass) Alloc() CKUserIdentityLookupInfo
Alloc allocates memory for a new instance of the class.
func (CKUserIdentityLookupInfoClass) Class ¶
func (cc CKUserIdentityLookupInfoClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (CKUserIdentityLookupInfoClass) LookupInfosWithEmails ¶
func (_CKUserIdentityLookupInfoClass CKUserIdentityLookupInfoClass) LookupInfosWithEmails(emails []string) []CKUserIdentityLookupInfo
Returns an array of lookup infos for the specifed email addresses.
emails: The email addresses for looking up the user identities.
Discussion ¶
Use the values that this method returns in an CKDiscoverUserIdentitiesOperation operation or an CKFetchShareParticipantsOperation operation to retrieve the corresponding user identities.
func (CKUserIdentityLookupInfoClass) LookupInfosWithPhoneNumbers ¶
func (_CKUserIdentityLookupInfoClass CKUserIdentityLookupInfoClass) LookupInfosWithPhoneNumbers(phoneNumbers []string) []CKUserIdentityLookupInfo
Returns an array of lookup infos for the specifed phone numbers.
phoneNumbers: The phone numbers for looking up the user identities.
Discussion ¶
Use the values that this method returns in an CKDiscoverUserIdentitiesOperation operation or an CKFetchShareParticipantsOperation operation to retrieve the corresponding user identities.
func (CKUserIdentityLookupInfoClass) LookupInfosWithRecordIDs ¶
func (_CKUserIdentityLookupInfoClass CKUserIdentityLookupInfoClass) LookupInfosWithRecordIDs(recordIDs []CKRecordID) []CKUserIdentityLookupInfo
Returns an array of lookup infos for the specifed user record IDs.
recordIDs: The user record IDs for looking up the user identities.
Discussion ¶
Use the values that this method returns in an CKDiscoverUserIdentitiesOperation operation or an CKFetchShareParticipantsOperation operation to retrieve the corresponding user identities.
type ErrorHandler ¶
type ErrorHandler = func(error)
ErrorHandler handles The block to execute when the fetch completes. The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
- [CKContainer.RequestApplicationPermissionCompletionHandler]
- [CKContainer.StatusForApplicationPermissionCompletionHandler]
- CKSyncEngine.FetchChangesWithCompletionHandler
- CKSyncEngine.FetchChangesWithOptionsCompletionHandler
- CKSyncEngine.SendChangesWithCompletionHandler
- CKSyncEngine.SendChangesWithOptionsCompletionHandler
type ICKAcceptSharesOperation ¶
type ICKAcceptSharesOperation interface {
ICKOperation
InitWithShareMetadatas(shareMetadatas []CKShareMetadata) CKAcceptSharesOperation
// The share metadatas to process.
}
An interface definition for the CKAcceptSharesOperation class.
Creating a Share Accept Operation ¶
- [ICKAcceptSharesOperation.InitWithShareMetadatas]: Creates an operation for accepting the specified shares.
Processing the Share Accept Results ¶
- [ICKAcceptSharesOperation.ShareMetadatas]: The share metadatas to process.
- [ICKAcceptSharesOperation.SetShareMetadatas]
See: https://developer.apple.com/documentation/CloudKit/CKAcceptSharesOperation
type ICKAllowedSharingOptions ¶
type ICKAllowedSharingOptions interface {
objectivec.IObject
// Creates and initializes an allowed sharing options object.
InitWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions(allowedParticipantPermissionOptions CKSharingParticipantPermissionOption, allowedParticipantAccessOptions CKSharingParticipantAccessOption) CKAllowedSharingOptions
// The permission option the system uses to control whether a user can share publicly or privately.
AllowedParticipantAccessOptions() CKSharingParticipantAccessOption
SetAllowedParticipantAccessOptions(value CKSharingParticipantAccessOption)
// The permission option the system uses to control whether a user can grant read-only or write access.
AllowedParticipantPermissionOptions() CKSharingParticipantPermissionOption
SetAllowedParticipantPermissionOptions(value CKSharingParticipantPermissionOption)
InitWithCoder(coder foundation.INSCoder) CKAllowedSharingOptions
// Default value is [NO]. If set, the system sharing UI will allow the user to configure whether access requests are enabled on the share.
AllowsAccessRequests() bool
SetAllowsAccessRequests(value bool)
// Default value is [NO]. If set, the system sharing UI will allow the user to choose whether added participants can invite others to the share. Shares with [CKShare.ParticipantRole.administrator](<doc://com.apple.cloudkit/documentation/CloudKit/CKShare/ParticipantRole/administrator>) participants will be returned as read-only to devices running OS versions prior to this role being introduced. Administrator participants on these read-only shares will be returned as [CKShare.ParticipantRole.privateUser](<doc://com.apple.cloudkit/documentation/CloudKit/CKShare/ParticipantRole/privateUser>).
AllowsParticipantsToInviteOthers() bool
SetAllowsParticipantsToInviteOthers(value bool)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKAllowedSharingOptions class.
Creating sharing options ¶
- [ICKAllowedSharingOptions.InitWithAllowedParticipantPermissionOptionsAllowedParticipantAccessOptions]: Creates and initializes an allowed sharing options object.
Configuring the options ¶
- [ICKAllowedSharingOptions.AllowedParticipantAccessOptions]: The permission option the system uses to control whether a user can share publicly or privately.
- [ICKAllowedSharingOptions.SetAllowedParticipantAccessOptions]
- [ICKAllowedSharingOptions.AllowedParticipantPermissionOptions]: The permission option the system uses to control whether a user can grant read-only or write access.
- [ICKAllowedSharingOptions.SetAllowedParticipantPermissionOptions]
Initializers ¶
- [ICKAllowedSharingOptions.InitWithCoder]
Instance Properties ¶
- [ICKAllowedSharingOptions.AllowsAccessRequests]: Default value is [NO]. If set, the system sharing UI will allow the user to configure whether access requests are enabled on the share.
- [ICKAllowedSharingOptions.SetAllowsAccessRequests]
- [ICKAllowedSharingOptions.AllowsParticipantsToInviteOthers]: Default value is [NO]. If set, the system sharing UI will allow the user to choose whether added participants can invite others to the share. Shares with [CKShare.ParticipantRole.administrator](<doc://com.apple.cloudkit/documentation/CloudKit/CKShare/ParticipantRole/administrator>) participants will be returned as read-only to devices running OS versions prior to this role being introduced. Administrator participants on these read-only shares will be returned as [CKShare.ParticipantRole.privateUser](<doc://com.apple.cloudkit/documentation/CloudKit/CKShare/ParticipantRole/privateUser>).
- [ICKAllowedSharingOptions.SetAllowsParticipantsToInviteOthers]
See: https://developer.apple.com/documentation/CloudKit/CKAllowedSharingOptions
type ICKAsset ¶
type ICKAsset interface {
objectivec.IObject
// Creates an asset that references a file.
InitWithFileURL(fileURL foundation.NSURL) CKAsset
// The URL for accessing the asset.
FileURL() foundation.NSURL
}
An interface definition for the CKAsset class.
Creating an Asset ¶
- [ICKAsset.InitWithFileURL]: Creates an asset that references a file.
Getting the URL of the Asset ¶
- [ICKAsset.FileURL]: The URL for accessing the asset.
See: https://developer.apple.com/documentation/CloudKit/CKAsset
type ICKContainer ¶
type ICKContainer interface {
objectivec.IObject
// The user’s private database.
PrivateCloudDatabase() ICKDatabase
// The app’s public database.
PublicCloudDatabase() ICKDatabase
SharedCloudDatabase() ICKDatabase
// Returns the database with the specified scope.
DatabaseWithDatabaseScope(databaseScope CKDatabaseScope) ICKDatabase
// The container’s unique identifier.
ContainerIdentifier() string
// Determines whether the system can access the user’s iCloud account.
AccountStatusWithCompletionHandler(completionHandler CKAccountStatusErrorHandler)
// Adds an operation to the container’s queue.
AddOperation(operation ICKOperation)
FetchShareParticipantWithEmailAddressCompletionHandler(emailAddress string, completionHandler CKShareParticipantErrorHandler)
FetchShareParticipantWithPhoneNumberCompletionHandler(phoneNumber string, completionHandler CKShareParticipantErrorHandler)
FetchShareParticipantWithUserRecordIDCompletionHandler(userRecordID ICKRecordID, completionHandler CKShareParticipantErrorHandler)
// Fetches the user record ID of the current user.
FetchUserRecordIDWithCompletionHandler(completionHandler CKRecordIDErrorHandler)
FetchShareMetadataWithURLCompletionHandler(url foundation.NSURL, completionHandler CKShareMetadataErrorHandler)
AcceptShareMetadataCompletionHandler(metadata ICKShareMetadata, completionHandler CKShareErrorHandler)
}
An interface definition for the CKContainer class.
Getting the Public and Private Databases ¶
- [ICKContainer.PrivateCloudDatabase]: The user’s private database.
- [ICKContainer.PublicCloudDatabase]: The app’s public database.
- [ICKContainer.SharedCloudDatabase]: The database that contains shared data.
- [ICKContainer.DatabaseWithDatabaseScope]: Returns the database with the specified scope.
Getting the Container’s Identifier ¶
- [ICKContainer.ContainerIdentifier]: The container’s unique identifier.
Determining the User’s iCloud Access Status ¶
- [ICKContainer.AccountStatusWithCompletionHandler]: Determines whether the system can access the user’s iCloud account.
Performing Operations on the Container ¶
- [ICKContainer.AddOperation]: Adds an operation to the container’s queue.
Discovering User Records ¶
- [ICKContainer.FetchShareParticipantWithEmailAddressCompletionHandler]: Fetches the share participant with the specified email address.
- [ICKContainer.FetchShareParticipantWithPhoneNumberCompletionHandler]: Fetches the share participant with the specified phone number.
- [ICKContainer.FetchShareParticipantWithUserRecordIDCompletionHandler]: Fetches the share participant with the specified user record ID.
- [ICKContainer.FetchUserRecordIDWithCompletionHandler]: Fetches the user record ID of the current user.
Accessing Container Metadata ¶
- [ICKContainer.FetchShareMetadataWithURLCompletionHandler]: Fetches the share metadata for the specified share URL.
- [ICKContainer.AcceptShareMetadataCompletionHandler]: Accepts the specified share metadata.
See: https://developer.apple.com/documentation/CloudKit/CKContainer
type ICKDatabase ¶
type ICKDatabase interface {
objectivec.IObject
// Fetches a specific record.
FetchRecordWithIDCompletionHandler(recordID ICKRecordID, completionHandler CKRecordErrorHandler)
// Saves a specific record.
SaveRecordCompletionHandler(record ICKRecord, completionHandler CKRecordErrorHandler)
// Deletes a specific record.
DeleteRecordWithIDCompletionHandler(recordID ICKRecordID, completionHandler CKRecordIDErrorHandler)
// Fetches all record zones from the current database.
FetchAllRecordZonesWithCompletionHandler(completionHandler CKRecordZoneArrayErrorHandler)
// Fetches a specific record zone.
FetchRecordZoneWithIDCompletionHandler(zoneID ICKRecordZoneID, completionHandler CKRecordZoneErrorHandler)
// Saves a specific record zone.
SaveRecordZoneCompletionHandler(zone ICKRecordZone, completionHandler CKRecordZoneErrorHandler)
// Deletes a specific record zone.
DeleteRecordZoneWithIDCompletionHandler(zoneID ICKRecordZoneID, completionHandler CKRecordZoneIDErrorHandler)
// Fetches all subscriptions from the current database.
FetchAllSubscriptionsWithCompletionHandler(completionHandler CKSubscriptionArrayErrorHandler)
// Saves a specific subscription.
SaveSubscriptionCompletionHandler(subscription ICKSubscription, completionHandler CKSubscriptionErrorHandler)
// Executes the specified operation in the current database.
AddOperation(operation ICKDatabaseOperation)
// The type of database.
DatabaseScope() CKDatabaseScope
}
An interface definition for the CKDatabase class.
Fetching Records ¶
- [ICKDatabase.FetchRecordWithIDCompletionHandler]: Fetches a specific record.
Modifying Records ¶
- [ICKDatabase.SaveRecordCompletionHandler]: Saves a specific record.
- [ICKDatabase.DeleteRecordWithIDCompletionHandler]: Deletes a specific record.
Fetching Record Zones ¶
- [ICKDatabase.FetchAllRecordZonesWithCompletionHandler]: Fetches all record zones from the current database.
- [ICKDatabase.FetchRecordZoneWithIDCompletionHandler]: Fetches a specific record zone.
Modifying Record Zones ¶
- [ICKDatabase.SaveRecordZoneCompletionHandler]: Saves a specific record zone.
- [ICKDatabase.DeleteRecordZoneWithIDCompletionHandler]: Deletes a specific record zone.
Fetching Subscriptions ¶
- [ICKDatabase.FetchAllSubscriptionsWithCompletionHandler]: Fetches all subscriptions from the current database.
Modifying Subscriptions ¶
- [ICKDatabase.SaveSubscriptionCompletionHandler]: Saves a specific subscription.
Running Operations ¶
- [ICKDatabase.AddOperation]: Executes the specified operation in the current database.
Getting the Database Type ¶
- [ICKDatabase.DatabaseScope]: The type of database.
See: https://developer.apple.com/documentation/CloudKit/CKDatabase
type ICKDatabaseNotification ¶
type ICKDatabaseNotification interface {
ICKNotification
// The type of database.
DatabaseScope() CKDatabaseScope
}
An interface definition for the CKDatabaseNotification class.
Getting the Database Scope ¶
- [ICKDatabaseNotification.DatabaseScope]: The type of database.
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseNotification
type ICKDatabaseOperation ¶
type ICKDatabaseOperation interface {
ICKOperation
// The database that the operation uses.
Database() ICKDatabase
SetDatabase(value ICKDatabase)
}
An interface definition for the CKDatabaseOperation class.
Accessing the Database ¶
- [ICKDatabaseOperation.Database]: The database that the operation uses.
- [ICKDatabaseOperation.SetDatabase]
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseOperation
type ICKDatabaseSubscription ¶
type ICKDatabaseSubscription interface {
ICKSubscription
// The type of record that the subscription queries.
RecordType() unsafe.Pointer
SetRecordType(value kernel.Pointer)
}
An interface definition for the CKDatabaseSubscription class.
Accessing the Subscription Metadata ¶
- [ICKDatabaseSubscription.RecordType]: The type of record that the subscription queries.
- [ICKDatabaseSubscription.SetRecordType]
See: https://developer.apple.com/documentation/CloudKit/CKDatabaseSubscription
type ICKDiscoverAllUserIdentitiesOperation ¶
type ICKDiscoverAllUserIdentitiesOperation interface {
ICKOperation
// The closure to execute for each user identity.
UserIdentityDiscoveredBlock() CKUserIdentityHandler
SetUserIdentityDiscoveredBlock(value CKUserIdentityHandler)
}
An interface definition for the CKDiscoverAllUserIdentitiesOperation class.
Processing the Operation Results ¶
- [ICKDiscoverAllUserIdentitiesOperation.UserIdentityDiscoveredBlock]: The closure to execute for each user identity.
- [ICKDiscoverAllUserIdentitiesOperation.SetUserIdentityDiscoveredBlock]
See: https://developer.apple.com/documentation/CloudKit/CKDiscoverAllUserIdentitiesOperation
type ICKDiscoverUserIdentitiesOperation ¶
type ICKDiscoverUserIdentitiesOperation interface {
ICKOperation
// The lookup info for discovering user identities.
UserIdentityLookupInfos() []CKUserIdentityLookupInfo
SetUserIdentityLookupInfos(value []CKUserIdentityLookupInfo)
// The closure to execute for each user identity.
UserIdentityDiscoveredBlock() CKUserIdentityCKUserIdentityLookupInfoHandler
SetUserIdentityDiscoveredBlock(value CKUserIdentityCKUserIdentityLookupInfoHandler)
}
An interface definition for the CKDiscoverUserIdentitiesOperation class.
Configuring the Operation ¶
- [ICKDiscoverUserIdentitiesOperation.UserIdentityLookupInfos]: The lookup info for discovering user identities.
- [ICKDiscoverUserIdentitiesOperation.SetUserIdentityLookupInfos]
Processing the Results ¶
- [ICKDiscoverUserIdentitiesOperation.UserIdentityDiscoveredBlock]: The closure to execute for each user identity.
- [ICKDiscoverUserIdentitiesOperation.SetUserIdentityDiscoveredBlock]
See: https://developer.apple.com/documentation/CloudKit/CKDiscoverUserIdentitiesOperation
type ICKFetchDatabaseChangesOperation ¶
type ICKFetchDatabaseChangesOperation interface {
ICKDatabaseOperation
// Creates an operation for fetching database changes.
InitWithPreviousServerChangeToken(previousServerChangeToken ICKServerChangeToken) CKFetchDatabaseChangesOperation
// A Boolean value that indicates whether to send repeated requests to the server.
FetchAllChanges() bool
SetFetchAllChanges(value bool)
// The server change token.
PreviousServerChangeToken() ICKServerChangeToken
SetPreviousServerChangeToken(value ICKServerChangeToken)
// The maximum number of results that the operation fetches.
ResultsLimit() uint
SetResultsLimit(value uint)
// The closure to execute with a single record zone change.
RecordZoneWithIDChangedBlock() CKRecordZoneIDHandler
SetRecordZoneWithIDChangedBlock(value CKRecordZoneIDHandler)
// The closure to execute when a record zone no longer exists.
RecordZoneWithIDWasDeletedBlock() CKRecordZoneIDHandler
SetRecordZoneWithIDWasDeletedBlock(value CKRecordZoneIDHandler)
// The closure to execute when a user-invoked account reset deletes a record zone.
RecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock() CKRecordZoneIDHandler
SetRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock(value CKRecordZoneIDHandler)
// The closure to execute when CloudKit purges a record zone.
RecordZoneWithIDWasPurgedBlock() CKRecordZoneIDHandler
SetRecordZoneWithIDWasPurgedBlock(value CKRecordZoneIDHandler)
// The closure to execute when the change token updates.
ChangeTokenUpdatedBlock() CKServerChangeTokenHandler
SetChangeTokenUpdatedBlock(value CKServerChangeTokenHandler)
}
An interface definition for the CKFetchDatabaseChangesOperation class.
Creating an Operation ¶
- [ICKFetchDatabaseChangesOperation.InitWithPreviousServerChangeToken]: Creates an operation for fetching database changes.
Configuring the Operation ¶
- [ICKFetchDatabaseChangesOperation.FetchAllChanges]: A Boolean value that indicates whether to send repeated requests to the server.
- [ICKFetchDatabaseChangesOperation.SetFetchAllChanges]
- [ICKFetchDatabaseChangesOperation.PreviousServerChangeToken]: The server change token.
- [ICKFetchDatabaseChangesOperation.SetPreviousServerChangeToken]
- [ICKFetchDatabaseChangesOperation.ResultsLimit]: The maximum number of results that the operation fetches.
- [ICKFetchDatabaseChangesOperation.SetResultsLimit]
Processing the Operation’s Results ¶
- [ICKFetchDatabaseChangesOperation.RecordZoneWithIDChangedBlock]: The closure to execute with a single record zone change.
- [ICKFetchDatabaseChangesOperation.SetRecordZoneWithIDChangedBlock]
- [ICKFetchDatabaseChangesOperation.RecordZoneWithIDWasDeletedBlock]: The closure to execute when a record zone no longer exists.
- [ICKFetchDatabaseChangesOperation.SetRecordZoneWithIDWasDeletedBlock]
- [ICKFetchDatabaseChangesOperation.RecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock]: The closure to execute when a user-invoked account reset deletes a record zone.
- [ICKFetchDatabaseChangesOperation.SetRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock]
- [ICKFetchDatabaseChangesOperation.RecordZoneWithIDWasPurgedBlock]: The closure to execute when CloudKit purges a record zone.
- [ICKFetchDatabaseChangesOperation.SetRecordZoneWithIDWasPurgedBlock]
- [ICKFetchDatabaseChangesOperation.ChangeTokenUpdatedBlock]: The closure to execute when the change token updates.
- [ICKFetchDatabaseChangesOperation.SetChangeTokenUpdatedBlock]
See: https://developer.apple.com/documentation/CloudKit/CKFetchDatabaseChangesOperation
type ICKFetchRecordZoneChangesConfiguration ¶
type ICKFetchRecordZoneChangesConfiguration interface {
objectivec.IObject
// The server change token.
PreviousServerChangeToken() ICKServerChangeToken
SetPreviousServerChangeToken(value ICKServerChangeToken)
// The maximum number of records that CloudKit retrieves when fetching zone changes.
ResultsLimit() uint
SetResultsLimit(value uint)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKFetchRecordZoneChangesConfiguration class.
Accessing a Zone Change Configuration ¶
- [ICKFetchRecordZoneChangesConfiguration.PreviousServerChangeToken]: The server change token.
- [ICKFetchRecordZoneChangesConfiguration.SetPreviousServerChangeToken]
- [ICKFetchRecordZoneChangesConfiguration.ResultsLimit]: The maximum number of records that CloudKit retrieves when fetching zone changes.
- [ICKFetchRecordZoneChangesConfiguration.SetResultsLimit]
type ICKFetchRecordZoneChangesOperation ¶
type ICKFetchRecordZoneChangesOperation interface {
ICKDatabaseOperation
// A dictionary of configurations for fetching change operations by zone identifier.
ConfigurationsByRecordZoneID() foundation.INSDictionary
SetConfigurationsByRecordZoneID(value foundation.INSDictionary)
// A Boolean value that indicates whether to send repeated requests to the server.
FetchAllChanges() bool
SetFetchAllChanges(value bool)
// The IDs of the record zones that contain the records to fetch.
RecordZoneIDs() []CKRecordZoneID
SetRecordZoneIDs(value []CKRecordZoneID)
// The closure to execute when a record no longer exists.
RecordWithIDWasDeletedBlock() unsafe.Pointer
SetRecordWithIDWasDeletedBlock(value kernel.Pointer)
// The closure to execute when the change token updates.
RecordZoneChangeTokensUpdatedBlock() CKRecordZoneIDCKServerChangeTokenDataHandler
SetRecordZoneChangeTokensUpdatedBlock(value CKRecordZoneIDCKServerChangeTokenDataHandler)
// The closure to execute with the results of retrieving a record change.
RecordWasChangedBlock() unsafe.Pointer
SetRecordWasChangedBlock(value kernel.Pointer)
// Configuration options for each record zone that the operation retrieves.
OptionsByRecordZoneID() unsafe.Pointer
SetOptionsByRecordZoneID(value kernel.Pointer)
}
An interface definition for the CKFetchRecordZoneChangesOperation class.
Configuring the Zone Change Operation ¶
- [ICKFetchRecordZoneChangesOperation.ConfigurationsByRecordZoneID]: A dictionary of configurations for fetching change operations by zone identifier.
- [ICKFetchRecordZoneChangesOperation.SetConfigurationsByRecordZoneID]
- [ICKFetchRecordZoneChangesOperation.FetchAllChanges]: A Boolean value that indicates whether to send repeated requests to the server.
- [ICKFetchRecordZoneChangesOperation.SetFetchAllChanges]
- [ICKFetchRecordZoneChangesOperation.RecordZoneIDs]: The IDs of the record zones that contain the records to fetch.
- [ICKFetchRecordZoneChangesOperation.SetRecordZoneIDs]
Processing the Zone Change Operation Results ¶
- [ICKFetchRecordZoneChangesOperation.RecordWithIDWasDeletedBlock]: The closure to execute when a record no longer exists.
- [ICKFetchRecordZoneChangesOperation.SetRecordWithIDWasDeletedBlock]
- [ICKFetchRecordZoneChangesOperation.RecordZoneChangeTokensUpdatedBlock]: The closure to execute when the change token updates.
- [ICKFetchRecordZoneChangesOperation.SetRecordZoneChangeTokensUpdatedBlock]
Instance Properties ¶
- [ICKFetchRecordZoneChangesOperation.RecordWasChangedBlock]: The closure to execute with the results of retrieving a record change.
- [ICKFetchRecordZoneChangesOperation.SetRecordWasChangedBlock]
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZoneChangesOperation
type ICKFetchRecordZonesOperation ¶
type ICKFetchRecordZonesOperation interface {
ICKDatabaseOperation
// Creates an operation for fetching the specified record zones.
InitWithRecordZoneIDs(zoneIDs []CKRecordZoneID) CKFetchRecordZonesOperation
// The IDs of the record zones to retrieve.
RecordZoneIDs() []CKRecordZoneID
SetRecordZoneIDs(value []CKRecordZoneID)
}
An interface definition for the CKFetchRecordZonesOperation class.
Initializing the Zone Fetch Operation ¶
- [ICKFetchRecordZonesOperation.InitWithRecordZoneIDs]: Creates an operation for fetching the specified record zones.
Configuring a Zone Fetch Operation ¶
- [ICKFetchRecordZonesOperation.RecordZoneIDs]: The IDs of the record zones to retrieve.
- [ICKFetchRecordZonesOperation.SetRecordZoneIDs]
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordZonesOperation
type ICKFetchRecordsOperation ¶
type ICKFetchRecordsOperation interface {
ICKDatabaseOperation
// Creates a fetch operation for retrieving the records with the specified IDs.
InitWithRecordIDs(recordIDs []CKRecordID) CKFetchRecordsOperation
// The record IDs of the records to fetch.
RecordIDs() []CKRecordID
SetRecordIDs(value []CKRecordID)
// The fields of the records to fetch.
DesiredKeys() unsafe.Pointer
SetDesiredKeys(value kernel.Pointer)
// The closure to execute with progress information for individual records.
PerRecordProgressBlock() CKRecordIDFloat64Handler
SetPerRecordProgressBlock(value CKRecordIDFloat64Handler)
}
An interface definition for the CKFetchRecordsOperation class.
Creating a Record Fetch Operation ¶
- [ICKFetchRecordsOperation.InitWithRecordIDs]: Creates a fetch operation for retrieving the records with the specified IDs.
Configuring a Record Fetch Operation ¶
- [ICKFetchRecordsOperation.RecordIDs]: The record IDs of the records to fetch.
- [ICKFetchRecordsOperation.SetRecordIDs]
- [ICKFetchRecordsOperation.DesiredKeys]: The fields of the records to fetch.
- [ICKFetchRecordsOperation.SetDesiredKeys]
Processing Record Fetch Results ¶
- [ICKFetchRecordsOperation.PerRecordProgressBlock]: The closure to execute with progress information for individual records.
- [ICKFetchRecordsOperation.SetPerRecordProgressBlock]
See: https://developer.apple.com/documentation/CloudKit/CKFetchRecordsOperation
type ICKFetchShareMetadataOperation ¶
type ICKFetchShareMetadataOperation interface {
ICKOperation
InitWithShareURLs(shareURLs []foundation.NSURL) CKFetchShareMetadataOperation
// The URLs of the shares to fetch.
// A Boolean value that indicates whether to retrieve the root record.
// The fields to return when fetching the root record.
}
An interface definition for the CKFetchShareMetadataOperation class.
Creating an Operation ¶
- [ICKFetchShareMetadataOperation.InitWithShareURLs]: Creates an operation for fetching the metadata for the specified shares.
Configuring the Operation ¶
- [ICKFetchShareMetadataOperation.ShareURLs]: The URLs of the shares to fetch.
- [ICKFetchShareMetadataOperation.SetShareURLs]
- [ICKFetchShareMetadataOperation.ShouldFetchRootRecord]: A Boolean value that indicates whether to retrieve the root record.
- [ICKFetchShareMetadataOperation.SetShouldFetchRootRecord]
Instance Properties ¶
- [ICKFetchShareMetadataOperation.RootRecordDesiredKeys]: The fields to return when fetching the root record.
- [ICKFetchShareMetadataOperation.SetRootRecordDesiredKeys]
See: https://developer.apple.com/documentation/CloudKit/CKFetchShareMetadataOperation
type ICKFetchShareParticipantsOperation ¶
type ICKFetchShareParticipantsOperation interface {
ICKOperation
InitWithUserIdentityLookupInfos(userIdentityLookupInfos []CKUserIdentityLookupInfo) CKFetchShareParticipantsOperation
// The user data for the participants.
}
An interface definition for the CKFetchShareParticipantsOperation class.
Creating an Operation ¶
- [ICKFetchShareParticipantsOperation.InitWithUserIdentityLookupInfos]: Creates an operation for generating share participants from the specified user data.
Configuring the Operation ¶
- [ICKFetchShareParticipantsOperation.UserIdentityLookupInfos]: The user data for the participants.
- [ICKFetchShareParticipantsOperation.SetUserIdentityLookupInfos]
See: https://developer.apple.com/documentation/CloudKit/CKFetchShareParticipantsOperation
type ICKFetchSubscriptionsOperation ¶
type ICKFetchSubscriptionsOperation interface {
ICKDatabaseOperation
// The IDs of the subscriptions to fetch.
SubscriptionIDs() unsafe.Pointer
SetSubscriptionIDs(value kernel.Pointer)
// The block to execute with the fetch results.
FetchSubscriptionCompletionBlock() func(kernel.Pointer, kernel.Pointer)
SetFetchSubscriptionCompletionBlock(value func(kernel.Pointer, kernel.Pointer))
}
An interface definition for the CKFetchSubscriptionsOperation class.
Configuring the Fetch Subscriptions Operation ¶
- [ICKFetchSubscriptionsOperation.SubscriptionIDs]: The IDs of the subscriptions to fetch.
- [ICKFetchSubscriptionsOperation.SetSubscriptionIDs]
Processing the Fetch Subscription Results ¶
- [ICKFetchSubscriptionsOperation.FetchSubscriptionCompletionBlock]: The block to execute with the fetch results.
- [ICKFetchSubscriptionsOperation.SetFetchSubscriptionCompletionBlock]
See: https://developer.apple.com/documentation/CloudKit/CKFetchSubscriptionsOperation
type ICKFetchWebAuthTokenOperation ¶
type ICKFetchWebAuthTokenOperation interface {
ICKDatabaseOperation
// Creates a fetch operation for the specified API token.
InitWithAPIToken(APIToken string) CKFetchWebAuthTokenOperation
// The API token that allows access to an app’s container.
APIToken() string
SetAPIToken(value string)
}
An interface definition for the CKFetchWebAuthTokenOperation class.
Creating a Fetch Token Operation ¶
- [ICKFetchWebAuthTokenOperation.InitWithAPIToken]: Creates a fetch operation for the specified API token.
Managing the Operation’s Configuration ¶
- [ICKFetchWebAuthTokenOperation.APIToken]: The API token that allows access to an app’s container.
- [ICKFetchWebAuthTokenOperation.SetAPIToken]
See: https://developer.apple.com/documentation/CloudKit/CKFetchWebAuthTokenOperation
type ICKLocationSortDescriptor ¶
type ICKLocationSortDescriptor interface {
foundation.INSSortDescriptor
// Creates a location sort descriptor using the specified key and relative location.
InitWithKeyRelativeLocation(key string, relativeLocation unsafe.Pointer) CKLocationSortDescriptor
// The reference location for sorting records.
RelativeLocation() unsafe.Pointer
}
An interface definition for the CKLocationSortDescriptor class.
Creating a Location Sort Descriptor ¶
- [ICKLocationSortDescriptor.InitWithKeyRelativeLocation]: Creates a location sort descriptor using the specified key and relative location.
Accessing the Location Value ¶
- [ICKLocationSortDescriptor.RelativeLocation]: The reference location for sorting records.
See: https://developer.apple.com/documentation/CloudKit/CKLocationSortDescriptor
type ICKModifyRecordZonesOperation ¶
type ICKModifyRecordZonesOperation interface {
ICKDatabaseOperation
// The record zones to save to the database.
RecordZonesToSave() []CKRecordZone
SetRecordZonesToSave(value []CKRecordZone)
// The IDs of the record zones to delete permanently from the database.
RecordZoneIDsToDelete() []CKRecordZoneID
SetRecordZoneIDsToDelete(value []CKRecordZoneID)
// The closure to execute when CloudKit deletes a record zone.
PerRecordZoneDeleteBlock() unsafe.Pointer
SetPerRecordZoneDeleteBlock(value kernel.Pointer)
// The closure to execute when CloudKit saves a record zone.
PerRecordZoneSaveBlock() unsafe.Pointer
SetPerRecordZoneSaveBlock(value kernel.Pointer)
}
An interface definition for the CKModifyRecordZonesOperation class.
Configuring the Modify Zones Operation ¶
- [ICKModifyRecordZonesOperation.RecordZonesToSave]: The record zones to save to the database.
- [ICKModifyRecordZonesOperation.SetRecordZonesToSave]
- [ICKModifyRecordZonesOperation.RecordZoneIDsToDelete]: The IDs of the record zones to delete permanently from the database.
- [ICKModifyRecordZonesOperation.SetRecordZoneIDsToDelete]
Instance Properties ¶
- [ICKModifyRecordZonesOperation.PerRecordZoneDeleteBlock]: The closure to execute when CloudKit deletes a record zone.
- [ICKModifyRecordZonesOperation.SetPerRecordZoneDeleteBlock]
- [ICKModifyRecordZonesOperation.PerRecordZoneSaveBlock]: The closure to execute when CloudKit saves a record zone.
- [ICKModifyRecordZonesOperation.SetPerRecordZoneSaveBlock]
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordZonesOperation
type ICKModifyRecordsOperation ¶
type ICKModifyRecordsOperation interface {
ICKDatabaseOperation
// The records to save to the database.
RecordsToSave() []CKRecord
SetRecordsToSave(value []CKRecord)
// The IDs of the records to delete permanently from the database.
RecordIDsToDelete() []CKRecordID
SetRecordIDsToDelete(value []CKRecordID)
// A token that tracks local changes to records.
ClientChangeTokenData() foundation.NSData
SetClientChangeTokenData(value foundation.NSData)
// A Boolean value that indicates whether the entire operation fails when CloudKit can’t update one or more records in a record zone.
Atomic() bool
SetAtomic(value bool)
// The policy to use when saving changes to records.
SavePolicy() CKRecordSavePolicy
SetSavePolicy(value CKRecordSavePolicy)
// The closure to execute with progress information for individual records.
PerRecordProgressBlock() CKRecordFloat64Handler
SetPerRecordProgressBlock(value CKRecordFloat64Handler)
// The closure to execute when CloudKit deletes a record.
PerRecordDeleteBlock() unsafe.Pointer
SetPerRecordDeleteBlock(value kernel.Pointer)
// The closure to execute when CloudKit saves a record.
PerRecordSaveBlock() unsafe.Pointer
SetPerRecordSaveBlock(value kernel.Pointer)
}
An interface definition for the CKModifyRecordsOperation class.
Configuring the Modify Record Operation ¶
- [ICKModifyRecordsOperation.RecordsToSave]: The records to save to the database.
- [ICKModifyRecordsOperation.SetRecordsToSave]
- [ICKModifyRecordsOperation.RecordIDsToDelete]: The IDs of the records to delete permanently from the database.
- [ICKModifyRecordsOperation.SetRecordIDsToDelete]
- [ICKModifyRecordsOperation.ClientChangeTokenData]: A token that tracks local changes to records.
- [ICKModifyRecordsOperation.SetClientChangeTokenData]
- [ICKModifyRecordsOperation.Atomic]: A Boolean value that indicates whether the entire operation fails when CloudKit can’t update one or more records in a record zone.
- [ICKModifyRecordsOperation.SetAtomic]
- [ICKModifyRecordsOperation.SavePolicy]: The policy to use when saving changes to records.
- [ICKModifyRecordsOperation.SetSavePolicy]
Processing the Modify Record Results ¶
- [ICKModifyRecordsOperation.PerRecordProgressBlock]: The closure to execute with progress information for individual records.
- [ICKModifyRecordsOperation.SetPerRecordProgressBlock]
Instance Properties ¶
- [ICKModifyRecordsOperation.PerRecordDeleteBlock]: The closure to execute when CloudKit deletes a record.
- [ICKModifyRecordsOperation.SetPerRecordDeleteBlock]
- [ICKModifyRecordsOperation.PerRecordSaveBlock]: The closure to execute when CloudKit saves a record.
- [ICKModifyRecordsOperation.SetPerRecordSaveBlock]
See: https://developer.apple.com/documentation/CloudKit/CKModifyRecordsOperation
type ICKModifySubscriptionsOperation ¶
type ICKModifySubscriptionsOperation interface {
ICKDatabaseOperation
// The subscriptions to save to the database.
SubscriptionsToSave() []CKSubscription
SetSubscriptionsToSave(value []CKSubscription)
// The IDs of the subscriptions that you want to delete.
SubscriptionIDsToDelete() unsafe.Pointer
SetSubscriptionIDsToDelete(value kernel.Pointer)
// The closure to execute after the operation modifies the subscriptions.
ModifySubscriptionsCompletionBlock() func(kernel.Pointer, kernel.Pointer, kernel.Pointer)
SetModifySubscriptionsCompletionBlock(value func(kernel.Pointer, kernel.Pointer, kernel.Pointer))
// The closure to execute when CloudKit deletes a subscription.
PerSubscriptionDeleteBlock() unsafe.Pointer
SetPerSubscriptionDeleteBlock(value kernel.Pointer)
// The closure to execute when CloudKit saves a subscription.
PerSubscriptionSaveBlock() unsafe.Pointer
SetPerSubscriptionSaveBlock(value kernel.Pointer)
}
An interface definition for the CKModifySubscriptionsOperation class.
Configuring the Modify Subscriptions Operation ¶
- [ICKModifySubscriptionsOperation.SubscriptionsToSave]: The subscriptions to save to the database.
- [ICKModifySubscriptionsOperation.SetSubscriptionsToSave]
- [ICKModifySubscriptionsOperation.SubscriptionIDsToDelete]: The IDs of the subscriptions that you want to delete.
- [ICKModifySubscriptionsOperation.SetSubscriptionIDsToDelete]
Processing the Modify Subscription Results ¶
- [ICKModifySubscriptionsOperation.ModifySubscriptionsCompletionBlock]: The closure to execute after the operation modifies the subscriptions.
- [ICKModifySubscriptionsOperation.SetModifySubscriptionsCompletionBlock]
Instance Properties ¶
- [ICKModifySubscriptionsOperation.PerSubscriptionDeleteBlock]: The closure to execute when CloudKit deletes a subscription.
- [ICKModifySubscriptionsOperation.SetPerSubscriptionDeleteBlock]
- [ICKModifySubscriptionsOperation.PerSubscriptionSaveBlock]: The closure to execute when CloudKit saves a subscription.
- [ICKModifySubscriptionsOperation.SetPerSubscriptionSaveBlock]
See: https://developer.apple.com/documentation/CloudKit/CKModifySubscriptionsOperation
type ICKNotification ¶
type ICKNotification interface {
objectivec.IObject
// The notification’s ID.
NotificationID() ICKNotificationID
// The type of event that generates the notification.
NotificationType() CKNotificationType
// The ID of the container with the content that triggers the notification.
ContainerIdentifier() string
// A Boolean value that indicates whether the system removes some push notification content before delivery.
IsPruned() bool
// The notification’s alert body.
AlertBody() string
// The key that identifies the localized text for the alert body.
AlertLocalizationKey() string
// The fields for building a notification’s alert.
AlertLocalizationArgs() []string
// The key that identifies the localized string for the notification’s action.
AlertActionLocalizationKey() string
// The filename of an image to use as a launch image.
AlertLaunchImage() string
// The name of the sound file to play when a notification arrives.
SoundName() string
// The value that the app icon’s badge displays.
Badge() foundation.NSNumber
// The name of the action group that corresponds to this notification.
Category() string
// The ID of the subscription that triggers the notification.
SubscriptionID() CKSubscriptionID
SetSubscriptionID(value CKSubscriptionID)
// The ID of the user record that creates the subscription that generates the push notification.
SubscriptionOwnerUserRecordID() ICKRecordID
// The notification’s title.
Title() string
// The key that identifies the localized string for the notification’s title.
TitleLocalizationKey() string
// The fields for building a notification’s title.
TitleLocalizationArgs() []string
// The notification’s subtitle.
Subtitle() string
// The key that identifies the localized string for the notification’s subtitle.
SubtitleLocalizationKey() string
// The fields for building a notification’s subtitle.
SubtitleLocalizationArgs() []string
}
An interface definition for the CKNotification class.
Identifying the Notification ¶
- [ICKNotification.NotificationID]: The notification’s ID.
- [ICKNotification.NotificationType]: The type of event that generates the notification.
- [ICKNotification.ContainerIdentifier]: The ID of the container with the content that triggers the notification.
Getting the Notification’s Status ¶
- [ICKNotification.IsPruned]: A Boolean value that indicates whether the system removes some push notification content before delivery.
Accessing the Notification Info ¶
- [ICKNotification.AlertBody]: The notification’s alert body.
- [ICKNotification.AlertLocalizationKey]: The key that identifies the localized text for the alert body.
- [ICKNotification.AlertLocalizationArgs]: The fields for building a notification’s alert.
- [ICKNotification.AlertActionLocalizationKey]: The key that identifies the localized string for the notification’s action.
- [ICKNotification.AlertLaunchImage]: The filename of an image to use as a launch image.
- [ICKNotification.SoundName]: The name of the sound file to play when a notification arrives.
- [ICKNotification.Badge]: The value that the app icon’s badge displays.
- [ICKNotification.Category]: The name of the action group that corresponds to this notification.
- [ICKNotification.SubscriptionID]: The ID of the subscription that triggers the notification.
- [ICKNotification.SetSubscriptionID]
- [ICKNotification.SubscriptionOwnerUserRecordID]: The ID of the user record that creates the subscription that generates the push notification.
- [ICKNotification.Title]: The notification’s title.
- [ICKNotification.TitleLocalizationKey]: The key that identifies the localized string for the notification’s title.
- [ICKNotification.TitleLocalizationArgs]: The fields for building a notification’s title.
- [ICKNotification.Subtitle]: The notification’s subtitle.
- [ICKNotification.SubtitleLocalizationKey]: The key that identifies the localized string for the notification’s subtitle.
- [ICKNotification.SubtitleLocalizationArgs]: The fields for building a notification’s subtitle.
See: https://developer.apple.com/documentation/CloudKit/CKNotification
type ICKNotificationID ¶
type ICKNotificationID interface {
objectivec.IObject
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKNotificationID class.
See: https://developer.apple.com/documentation/CloudKit/CKNotification/ID
type ICKNotificationInfo ¶
type ICKNotificationInfo interface {
objectivec.IObject
// The name of the action group that corresponds to this notification.
Category() string
SetCategory(value string)
// A value that the system uses to coalesce unseen push notifications.
CollapseIDKey() string
SetCollapseIDKey(value string)
// A Boolean value that determines whether an app’s icon badge increments its value.
ShouldBadge() bool
SetShouldBadge(value bool)
// The text for the notification’s alert.
AlertBody() string
SetAlertBody(value string)
// The key that identifies the localized string for the notification’s alert.
AlertLocalizationKey() string
SetAlertLocalizationKey(value string)
// The key that identifies the localized string for the notification’s action.
AlertActionLocalizationKey() string
SetAlertActionLocalizationKey(value string)
// The filename of an image to use as a launch image.
AlertLaunchImage() string
SetAlertLaunchImage(value string)
// The filename of the sound file to play when a notification arrives.
SoundName() string
SetSoundName(value string)
// A Boolean value that indicates whether the push notification includes the content available flag.
ShouldSendContentAvailable() bool
SetShouldSendContentAvailable(value bool)
// A Boolean value that indicates whether the push notification sets the mutable content flag.
ShouldSendMutableContent() bool
SetShouldSendMutableContent(value bool)
// The notification’s title.
Title() string
SetTitle(value string)
// The key that identifies the localized string for the notification’s title.
TitleLocalizationKey() string
SetTitleLocalizationKey(value string)
// The notification’s subtitle.
Subtitle() string
SetSubtitle(value string)
// The key that identifies the localized string for the notification’s subtitle.
SubtitleLocalizationKey() string
SetSubtitleLocalizationKey(value string)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKNotificationInfo class.
Grouping Notifications ¶
- [ICKNotificationInfo.Category]: The name of the action group that corresponds to this notification.
- [ICKNotificationInfo.SetCategory]
- [ICKNotificationInfo.CollapseIDKey]: A value that the system uses to coalesce unseen push notifications.
- [ICKNotificationInfo.SetCollapseIDKey]
Displaying Badges ¶
- [ICKNotificationInfo.ShouldBadge]: A Boolean value that determines whether an app’s icon badge increments its value.
- [ICKNotificationInfo.SetShouldBadge]
Accessing the Notification Alert ¶
- [ICKNotificationInfo.AlertBody]: The text for the notification’s alert.
- [ICKNotificationInfo.SetAlertBody]
- [ICKNotificationInfo.AlertLocalizationKey]: The key that identifies the localized string for the notification’s alert.
- [ICKNotificationInfo.SetAlertLocalizationKey]
- [ICKNotificationInfo.AlertActionLocalizationKey]: The key that identifies the localized string for the notification’s action.
- [ICKNotificationInfo.SetAlertActionLocalizationKey]
- [ICKNotificationInfo.AlertLaunchImage]: The filename of an image to use as a launch image.
- [ICKNotificationInfo.SetAlertLaunchImage]
- [ICKNotificationInfo.SoundName]: The filename of the sound file to play when a notification arrives.
- [ICKNotificationInfo.SetSoundName]
Accessing the Notification Info ¶
- [ICKNotificationInfo.ShouldSendContentAvailable]: A Boolean value that indicates whether the push notification includes the content available flag.
- [ICKNotificationInfo.SetShouldSendContentAvailable]
- [ICKNotificationInfo.ShouldSendMutableContent]: A Boolean value that indicates whether the push notification sets the mutable content flag.
- [ICKNotificationInfo.SetShouldSendMutableContent]
Accessing the Notification Title ¶
- [ICKNotificationInfo.Title]: The notification’s title.
- [ICKNotificationInfo.SetTitle]
- [ICKNotificationInfo.TitleLocalizationKey]: The key that identifies the localized string for the notification’s title.
- [ICKNotificationInfo.SetTitleLocalizationKey]
Accessing the Notification Subtitle ¶
- [ICKNotificationInfo.Subtitle]: The notification’s subtitle.
- [ICKNotificationInfo.SetSubtitle]
- [ICKNotificationInfo.SubtitleLocalizationKey]: The key that identifies the localized string for the notification’s subtitle.
- [ICKNotificationInfo.SetSubtitleLocalizationKey]
See: https://developer.apple.com/documentation/CloudKit/CKSubscription/NotificationInfo-swift.class
type ICKOperation ¶
type ICKOperation interface {
foundation.INSOperation
// A unique identifier for a long-lived operation.
OperationID() CKOperationID
SetOperationID(value CKOperationID)
// The operation’s configuration.
Configuration() ICKOperationConfiguration
SetConfiguration(value ICKOperationConfiguration)
// The operation’s group.
Group() ICKOperationGroup
SetGroup(value ICKOperationGroup)
// The closure to execute when the server begins to store callbacks for the long-lived operation.
LongLivedOperationWasPersistedBlock() VoidHandler
SetLongLivedOperationWasPersistedBlock(value VoidHandler)
// A Boolean value that indicates whether the operation can send data over the cellular network.
AllowsCellularAccess() bool
SetAllowsCellularAccess(value bool)
// The operation’s container.
Container() ICKContainer
SetContainer(value ICKContainer)
// A Boolean value that indicates whether the operation is long-lived.
IsLongLived() bool
SetLongLived(value bool)
// The timeout interval when waiting for additional data.
TimeoutIntervalForRequest() float64
SetTimeoutIntervalForRequest(value float64)
// The maximum amount of time that a resource request can use.
TimeoutIntervalForResource() float64
SetTimeoutIntervalForResource(value float64)
}
An interface definition for the CKOperation class.
Identifying the Operation ¶
- [ICKOperation.OperationID]: A unique identifier for a long-lived operation.
- [ICKOperation.SetOperationID]
Managing the Operation’s Configuration ¶
- [ICKOperation.Configuration]: The operation’s configuration.
- [ICKOperation.SetConfiguration]
- [ICKOperation.Group]: The operation’s group.
- [ICKOperation.SetGroup]
- [ICKOperation.LongLivedOperationWasPersistedBlock]: The closure to execute when the server begins to store callbacks for the long-lived operation.
- [ICKOperation.SetLongLivedOperationWasPersistedBlock]
See: https://developer.apple.com/documentation/CloudKit/CKOperation
type ICKOperationConfiguration ¶
type ICKOperationConfiguration interface {
objectivec.IObject
// A Boolean value that indicates whether operations that use this configuration can send data over the cellular network.
AllowsCellularAccess() bool
SetAllowsCellularAccess(value bool)
// The configuration’s container.
Container() ICKContainer
SetContainer(value ICKContainer)
// A Boolean value that indicates whether the operations that use this configuration are long-lived.
IsLongLived() bool
SetLongLived(value bool)
// The priority that the system uses when it allocates resources to the operations that use this configuration.
QualityOfService() foundation.NSQualityOfService
SetQualityOfService(value foundation.NSQualityOfService)
// The maximum amount of time that a request can take.
TimeoutIntervalForRequest() foundation.NSTimeInterval
SetTimeoutIntervalForRequest(value foundation.NSTimeInterval)
// The maximum amount of time that a resource request can take.
TimeoutIntervalForResource() foundation.NSTimeInterval
SetTimeoutIntervalForResource(value foundation.NSTimeInterval)
}
An interface definition for the CKOperationConfiguration class.
Preparing a Configuration ¶
- [ICKOperationConfiguration.AllowsCellularAccess]: A Boolean value that indicates whether operations that use this configuration can send data over the cellular network.
- [ICKOperationConfiguration.SetAllowsCellularAccess]
- [ICKOperationConfiguration.Container]: The configuration’s container.
- [ICKOperationConfiguration.SetContainer]
- [ICKOperationConfiguration.IsLongLived]: A Boolean value that indicates whether the operations that use this configuration are long-lived.
- [ICKOperationConfiguration.SetLongLived]
- [ICKOperationConfiguration.QualityOfService]: The priority that the system uses when it allocates resources to the operations that use this configuration.
- [ICKOperationConfiguration.SetQualityOfService]
- [ICKOperationConfiguration.TimeoutIntervalForRequest]: The maximum amount of time that a request can take.
- [ICKOperationConfiguration.SetTimeoutIntervalForRequest]
- [ICKOperationConfiguration.TimeoutIntervalForResource]: The maximum amount of time that a resource request can take.
- [ICKOperationConfiguration.SetTimeoutIntervalForResource]
See: https://developer.apple.com/documentation/CloudKit/CKOperation/Configuration-swift.class
type ICKOperationGroup ¶
type ICKOperationGroup interface {
objectivec.IObject
// Creates an operation group from a serialized instance.
InitWithCoder(aDecoder foundation.INSCoder) CKOperationGroup
// The default configuration for operations in the group.
DefaultConfiguration() ICKOperationConfiguration
SetDefaultConfiguration(value ICKOperationConfiguration)
// The estimated size of traffic to download from CloudKit.
ExpectedReceiveSize() CKOperationGroupTransferSize
SetExpectedReceiveSize(value CKOperationGroupTransferSize)
// The estimated size of traffic to upload to CloudKit.
ExpectedSendSize() CKOperationGroupTransferSize
SetExpectedSendSize(value CKOperationGroupTransferSize)
// The operation group’s name.
Name() string
SetName(value string)
// The operation group’s unique identifier.
OperationGroupID() string
// The number of operations in the operation group.
Quantity() uint
SetQuantity(value uint)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKOperationGroup class.
Creating an Operation Group ¶
- [ICKOperationGroup.InitWithCoder]: Creates an operation group from a serialized instance.
Configuring an Operation Group ¶
- [ICKOperationGroup.DefaultConfiguration]: The default configuration for operations in the group.
- [ICKOperationGroup.SetDefaultConfiguration]
- [ICKOperationGroup.ExpectedReceiveSize]: The estimated size of traffic to download from CloudKit.
- [ICKOperationGroup.SetExpectedReceiveSize]
- [ICKOperationGroup.ExpectedSendSize]: The estimated size of traffic to upload to CloudKit.
- [ICKOperationGroup.SetExpectedSendSize]
- [ICKOperationGroup.Name]: The operation group’s name.
- [ICKOperationGroup.SetName]
- [ICKOperationGroup.OperationGroupID]: The operation group’s unique identifier.
- [ICKOperationGroup.Quantity]: The number of operations in the operation group.
- [ICKOperationGroup.SetQuantity]
See: https://developer.apple.com/documentation/CloudKit/CKOperationGroup
type ICKQuery ¶
type ICKQuery interface {
objectivec.IObject
// Creates an operation group from a serialized instance.
InitWithCoder(aDecoder foundation.INSCoder) CKQuery
// The record type to search.
RecordType() unsafe.Pointer
SetRecordType(value kernel.Pointer)
// The predicate to use for matching records.
Predicate() foundation.NSPredicate
// The sort descriptors for organizing the query’s results.
SortDescriptors() []foundation.NSSortDescriptor
SetSortDescriptors(value []foundation.NSSortDescriptor)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKQuery class.
Creating a Query ¶
- [ICKQuery.InitWithCoder]: Creates an operation group from a serialized instance.
Accessing the Query Parameters ¶
- [ICKQuery.RecordType]: The record type to search.
- [ICKQuery.SetRecordType]
- [ICKQuery.Predicate]: The predicate to use for matching records.
- [ICKQuery.SortDescriptors]: The sort descriptors for organizing the query’s results.
- [ICKQuery.SetSortDescriptors]
See: https://developer.apple.com/documentation/CloudKit/CKQuery
type ICKQueryCursor ¶
type ICKQueryCursor interface {
objectivec.IObject
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKQueryCursor class.
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation/Cursor-swift.class
type ICKQueryNotification ¶
type ICKQueryNotification interface {
ICKNotification
// The type of database for the record zone.
DatabaseScope() CKDatabaseScope
// The event that triggers the push notification.
QueryNotificationReason() CKQueryNotificationReason
// The ID of the record that CloudKit creates, updates, or deletes.
RecordID() ICKRecordID
// A dictionary of fields that have changes.
RecordFields() foundation.INSDictionary
}
An interface definition for the CKQueryNotification class.
Getting the Database Scope ¶
- [ICKQueryNotification.DatabaseScope]: The type of database for the record zone.
Getting the Notification Attributes ¶
- [ICKQueryNotification.QueryNotificationReason]: The event that triggers the push notification.
Getting the Record Information ¶
- [ICKQueryNotification.RecordID]: The ID of the record that CloudKit creates, updates, or deletes.
- [ICKQueryNotification.RecordFields]: A dictionary of fields that have changes.
See: https://developer.apple.com/documentation/CloudKit/CKQueryNotification
type ICKQueryOperation ¶
type ICKQueryOperation interface {
ICKDatabaseOperation
// Creates an operation that searches for records in the specified record zone.
InitWithQuery(query ICKQuery) CKQueryOperation
// Creates an operation with additional results from a previous search.
InitWithCursor(cursor ICKQueryCursor) CKQueryOperation
// The query for the search.
Query() ICKQuery
SetQuery(value ICKQuery)
// The cursor for continuing the search.
Cursor() ICKQueryCursor
SetCursor(value ICKQueryCursor)
// The ID of the record zone that contains the records to search.
ZoneID() ICKRecordZoneID
SetZoneID(value ICKRecordZoneID)
// The maximum number of records to return at one time.
ResultsLimit() uint
SetResultsLimit(value uint)
// The fields of the records to fetch.
DesiredKeys() unsafe.Pointer
SetDesiredKeys(value kernel.Pointer)
// The closure to execute when a record match is available.
RecordMatchedBlock() unsafe.Pointer
SetRecordMatchedBlock(value kernel.Pointer)
}
An interface definition for the CKQueryOperation class.
Creating a Query Operation ¶
- [ICKQueryOperation.InitWithQuery]: Creates an operation that searches for records in the specified record zone.
- [ICKQueryOperation.InitWithCursor]: Creates an operation with additional results from a previous search.
Configuring the Query Operation ¶
- [ICKQueryOperation.Query]: The query for the search.
- [ICKQueryOperation.SetQuery]
- [ICKQueryOperation.Cursor]: The cursor for continuing the search.
- [ICKQueryOperation.SetCursor]
- [ICKQueryOperation.ZoneID]: The ID of the record zone that contains the records to search.
- [ICKQueryOperation.SetZoneID]
- [ICKQueryOperation.ResultsLimit]: The maximum number of records to return at one time.
- [ICKQueryOperation.SetResultsLimit]
- [ICKQueryOperation.DesiredKeys]: The fields of the records to fetch.
- [ICKQueryOperation.SetDesiredKeys]
Instance Properties ¶
- [ICKQueryOperation.RecordMatchedBlock]: The closure to execute when a record match is available.
- [ICKQueryOperation.SetRecordMatchedBlock]
See: https://developer.apple.com/documentation/CloudKit/CKQueryOperation
type ICKQuerySubscription ¶
type ICKQuerySubscription interface {
ICKSubscription
// The matching criteria to apply to records.
Predicate() foundation.NSPredicate
// Options that define the behavior of the subscription.
QuerySubscriptionOptions() CKQuerySubscriptionOptions
// The type of record that the subscription queries.
RecordType() unsafe.Pointer
SetRecordType(value kernel.Pointer)
// The ID of the record zone that the subscription queries.
ZoneID() ICKRecordZoneID
SetZoneID(value ICKRecordZoneID)
}
An interface definition for the CKQuerySubscription class.
Accessing the Subscription Search Parameters ¶
- [ICKQuerySubscription.Predicate]: The matching criteria to apply to records.
- [ICKQuerySubscription.QuerySubscriptionOptions]: Options that define the behavior of the subscription.
Accessing the Subscription Metadata ¶
- [ICKQuerySubscription.RecordType]: The type of record that the subscription queries.
- [ICKQuerySubscription.SetRecordType]
- [ICKQuerySubscription.ZoneID]: The ID of the record zone that the subscription queries.
- [ICKQuerySubscription.SetZoneID]
See: https://developer.apple.com/documentation/CloudKit/CKQuerySubscription
type ICKRecord ¶
type ICKRecord interface {
objectivec.IObject
// The unique ID of the record.
RecordID() ICKRecordID
// The value that your app defines to identify the type of record.
RecordType() unsafe.Pointer
SetRecordType(value kernel.Pointer)
// The time when CloudKit first saves the record to the server.
CreationDate() foundation.NSDate
// The ID of the user who creates the record.
CreatorUserRecordID() ICKRecordID
// The most recent time that CloudKit saved the record to the server.
ModificationDate() foundation.NSDate
// The ID of the user who most recently modified the record.
LastModifiedUserRecordID() ICKRecordID
// The server change token for the record.
RecordChangeTag() string
// An object that manages the record’s encrypted key-value pairs.
EncryptedValues() CKRecordKeyValueSetting
// Returns an array of strings to use for full-text searches of the field’s string-based values.
AllTokens() []string
// Encodes the record’s system fields using the specified archiver.
EncodeSystemFieldsWithCoder(coder foundation.INSCoder)
// A reference to the record’s parent record.
Parent() ICKReference
SetParent(value ICKReference)
Share() ICKReference
// Creates and sets a reference object for a parent from its record.
SetParentReferenceFromRecord(parentRecord ICKRecord)
// Creates and sets a reference object for a parent from the parent’s record ID.
SetParentReferenceFromRecordID(parentRecordID ICKRecordID)
InitWithCoder(coder foundation.INSCoder) CKRecord
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKRecord class.
Accessing the Record’s Metadata ¶
- [ICKRecord.RecordID]: The unique ID of the record.
- [ICKRecord.RecordType]: The value that your app defines to identify the type of record.
- [ICKRecord.SetRecordType]
- [ICKRecord.CreationDate]: The time when CloudKit first saves the record to the server.
- [ICKRecord.CreatorUserRecordID]: The ID of the user who creates the record.
- [ICKRecord.ModificationDate]: The most recent time that CloudKit saved the record to the server.
- [ICKRecord.LastModifiedUserRecordID]: The ID of the user who most recently modified the record.
- [ICKRecord.RecordChangeTag]: The server change token for the record.
Encrypting the Record’s Values ¶
- [ICKRecord.EncryptedValues]: An object that manages the record’s encrypted key-value pairs.
Getting Data for Full-Text Searches ¶
- [ICKRecord.AllTokens]: Returns an array of strings to use for full-text searches of the field’s string-based values.
Encoding the Record’s Metadata ¶
- [ICKRecord.EncodeSystemFieldsWithCoder]: Encodes the record’s system fields using the specified archiver.
Sharing Records ¶
- [ICKRecord.Parent]: A reference to the record’s parent record.
- [ICKRecord.SetParent]
- [ICKRecord.Share]: A reference to the share object that determines the share status of the record.
- [ICKRecord.SetParentReferenceFromRecord]: Creates and sets a reference object for a parent from its record.
- [ICKRecord.SetParentReferenceFromRecordID]: Creates and sets a reference object for a parent from the parent’s record ID.
Initializers ¶
- [ICKRecord.InitWithCoder]
See: https://developer.apple.com/documentation/CloudKit/CKRecord
type ICKRecordID ¶
type ICKRecordID interface {
objectivec.IObject
// Creates a new record ID with the specified name in the default zone.
InitWithRecordName(recordName string) CKRecordID
// The unique name of the record.
RecordName() string
// The ID of the zone that contains the record.
ZoneID() ICKRecordZoneID
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKRecordID class.
Creating a Record ID ¶
- [ICKRecordID.InitWithRecordName]: Creates a new record ID with the specified name in the default zone.
Getting the Record ID’s Name ¶
- [ICKRecordID.RecordName]: The unique name of the record.
Getting the Record ID’s Zone ¶
- [ICKRecordID.ZoneID]: The ID of the zone that contains the record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/ID
type ICKRecordZone ¶
type ICKRecordZone interface {
objectivec.IObject
// Creates a record zone object with the specified zone name.
InitWithZoneName(zoneName string) CKRecordZone
// Creates a record zone object with the specified zone ID.
InitWithZoneID(zoneID ICKRecordZoneID) CKRecordZone
// The unique ID of the zone.
ZoneID() ICKRecordZoneID
// The capabilities that the zone supports.
Capabilities() CKRecordZoneCapabilities
Share() ICKReference
InitWithCoder(coder foundation.INSCoder) CKRecordZone
// The encryption scope determines the granularity at which encryption keys are stored within the zone.
EncryptionScope() CKRecordZoneEncryptionScope
SetEncryptionScope(value CKRecordZoneEncryptionScope)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKRecordZone class.
Creating a Record Zone ¶
- [ICKRecordZone.InitWithZoneName]: Creates a record zone object with the specified zone name.
- [ICKRecordZone.InitWithZoneID]: Creates a record zone object with the specified zone ID.
Getting the Zone Attributes ¶
- [ICKRecordZone.ZoneID]: The unique ID of the zone.
- [ICKRecordZone.Capabilities]: The capabilities that the zone supports.
Sharing Records ¶
- [ICKRecordZone.Share]: A reference to the record zone’s share record.
Initializers ¶
- [ICKRecordZone.InitWithCoder]
Instance Properties ¶
- [ICKRecordZone.EncryptionScope]: The encryption scope determines the granularity at which encryption keys are stored within the zone.
- [ICKRecordZone.SetEncryptionScope]
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone
type ICKRecordZoneID ¶
type ICKRecordZoneID interface {
objectivec.IObject
// The unique name of the record zone.
ZoneName() string
// The ID of the user who owns the record zone.
OwnerName() string
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKRecordZoneID class.
Getting the Record Zone ID Attributes ¶
- [ICKRecordZoneID.ZoneName]: The unique name of the record zone.
- [ICKRecordZoneID.OwnerName]: The ID of the user who owns the record zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZone/ID
type ICKRecordZoneNotification ¶
type ICKRecordZoneNotification interface {
ICKNotification
// The ID of the record zone that has changes.
RecordZoneID() ICKRecordZoneID
// The type of database for the record zone.
DatabaseScope() CKDatabaseScope
}
An interface definition for the CKRecordZoneNotification class.
Getting the Record Zone ID ¶
- [ICKRecordZoneNotification.RecordZoneID]: The ID of the record zone that has changes.
Getting the Database Scope ¶
- [ICKRecordZoneNotification.DatabaseScope]: The type of database for the record zone.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneNotification
type ICKRecordZoneSubscription ¶
type ICKRecordZoneSubscription interface {
ICKSubscription
// The type of record that the subscription queries.
RecordType() unsafe.Pointer
SetRecordType(value kernel.Pointer)
// The ID of the record zone that the subscription queries.
ZoneID() ICKRecordZoneID
}
An interface definition for the CKRecordZoneSubscription class.
Accessing the Subscription Metadata ¶
- [ICKRecordZoneSubscription.RecordType]: The type of record that the subscription queries.
- [ICKRecordZoneSubscription.SetRecordType]
- [ICKRecordZoneSubscription.ZoneID]: The ID of the record zone that the subscription queries.
See: https://developer.apple.com/documentation/CloudKit/CKRecordZoneSubscription
type ICKReference ¶
type ICKReference interface {
objectivec.IObject
// Creates a reference object that points to the record with the specified ID.
InitWithRecordIDAction(recordID ICKRecordID, action CKReferenceAction) CKReference
// Creates a reference object that points to the specified record object.
InitWithRecordAction(record ICKRecord, action CKReferenceAction) CKReference
// The ownership behavior for the records.
ReferenceAction() CKReferenceAction
// The ID of the referenced record.
RecordID() ICKRecordID
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKReference class.
Creating a Reference ¶
- [ICKReference.InitWithRecordIDAction]: Creates a reference object that points to the record with the specified ID.
- [ICKReference.InitWithRecordAction]: Creates a reference object that points to the specified record object.
Getting the Reference Attributes ¶
- [ICKReference.ReferenceAction]: The ownership behavior for the records.
- [ICKReference.RecordID]: The ID of the referenced record.
See: https://developer.apple.com/documentation/CloudKit/CKRecord/Reference
type ICKServerChangeToken ¶
type ICKServerChangeToken interface {
objectivec.IObject
InitWithCoder(coder foundation.INSCoder) CKServerChangeToken
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKServerChangeToken class.
Initializers ¶
- [ICKServerChangeToken.InitWithCoder]
See: https://developer.apple.com/documentation/CloudKit/CKServerChangeToken
type ICKShare ¶
type ICKShare interface {
ICKRecord
InitWithRootRecord(rootRecord ICKRecord) CKShare
InitWithRootRecordShareID(rootRecord ICKRecord, shareID ICKRecordID) CKShare
InitWithRecordZoneID(recordZoneID ICKRecordZoneID) CKShare
Owner() ICKShareParticipant
CurrentUserParticipant() ICKShareParticipant
Participants() []CKShareParticipant
URL() foundation.NSURL
// The permission for anyone with access to the share’s URL.
AddParticipant(participant ICKShareParticipant)
RemoveParticipant(participant ICKShareParticipant)
// Indicates whether uninvited users can request access to this share.
BlockedIdentities() []CKShareBlockedIdentity
Requesters() []CKShareAccessRequester
BlockRequesters(requesters []CKShareAccessRequester)
DenyRequesters(requesters []CKShareAccessRequester)
UnblockIdentities(blockedIdentities []CKShareBlockedIdentity)
// The identity of the participant.
}
An interface definition for the CKShare class.
Creating a Share ¶
- [ICKShare.InitWithRootRecord]: Creates a new share for the specified record.
- [ICKShare.InitWithRootRecordShareID]: Creates a new share for the specified record and record ID.
- [ICKShare.InitWithRecordZoneID]: Creates a new share for the specified record zone.
Accessing the Share’s Attributes ¶
- [ICKShare.Owner]: The participant that represents the share’s owner.
- [ICKShare.CurrentUserParticipant]: The participant that represents the current user.
- [ICKShare.Participants]: An array that contains the share’s participants.
- [ICKShare.URL]: The URL for inviting participants to the share.
Configuring the Share ¶
- [ICKShare.PublicPermission]: The permission for anyone with access to the share’s URL.
- [ICKShare.SetPublicPermission]
- [ICKShare.AddParticipant]: Adds a participant to the share.
- [ICKShare.RemoveParticipant]: Removes a participant from the share.
Instance Properties ¶
- [ICKShare.AllowsAccessRequests]: Indicates whether uninvited users can request access to this share.
- [ICKShare.SetAllowsAccessRequests]
- [ICKShare.BlockedIdentities]: A list of users blocked from requesting access to this share.
- [ICKShare.Requesters]: A list of all uninvited users who have requested access to this share.
Instance Methods ¶
- [ICKShare.BlockRequesters]: Blocks specified users from requesting access to this share.
- [ICKShare.DenyRequesters]: Denies access requests from specified users.
- [ICKShare.UnblockIdentities]: Unblocks previously blocked users, allowing them to request access again.
See: https://developer.apple.com/documentation/CloudKit/CKShare
type ICKShareAccessRequester ¶
type ICKShareAccessRequester interface {
objectivec.IObject
Contact() unsafe.Pointer
ParticipantLookupInfo() ICKUserIdentityLookupInfo
UserIdentity() ICKUserIdentity
}
An interface definition for the CKShareAccessRequester class.
Instance Properties ¶
- [ICKShareAccessRequester.Contact]: A displayable [CNContact] representing the requester.
- [ICKShareAccessRequester.ParticipantLookupInfo]: Lookup information for the requester.
- [ICKShareAccessRequester.UserIdentity]: The identity of the user requesting access to the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/AccessRequester
type ICKShareBlockedIdentity ¶
type ICKShareBlockedIdentity interface {
objectivec.IObject
Contact() unsafe.Pointer
UserIdentity() ICKUserIdentity
}
An interface definition for the CKShareBlockedIdentity class.
Instance Properties ¶
- [ICKShareBlockedIdentity.Contact]: A displayable [CNContact] representing the blocked user.
- [ICKShareBlockedIdentity.UserIdentity]: The identity of the user who has been blocked from requesting access to the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/BlockedIdentity
type ICKShareMetadata ¶
type ICKShareMetadata interface {
objectivec.IObject
Share() ICKShare
ContainerIdentifier() string
OwnerIdentity() ICKUserIdentity
HierarchicalRootRecordID() ICKRecordID
RootRecord() ICKRecord
ParticipantRole() CKShareParticipantRole
ParticipantPermission() CKShareParticipantPermission
ParticipantStatus() CKShareParticipantAcceptanceStatus
ParticipantType() unsafe.Pointer
}
An interface definition for the CKShareMetadata class.
Accessing the Share ¶
- [ICKShareMetadata.Share]: The share that owns the metadata.
- [ICKShareMetadata.ContainerIdentifier]: The ID of the share’s container.
- [ICKShareMetadata.OwnerIdentity]: The identity of the share’s owner.
Accessing the Root Record ¶
- [ICKShareMetadata.HierarchicalRootRecordID]: The record ID of the shared hierarchy’s root record.
- [ICKShareMetadata.RootRecord]: The share’s root record.
Accessing the Participant’s Capabilities ¶
- [ICKShareMetadata.ParticipantRole]: The share’s participant role for the user who retrieves the metadata.
- [ICKShareMetadata.ParticipantPermission]: The share’s permissions for the user who retrieves the metadata.
- [ICKShareMetadata.ParticipantStatus]: The share’s participation status for the user who retrieves the metadata.
- [ICKShareMetadata.ParticipantType]: The share’s participation type for the user who retrieves the metadata.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Metadata
type ICKShareParticipant ¶
type ICKShareParticipant interface {
objectivec.IObject
AcceptanceStatus() CKShareParticipantAcceptanceStatus
UserIdentity() ICKUserIdentity
// The participant’s permission level for the share.
// The participant’s role for the share.
DateAddedToShare() foundation.NSDate
IsApprovedRequester() bool
}
An interface definition for the CKShareParticipant class.
Accessing the Participant’s Status ¶
- [ICKShareParticipant.AcceptanceStatus]: The current state of the user’s acceptance of the share.
Accessing the Participant’s Identity ¶
- [ICKShareParticipant.UserIdentity]: The identity of the participant.
Managing the Participant’s Capabilites ¶
- [ICKShareParticipant.Permission]: The participant’s permission level for the share.
- [ICKShareParticipant.SetPermission]
- [ICKShareParticipant.Role]: The participant’s role for the share.
- [ICKShareParticipant.SetRole]
Instance Properties ¶
- [ICKShareParticipant.DateAddedToShare]: The date and time when the participant was added to the share.
- [ICKShareParticipant.IsApprovedRequester]: Indicates whether the participant was originally a requester who was approved to join the share.
See: https://developer.apple.com/documentation/CloudKit/CKShare/Participant
type ICKShareRequestAccessOperation ¶
type ICKShareRequestAccessOperation interface {
ICKOperation
InitWithShareURLs(shareURLs []foundation.NSURL) CKShareRequestAccessOperation
// The URLs of the shares to request access to.
}
An interface definition for the CKShareRequestAccessOperation class.
Initializers ¶
- [ICKShareRequestAccessOperation.InitWithShareURLs]: Creates a share request access operation configured with specified share URLs.
Instance Properties ¶
- [ICKShareRequestAccessOperation.ShareURLs]: The URLs of the shares to request access to.
- [ICKShareRequestAccessOperation.SetShareURLs]
See: https://developer.apple.com/documentation/CloudKit/CKShareRequestAccessOperation
type ICKSubscription ¶
type ICKSubscription interface {
objectivec.IObject
// The configuration for a subscription’s push notifications.
NotificationInfo() ICKNotificationInfo
SetNotificationInfo(value ICKNotificationInfo)
// The subscription’s unique identifier.
SubscriptionID() CKSubscriptionID
SetSubscriptionID(value CKSubscriptionID)
// The behavior that a subscription provides.
SubscriptionType() CKSubscriptionType
InitWithCoder(coder foundation.INSCoder) CKSubscription
// The names of fields to include in the push notification’s payload.
DesiredKeys() unsafe.Pointer
SetDesiredKeys(value kernel.Pointer)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKSubscription class.
Specifying the Push Notification Data ¶
- [ICKSubscription.NotificationInfo]: The configuration for a subscription’s push notifications.
- [ICKSubscription.SetNotificationInfo]
Accessing the Subscription Metadata ¶
- [ICKSubscription.SubscriptionID]: The subscription’s unique identifier.
- [ICKSubscription.SetSubscriptionID]
- [ICKSubscription.SubscriptionType]: The behavior that a subscription provides.
Initializers ¶
- [ICKSubscription.InitWithCoder]
See: https://developer.apple.com/documentation/CloudKit/CKSubscription
type ICKSyncEngine ¶
type ICKSyncEngine interface {
objectivec.IObject
// Creates a sync engine with the specified configuration.
InitWithConfiguration(configuration ICKSyncEngineConfiguration) CKSyncEngine
// The associated database.
Database() ICKDatabase
// The sync engine’s state.
State() ICKSyncEngineState
// Fetches pending remote changes from the server.
FetchChangesWithCompletionHandler(completionHandler ErrorHandler)
// Fetches pending remote changes from the server using the specified options.
FetchChangesWithOptionsCompletionHandler(options ICKSyncEngineFetchChangesOptions, completionHandler ErrorHandler)
// Sends pending local changes to the server.
SendChangesWithCompletionHandler(completionHandler ErrorHandler)
// Sends pending local changes to the server using the specified options.
SendChangesWithOptionsCompletionHandler(options ICKSyncEngineSendChangesOptions, completionHandler ErrorHandler)
// Cancels any in-progress or pending sync operations.
CancelOperationsWithCompletionHandler(completionHandler VoidHandler)
}
An interface definition for the CKSyncEngine class.
Creating a sync engine ¶
- [ICKSyncEngine.InitWithConfiguration]: Creates a sync engine with the specified configuration.
Accessing the engine’s attributes ¶
- [ICKSyncEngine.Database]: The associated database.
- [ICKSyncEngine.State]: The sync engine’s state.
Invoking manual sync operations ¶
- [ICKSyncEngine.FetchChangesWithCompletionHandler]: Fetches pending remote changes from the server.
- [ICKSyncEngine.FetchChangesWithOptionsCompletionHandler]: Fetches pending remote changes from the server using the specified options.
- [ICKSyncEngine.SendChangesWithCompletionHandler]: Sends pending local changes to the server.
- [ICKSyncEngine.SendChangesWithOptionsCompletionHandler]: Sends pending local changes to the server using the specified options.
Canceling operations ¶
- [ICKSyncEngine.CancelOperationsWithCompletionHandler]: Cancels any in-progress or pending sync operations.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngine-4b4w9
type ICKSyncEngineAccountChangeEvent ¶
type ICKSyncEngineAccountChangeEvent interface {
ICKSyncEngineEvent
// The iCloud account’s change type.
ChangeType() CKSyncEngineAccountChangeType
// The previous iCloud account’s record identifier.
PreviousUser() ICKRecordID
// The current iCloud account’s record identifier.
CurrentUser() ICKRecordID
}
An interface definition for the CKSyncEngineAccountChangeEvent class.
Understanding the change ¶
- [ICKSyncEngineAccountChangeEvent.ChangeType]: The iCloud account’s change type.
- [ICKSyncEngineAccountChangeEvent.PreviousUser]: The previous iCloud account’s record identifier.
- [ICKSyncEngineAccountChangeEvent.CurrentUser]: The current iCloud account’s record identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineAccountChangeEvent
type ICKSyncEngineConfiguration ¶
type ICKSyncEngineConfiguration interface {
objectivec.IObject
// Creates a configuration for the specified database and serialized state.
InitWithDatabaseStateSerializationDelegate(database ICKDatabase, stateSerialization ICKSyncEngineStateSerialization, delegate CKSyncEngineDelegate) CKSyncEngineConfiguration
// The object that provides the records to sync and handles any related events.
Delegate() CKSyncEngineDelegate
SetDelegate(value CKSyncEngineDelegate)
// A Boolean value that determines whether the engine syncs automatically.
AutomaticallySync() bool
SetAutomaticallySync(value bool)
// The associated database.
Database() ICKDatabase
SetDatabase(value ICKDatabase)
// The subscription identifier for the associated database.
SubscriptionID() CKSubscriptionID
SetSubscriptionID(value CKSubscriptionID)
// The sync engine’s serialized state.
StateSerialization() ICKSyncEngineStateSerialization
SetStateSerialization(value ICKSyncEngineStateSerialization)
}
An interface definition for the CKSyncEngineConfiguration class.
Creating configurations ¶
- [ICKSyncEngineConfiguration.InitWithDatabaseStateSerializationDelegate]: Creates a configuration for the specified database and serialized state.
Handling record changes ¶
- [ICKSyncEngineConfiguration.Delegate]: The object that provides the records to sync and handles any related events.
- [ICKSyncEngineConfiguration.SetDelegate]
Managing attributes ¶
- [ICKSyncEngineConfiguration.AutomaticallySync]: A Boolean value that determines whether the engine syncs automatically.
- [ICKSyncEngineConfiguration.SetAutomaticallySync]
- [ICKSyncEngineConfiguration.Database]: The associated database.
- [ICKSyncEngineConfiguration.SetDatabase]
- [ICKSyncEngineConfiguration.SubscriptionID]: The subscription identifier for the associated database.
- [ICKSyncEngineConfiguration.SetSubscriptionID]
- [ICKSyncEngineConfiguration.StateSerialization]: The sync engine’s serialized state.
- [ICKSyncEngineConfiguration.SetStateSerialization]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineConfiguration
type ICKSyncEngineDidFetchChangesEvent ¶
type ICKSyncEngineDidFetchChangesEvent interface {
ICKSyncEngineEvent
Context() ICKSyncEngineFetchChangesContext
}
An interface definition for the CKSyncEngineDidFetchChangesEvent class.
Instance Properties ¶
- [ICKSyncEngineDidFetchChangesEvent.Context]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidFetchChangesEvent
type ICKSyncEngineDidFetchRecordZoneChangesEvent ¶
type ICKSyncEngineDidFetchRecordZoneChangesEvent interface {
ICKSyncEngineEvent
// The associated record zone’s unique identifier.
ZoneID() ICKRecordZoneID
// An error that describes the cause of a failed fetch operation.
Error() foundation.NSError
}
An interface definition for the CKSyncEngineDidFetchRecordZoneChangesEvent class.
Identifying the record zone ¶
- [ICKSyncEngineDidFetchRecordZoneChangesEvent.ZoneID]: The associated record zone’s unique identifier.
Handling errors ¶
- [ICKSyncEngineDidFetchRecordZoneChangesEvent.Error]: An error that describes the cause of a failed fetch operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidFetchRecordZoneChangesEvent
type ICKSyncEngineDidSendChangesEvent ¶
type ICKSyncEngineDidSendChangesEvent interface {
ICKSyncEngineEvent
// The context of the finished send request.
Context() ICKSyncEngineSendChangesContext
}
An interface definition for the CKSyncEngineDidSendChangesEvent class.
Accessing the context ¶
- [ICKSyncEngineDidSendChangesEvent.Context]: The context of the finished send request.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineDidSendChangesEvent
type ICKSyncEngineEvent ¶
type ICKSyncEngineEvent interface {
objectivec.IObject
// The type of event.
Type() CKSyncEngineEventType
// The event downcast to the subclass that represents a change to the device’s iCloud account.
AccountChangeEvent() ICKSyncEngineAccountChangeEvent
// The event downcast to the subclass that represents an imminent database fetch.
WillFetchChangesEvent() ICKSyncEngineWillFetchChangesEvent
// The event downcast to the subclass that represents an imminent fetch of record zone changes.
WillFetchRecordZoneChangesEvent() ICKSyncEngineWillFetchRecordZoneChangesEvent
// The event downcast to the subclass that represents a set of fetched database changes to process.
FetchedDatabaseChangesEvent() ICKSyncEngineFetchedDatabaseChangesEvent
// The event downcast to the subclass that represents a set of fetched record zone changes to process.
FetchedRecordZoneChangesEvent() ICKSyncEngineFetchedRecordZoneChangesEvent
// The event downcast to the subclass that represents a completed record zone fetch.
DidFetchRecordZoneChangesEvent() ICKSyncEngineDidFetchRecordZoneChangesEvent
// The event downcast to the subclass that represents a completed database fetch.
DidFetchChangesEvent() ICKSyncEngineDidFetchChangesEvent
// The event downcast to the subclass that represents an imminent send operation.
WillSendChangesEvent() ICKSyncEngineWillSendChangesEvent
// The event downcast to the subclass that represents a sent batch of database changes.
SentDatabaseChangesEvent() ICKSyncEngineSentDatabaseChangesEvent
// The event downcast to the subclass that represents a sent batch of record zone changes.
SentRecordZoneChangesEvent() ICKSyncEngineSentRecordZoneChangesEvent
// The event downcast to the subclass that represents a completed send operation.
DidSendChangesEvent() ICKSyncEngineDidSendChangesEvent
// The event downcast to the subclass that represents an update to the sync engine’s state.
StateUpdateEvent() ICKSyncEngineStateUpdateEvent
}
An interface definition for the CKSyncEngineEvent class.
Determining the type ¶
- [ICKSyncEngineEvent.Type]: The type of event.
Accessing account changes ¶
- [ICKSyncEngineEvent.AccountChangeEvent]: The event downcast to the subclass that represents a change to the device’s iCloud account.
Accessing fetch events ¶
- [ICKSyncEngineEvent.WillFetchChangesEvent]: The event downcast to the subclass that represents an imminent database fetch.
- [ICKSyncEngineEvent.WillFetchRecordZoneChangesEvent]: The event downcast to the subclass that represents an imminent fetch of record zone changes.
- [ICKSyncEngineEvent.FetchedDatabaseChangesEvent]: The event downcast to the subclass that represents a set of fetched database changes to process.
- [ICKSyncEngineEvent.FetchedRecordZoneChangesEvent]: The event downcast to the subclass that represents a set of fetched record zone changes to process.
- [ICKSyncEngineEvent.DidFetchRecordZoneChangesEvent]: The event downcast to the subclass that represents a completed record zone fetch.
- [ICKSyncEngineEvent.DidFetchChangesEvent]: The event downcast to the subclass that represents a completed database fetch.
Accessing send events ¶
- [ICKSyncEngineEvent.WillSendChangesEvent]: The event downcast to the subclass that represents an imminent send operation.
- [ICKSyncEngineEvent.SentDatabaseChangesEvent]: The event downcast to the subclass that represents a sent batch of database changes.
- [ICKSyncEngineEvent.SentRecordZoneChangesEvent]: The event downcast to the subclass that represents a sent batch of record zone changes.
- [ICKSyncEngineEvent.DidSendChangesEvent]: The event downcast to the subclass that represents a completed send operation.
Accessing state updates ¶
- [ICKSyncEngineEvent.StateUpdateEvent]: The event downcast to the subclass that represents an update to the sync engine’s state.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineEvent
type ICKSyncEngineFailedRecordSave ¶
type ICKSyncEngineFailedRecordSave interface {
objectivec.IObject
// The record that CloudKit is unable to modify.
Record() ICKRecord
// A error that describes the reason for the unsuccessful attempt to modify the associated record.
Error() foundation.NSError
}
An interface definition for the CKSyncEngineFailedRecordSave class.
Accessing the record ¶
- [ICKSyncEngineFailedRecordSave.Record]: The record that CloudKit is unable to modify.
Accessing the error ¶
- [ICKSyncEngineFailedRecordSave.Error]: A error that describes the reason for the unsuccessful attempt to modify the associated record.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedRecordSave
type ICKSyncEngineFailedZoneSave ¶
type ICKSyncEngineFailedZoneSave interface {
objectivec.IObject
// The record zone that CloudKit is unable to modify.
RecordZone() ICKRecordZone
// A error that describes the reason for the unsuccessful attempt to modify the associated record zone.
Error() foundation.NSError
}
An interface definition for the CKSyncEngineFailedZoneSave class.
Accessing the record zone ¶
- [ICKSyncEngineFailedZoneSave.RecordZone]: The record zone that CloudKit is unable to modify.
Accessing the error ¶
- [ICKSyncEngineFailedZoneSave.Error]: A error that describes the reason for the unsuccessful attempt to modify the associated record zone.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFailedZoneSave
type ICKSyncEngineFetchChangesContext ¶
type ICKSyncEngineFetchChangesContext interface {
objectivec.IObject
Options() ICKSyncEngineFetchChangesOptions
Reason() CKSyncEngineSyncReason
}
An interface definition for the CKSyncEngineFetchChangesContext class.
Instance Properties ¶
- [ICKSyncEngineFetchChangesContext.Options]
- [ICKSyncEngineFetchChangesContext.Reason]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesContext
type ICKSyncEngineFetchChangesOptions ¶
type ICKSyncEngineFetchChangesOptions interface {
objectivec.IObject
// The operation group to use for the underlying CloudKit operations.
OperationGroup() ICKOperationGroup
SetOperationGroup(value ICKOperationGroup)
PrioritizedZoneIDs() []CKRecordZoneID
SetPrioritizedZoneIDs(value []CKRecordZoneID)
Scope() ICKSyncEngineFetchChangesScope
SetScope(value ICKSyncEngineFetchChangesScope)
InitWithScope(scope ICKSyncEngineFetchChangesScope) CKSyncEngineFetchChangesOptions
}
An interface definition for the CKSyncEngineFetchChangesOptions class.
Managing attributes ¶
- [ICKSyncEngineFetchChangesOptions.OperationGroup]: The operation group to use for the underlying CloudKit operations.
- [ICKSyncEngineFetchChangesOptions.SetOperationGroup]
Instance Properties ¶
- [ICKSyncEngineFetchChangesOptions.PrioritizedZoneIDs]
- [ICKSyncEngineFetchChangesOptions.SetPrioritizedZoneIDs]
- [ICKSyncEngineFetchChangesOptions.Scope]
- [ICKSyncEngineFetchChangesOptions.SetScope]
Instance Methods ¶
- [ICKSyncEngineFetchChangesOptions.InitWithScope]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesOptions
type ICKSyncEngineFetchChangesScope ¶
type ICKSyncEngineFetchChangesScope interface {
objectivec.IObject
ExcludedZoneIDs() foundation.INSSet
ZoneIDs() foundation.INSSet
ContainsZoneID(zoneID ICKRecordZoneID) bool
InitWithExcludedZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
InitWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineFetchChangesScope
}
An interface definition for the CKSyncEngineFetchChangesScope class.
Instance Properties ¶
- [ICKSyncEngineFetchChangesScope.ExcludedZoneIDs]
- [ICKSyncEngineFetchChangesScope.ZoneIDs]
Instance Methods ¶
- [ICKSyncEngineFetchChangesScope.ContainsZoneID]
- [ICKSyncEngineFetchChangesScope.InitWithExcludedZoneIDs]
- [ICKSyncEngineFetchChangesScope.InitWithZoneIDs]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchChangesScope
type ICKSyncEngineFetchedDatabaseChangesEvent ¶
type ICKSyncEngineFetchedDatabaseChangesEvent interface {
ICKSyncEngineEvent
// The deleted record zones.
Deletions() []CKSyncEngineFetchedZoneDeletion
// The modified record zones.
Modifications() []CKRecordZone
}
An interface definition for the CKSyncEngineFetchedDatabaseChangesEvent class.
Accessing changes ¶
- [ICKSyncEngineFetchedDatabaseChangesEvent.Deletions]: The deleted record zones.
- [ICKSyncEngineFetchedDatabaseChangesEvent.Modifications]: The modified record zones.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedDatabaseChangesEvent
type ICKSyncEngineFetchedRecordDeletion ¶
type ICKSyncEngineFetchedRecordDeletion interface {
objectivec.IObject
// The deleted record’s unique identifier.
RecordID() ICKRecordID
// The record type of the deleted record.
RecordType() CKRecordType
}
An interface definition for the CKSyncEngineFetchedRecordDeletion class.
Understanding the deletion ¶
- [ICKSyncEngineFetchedRecordDeletion.RecordID]: The deleted record’s unique identifier.
- [ICKSyncEngineFetchedRecordDeletion.RecordType]: The record type of the deleted record.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedRecordDeletion
type ICKSyncEngineFetchedRecordZoneChangesEvent ¶
type ICKSyncEngineFetchedRecordZoneChangesEvent interface {
ICKSyncEngineEvent
// The deleted records.
Deletions() []CKSyncEngineFetchedRecordDeletion
// The modified records.
Modifications() []CKRecord
}
An interface definition for the CKSyncEngineFetchedRecordZoneChangesEvent class.
Accessing changes ¶
- [ICKSyncEngineFetchedRecordZoneChangesEvent.Deletions]: The deleted records.
- [ICKSyncEngineFetchedRecordZoneChangesEvent.Modifications]: The modified records.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedRecordZoneChangesEvent
type ICKSyncEngineFetchedZoneDeletion ¶
type ICKSyncEngineFetchedZoneDeletion interface {
objectivec.IObject
// The identifier of the deleted record zone.
ZoneID() ICKRecordZoneID
// The reason for the deletion.
Reason() CKSyncEngineZoneDeletionReason
}
An interface definition for the CKSyncEngineFetchedZoneDeletion class.
Understanding the deletion ¶
- [ICKSyncEngineFetchedZoneDeletion.ZoneID]: The identifier of the deleted record zone.
- [ICKSyncEngineFetchedZoneDeletion.Reason]: The reason for the deletion.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineFetchedZoneDeletion
type ICKSyncEnginePendingDatabaseChange ¶
type ICKSyncEnginePendingDatabaseChange interface {
objectivec.IObject
// The type of database change.
Type() CKSyncEnginePendingDatabaseChangeType
// The identifier of the record zone to change.
ZoneID() ICKRecordZoneID
}
An interface definition for the CKSyncEnginePendingDatabaseChange class.
Understanding the change ¶
- [ICKSyncEnginePendingDatabaseChange.Type]: The type of database change.
- [ICKSyncEnginePendingDatabaseChange.ZoneID]: The identifier of the record zone to change.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingDatabaseChange
type ICKSyncEnginePendingRecordZoneChange ¶
type ICKSyncEnginePendingRecordZoneChange interface {
objectivec.IObject
// Creates a record zone change of the specified type for the given record.
InitWithRecordIDType(recordID ICKRecordID, type_ CKSyncEnginePendingRecordZoneChangeType) CKSyncEnginePendingRecordZoneChange
// The identifier of the modified record.
RecordID() ICKRecordID
// The type of change to make.
Type() CKSyncEnginePendingRecordZoneChangeType
}
An interface definition for the CKSyncEnginePendingRecordZoneChange class.
Creating a record zone change ¶
- [ICKSyncEnginePendingRecordZoneChange.InitWithRecordIDType]: Creates a record zone change of the specified type for the given record.
Accessing the modified record ¶
- [ICKSyncEnginePendingRecordZoneChange.RecordID]: The identifier of the modified record.
- [ICKSyncEnginePendingRecordZoneChange.Type]: The type of change to make.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingRecordZoneChange
type ICKSyncEnginePendingZoneDelete ¶
type ICKSyncEnginePendingZoneDelete interface {
ICKSyncEnginePendingDatabaseChange
// Creates a pending zone delete for the specified record zone identifier.
InitWithZoneID(zoneID ICKRecordZoneID) CKSyncEnginePendingZoneDelete
}
An interface definition for the CKSyncEnginePendingZoneDelete class.
Creating a pending zone delete ¶
- [ICKSyncEnginePendingZoneDelete.InitWithZoneID]: Creates a pending zone delete for the specified record zone identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneDelete
type ICKSyncEnginePendingZoneSave ¶
type ICKSyncEnginePendingZoneSave interface {
ICKSyncEnginePendingDatabaseChange
// Creates a pending zone save for the specified record zone.
InitWithZone(zone ICKRecordZone) CKSyncEnginePendingZoneSave
// The record zone to save.
Zone() ICKRecordZone
}
An interface definition for the CKSyncEnginePendingZoneSave class.
Creating a pending zone save ¶
- [ICKSyncEnginePendingZoneSave.InitWithZone]: Creates a pending zone save for the specified record zone.
Identifying the record zone ¶
- [ICKSyncEnginePendingZoneSave.Zone]: The record zone to save.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEnginePendingZoneSave
type ICKSyncEngineRecordZoneChangeBatch ¶
type ICKSyncEngineRecordZoneChangeBatch interface {
objectivec.IObject
// Creates a batch of records to modify using the provided record zone changes.
InitWithPendingChangesRecordProvider(pendingChanges []CKSyncEnginePendingRecordZoneChange, recordProvider CKRecordIDHandler) CKSyncEngineRecordZoneChangeBatch
// Creates a batch of records to modify.
InitWithRecordsToSaveRecordIDsToDeleteAtomicByZone(recordsToSave []CKRecord, recordIDsToDelete []CKRecordID, atomicByZone bool) CKSyncEngineRecordZoneChangeBatch
// A Boolean value that determines whether CloudKit modifies records atomically by record zone.
AtomicByZone() bool
SetAtomicByZone(value bool)
// The unique identifiers of the records to delete.
RecordIDsToDelete() []CKRecordID
// The records to save.
RecordsToSave() []CKRecord
}
An interface definition for the CKSyncEngineRecordZoneChangeBatch class.
Creating a batch ¶
- [ICKSyncEngineRecordZoneChangeBatch.InitWithPendingChangesRecordProvider]: Creates a batch of records to modify using the provided record zone changes.
- [ICKSyncEngineRecordZoneChangeBatch.InitWithRecordsToSaveRecordIDsToDeleteAtomicByZone]: Creates a batch of records to modify.
Managing atomicity ¶
- [ICKSyncEngineRecordZoneChangeBatch.AtomicByZone]: A Boolean value that determines whether CloudKit modifies records atomically by record zone.
- [ICKSyncEngineRecordZoneChangeBatch.SetAtomicByZone]
Managing the records ¶
- [ICKSyncEngineRecordZoneChangeBatch.RecordIDsToDelete]: The unique identifiers of the records to delete.
- [ICKSyncEngineRecordZoneChangeBatch.RecordsToSave]: The records to save.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineRecordZoneChangeBatch
type ICKSyncEngineSendChangesContext ¶
type ICKSyncEngineSendChangesContext interface {
objectivec.IObject
// The reason for the send operation.
Reason() CKSyncEngineSyncReason
// The additional options for the send operation.
Options() ICKSyncEngineSendChangesOptions
}
An interface definition for the CKSyncEngineSendChangesContext class.
Accessing specific attributes ¶
- [ICKSyncEngineSendChangesContext.Reason]: The reason for the send operation.
- [ICKSyncEngineSendChangesContext.Options]: The additional options for the send operation.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesContext
type ICKSyncEngineSendChangesOptions ¶
type ICKSyncEngineSendChangesOptions interface {
objectivec.IObject
// The operation group to use for the underlying CloudKit operations.
OperationGroup() ICKOperationGroup
SetOperationGroup(value ICKOperationGroup)
Scope() ICKSyncEngineSendChangesScope
SetScope(value ICKSyncEngineSendChangesScope)
InitWithScope(scope ICKSyncEngineSendChangesScope) CKSyncEngineSendChangesOptions
}
An interface definition for the CKSyncEngineSendChangesOptions class.
Managing attributes ¶
- [ICKSyncEngineSendChangesOptions.OperationGroup]: The operation group to use for the underlying CloudKit operations.
- [ICKSyncEngineSendChangesOptions.SetOperationGroup]
Instance Properties ¶
- [ICKSyncEngineSendChangesOptions.Scope]
- [ICKSyncEngineSendChangesOptions.SetScope]
Instance Methods ¶
- [ICKSyncEngineSendChangesOptions.InitWithScope]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesOptions
type ICKSyncEngineSendChangesScope ¶
type ICKSyncEngineSendChangesScope interface {
objectivec.IObject
ExcludedZoneIDs() foundation.INSSet
RecordIDs() foundation.INSSet
ZoneIDs() foundation.INSSet
ContainsPendingRecordZoneChange(pendingRecordZoneChange ICKSyncEnginePendingRecordZoneChange) bool
ContainsRecordID(recordID ICKRecordID) bool
InitWithExcludedZoneIDs(excludedZoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
InitWithRecordIDs(recordIDs foundation.INSSet) CKSyncEngineSendChangesScope
InitWithZoneIDs(zoneIDs foundation.INSSet) CKSyncEngineSendChangesScope
}
An interface definition for the CKSyncEngineSendChangesScope class.
Instance Properties ¶
- [ICKSyncEngineSendChangesScope.ExcludedZoneIDs]
- [ICKSyncEngineSendChangesScope.RecordIDs]
- [ICKSyncEngineSendChangesScope.ZoneIDs]
Instance Methods ¶
- [ICKSyncEngineSendChangesScope.ContainsPendingRecordZoneChange]
- [ICKSyncEngineSendChangesScope.ContainsRecordID]
- [ICKSyncEngineSendChangesScope.InitWithExcludedZoneIDs]
- [ICKSyncEngineSendChangesScope.InitWithRecordIDs]
- [ICKSyncEngineSendChangesScope.InitWithZoneIDs]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSendChangesScope
type ICKSyncEngineSentDatabaseChangesEvent ¶
type ICKSyncEngineSentDatabaseChangesEvent interface {
ICKSyncEngineEvent
// The unique identifiers of the deleted record zones.
DeletedZoneIDs() []CKRecordZoneID
// The modified record zones.
SavedZones() []CKRecordZone
// The unique identifiers of the record zones CloudKit is unable to delete, and the reasons why.
FailedZoneDeletes() foundation.INSDictionary
// The record zones that CloudKit is unable to modify.
FailedZoneSaves() []CKSyncEngineFailedZoneSave
}
An interface definition for the CKSyncEngineSentDatabaseChangesEvent class.
Accessing successful changes ¶
- [ICKSyncEngineSentDatabaseChangesEvent.DeletedZoneIDs]: The unique identifiers of the deleted record zones.
- [ICKSyncEngineSentDatabaseChangesEvent.SavedZones]: The modified record zones.
Accessing failed changes ¶
- [ICKSyncEngineSentDatabaseChangesEvent.FailedZoneDeletes]: The unique identifiers of the record zones CloudKit is unable to delete, and the reasons why.
- [ICKSyncEngineSentDatabaseChangesEvent.FailedZoneSaves]: The record zones that CloudKit is unable to modify.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSentDatabaseChangesEvent
type ICKSyncEngineSentRecordZoneChangesEvent ¶
type ICKSyncEngineSentRecordZoneChangesEvent interface {
ICKSyncEngineEvent
// The unique identifiers of the deleted records.
DeletedRecordIDs() []CKRecordID
// The modified records.
SavedRecords() []CKRecord
// The unique identifiers of the records CloudKit is unable to delete, and the reasons why.
FailedRecordDeletes() foundation.INSDictionary
// The records that CloudKit is unable to modify.
FailedRecordSaves() []CKSyncEngineFailedRecordSave
}
An interface definition for the CKSyncEngineSentRecordZoneChangesEvent class.
Accessing successful changes ¶
- [ICKSyncEngineSentRecordZoneChangesEvent.DeletedRecordIDs]: The unique identifiers of the deleted records.
- [ICKSyncEngineSentRecordZoneChangesEvent.SavedRecords]: The modified records.
Accessing failed changes ¶
- [ICKSyncEngineSentRecordZoneChangesEvent.FailedRecordDeletes]: The unique identifiers of the records CloudKit is unable to delete, and the reasons why.
- [ICKSyncEngineSentRecordZoneChangesEvent.FailedRecordSaves]: The records that CloudKit is unable to modify.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineSentRecordZoneChangesEvent
type ICKSyncEngineState ¶
type ICKSyncEngineState interface {
objectivec.IObject
// A Boolean value that indicates whether there are pending changes that the sync engine is unaware of.
HasPendingUntrackedChanges() bool
SetHasPendingUntrackedChanges(value bool)
// The database changes that the sync engine has yet to send to the iCloud servers.
PendingDatabaseChanges() []CKSyncEnginePendingDatabaseChange
// The record zone changes that the sync engine has yet to send to the iCloud servers.
PendingRecordZoneChanges() []CKSyncEnginePendingRecordZoneChange
// Adds the specified database changes to the state.
AddPendingDatabaseChanges(changes []CKSyncEnginePendingDatabaseChange)
// Removes the specified database changes from the state.
RemovePendingDatabaseChanges(changes []CKSyncEnginePendingDatabaseChange)
// Adds the specified record zone changes to the state.
AddPendingRecordZoneChanges(changes []CKSyncEnginePendingRecordZoneChange)
// Removes the specified record zone changes from the state.
RemovePendingRecordZoneChanges(changes []CKSyncEnginePendingRecordZoneChange)
ZoneIDsWithUnfetchedServerChanges() []CKRecordZoneID
}
An interface definition for the CKSyncEngineState class.
Accessing pending changes ¶
- [ICKSyncEngineState.HasPendingUntrackedChanges]: A Boolean value that indicates whether there are pending changes that the sync engine is unaware of.
- [ICKSyncEngineState.SetHasPendingUntrackedChanges]
- [ICKSyncEngineState.PendingDatabaseChanges]: The database changes that the sync engine has yet to send to the iCloud servers.
- [ICKSyncEngineState.PendingRecordZoneChanges]: The record zone changes that the sync engine has yet to send to the iCloud servers.
Modifying pending changes ¶
- [ICKSyncEngineState.AddPendingDatabaseChanges]: Adds the specified database changes to the state.
- [ICKSyncEngineState.RemovePendingDatabaseChanges]: Removes the specified database changes from the state.
- [ICKSyncEngineState.AddPendingRecordZoneChanges]: Adds the specified record zone changes to the state.
- [ICKSyncEngineState.RemovePendingRecordZoneChanges]: Removes the specified record zone changes from the state.
Instance Properties ¶
- [ICKSyncEngineState.ZoneIDsWithUnfetchedServerChanges]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineState
type ICKSyncEngineStateSerialization ¶
type ICKSyncEngineStateSerialization interface {
objectivec.IObject
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKSyncEngineStateSerialization class.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineStateSerialization
type ICKSyncEngineStateUpdateEvent ¶
type ICKSyncEngineStateUpdateEvent interface {
ICKSyncEngineEvent
// The current state of the sync engine.
StateSerialization() ICKSyncEngineStateSerialization
}
An interface definition for the CKSyncEngineStateUpdateEvent class.
Accessing the state ¶
- [ICKSyncEngineStateUpdateEvent.StateSerialization]: The current state of the sync engine.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineStateUpdateEvent
type ICKSyncEngineWillFetchChangesEvent ¶
type ICKSyncEngineWillFetchChangesEvent interface {
ICKSyncEngineEvent
Context() ICKSyncEngineFetchChangesContext
}
An interface definition for the CKSyncEngineWillFetchChangesEvent class.
Instance Properties ¶
- [ICKSyncEngineWillFetchChangesEvent.Context]
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillFetchChangesEvent
type ICKSyncEngineWillFetchRecordZoneChangesEvent ¶
type ICKSyncEngineWillFetchRecordZoneChangesEvent interface {
ICKSyncEngineEvent
// The associated record zone’s unique identifier.
ZoneID() ICKRecordZoneID
}
An interface definition for the CKSyncEngineWillFetchRecordZoneChangesEvent class.
Identifying the record zone ¶
- [ICKSyncEngineWillFetchRecordZoneChangesEvent.ZoneID]: The associated record zone’s unique identifier.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillFetchRecordZoneChangesEvent
type ICKSyncEngineWillSendChangesEvent ¶
type ICKSyncEngineWillSendChangesEvent interface {
ICKSyncEngineEvent
// The context of the imminent send request.
Context() ICKSyncEngineSendChangesContext
}
An interface definition for the CKSyncEngineWillSendChangesEvent class.
Accessing the context ¶
- [ICKSyncEngineWillSendChangesEvent.Context]: The context of the imminent send request.
See: https://developer.apple.com/documentation/CloudKit/CKSyncEngineWillSendChangesEvent
type ICKSystemSharingUIObserver ¶
type ICKSystemSharingUIObserver interface {
objectivec.IObject
// Creates and initializes an observer using the provided container.
InitWithContainer(container ICKContainer) CKSystemSharingUIObserver
// A callback block the system invokes after the success or failure of a share save by the system sharing UI.
// A callback block the system invokes after the success or failure of a share delete by the system sharing UI.
SystemSharingUIDidStopSharingBlock() unsafe.Pointer
SetSystemSharingUIDidStopSharingBlock(value kernel.Pointer)
}
An interface definition for the CKSystemSharingUIObserver class.
Creating a sharing observer ¶
- [ICKSystemSharingUIObserver.InitWithContainer]: Creates and initializes an observer using the provided container.
Accessing sharing blocks ¶
- [ICKSystemSharingUIObserver.SystemSharingUIDidSaveShareBlock]: A callback block the system invokes after the success or failure of a share save by the system sharing UI.
- [ICKSystemSharingUIObserver.SetSystemSharingUIDidSaveShareBlock]
- [ICKSystemSharingUIObserver.SystemSharingUIDidStopSharingBlock]: A callback block the system invokes after the success or failure of a share delete by the system sharing UI.
- [ICKSystemSharingUIObserver.SetSystemSharingUIDidStopSharingBlock]
See: https://developer.apple.com/documentation/CloudKit/CKSystemSharingUIObserver
type ICKUserIdentity ¶
type ICKUserIdentity interface {
objectivec.IObject
// A Boolean value that indicates whether the user has an iCloud account.
HasiCloudAccount() bool
// The lookup info for retrieving the user identity.
LookupInfo() ICKUserIdentityLookupInfo
// The user record ID for the corresponding user record.
UserRecordID() ICKRecordID
// Identifiers that match contacts in the local Contacts database.
ContactIdentifiers() []string
// The user’s name.
NameComponents() foundation.NSPersonNameComponents
InitWithCoder(coder foundation.INSCoder) CKUserIdentity
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKUserIdentity class.
Accessing iCloud Information ¶
- [ICKUserIdentity.HasiCloudAccount]: A Boolean value that indicates whether the user has an iCloud account.
- [ICKUserIdentity.LookupInfo]: The lookup info for retrieving the user identity.
Accessing User Information ¶
- [ICKUserIdentity.UserRecordID]: The user record ID for the corresponding user record.
- [ICKUserIdentity.ContactIdentifiers]: Identifiers that match contacts in the local Contacts database.
- [ICKUserIdentity.NameComponents]: The user’s name.
Initializers ¶
- [ICKUserIdentity.InitWithCoder]
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity
type ICKUserIdentityLookupInfo ¶
type ICKUserIdentityLookupInfo interface {
objectivec.IObject
// Creates a lookup info for the specified email address.
InitWithEmailAddress(emailAddress string) CKUserIdentityLookupInfo
// Creates a lookup info for the specified phone number.
InitWithPhoneNumber(phoneNumber string) CKUserIdentityLookupInfo
// Creates a lookup info for the specified user record ID.
InitWithUserRecordID(userRecordID ICKRecordID) CKUserIdentityLookupInfo
// The user’s email address.
EmailAddress() string
// The user’s phone number.
PhoneNumber() string
// The ID of the user record.
UserRecordID() ICKRecordID
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the CKUserIdentityLookupInfo class.
Creating a Lookup Info ¶
- [ICKUserIdentityLookupInfo.InitWithEmailAddress]: Creates a lookup info for the specified email address.
- [ICKUserIdentityLookupInfo.InitWithPhoneNumber]: Creates a lookup info for the specified phone number.
- [ICKUserIdentityLookupInfo.InitWithUserRecordID]: Creates a lookup info for the specified user record ID.
Accessing the Criteria ¶
- [ICKUserIdentityLookupInfo.EmailAddress]: The user’s email address.
- [ICKUserIdentityLookupInfo.PhoneNumber]: The user’s phone number.
- [ICKUserIdentityLookupInfo.UserRecordID]: The ID of the user record.
See: https://developer.apple.com/documentation/CloudKit/CKUserIdentity/LookupInfo-swift.class
type VoidHandler ¶
type VoidHandler = func()
VoidHandler is the signature for a completion handler block.
Used by:
Source Files
¶
- blocks.gen.go
- ck_accept_shares_operation.gen.go
- ck_allowed_sharing_options.gen.go
- ck_asset.gen.go
- ck_container.gen.go
- ck_database.gen.go
- ck_database_notification.gen.go
- ck_database_operation.gen.go
- ck_database_subscription.gen.go
- ck_discover_all_user_identities_operation.gen.go
- ck_discover_user_identities_operation.gen.go
- ck_fetch_database_changes_operation.gen.go
- ck_fetch_record_zone_changes_configuration.gen.go
- ck_fetch_record_zone_changes_operation.gen.go
- ck_fetch_record_zones_operation.gen.go
- ck_fetch_records_operation.gen.go
- ck_fetch_share_metadata_operation.gen.go
- ck_fetch_share_participants_operation.gen.go
- ck_fetch_subscriptions_operation.gen.go
- ck_fetch_web_auth_token_operation.gen.go
- ck_location_sort_descriptor.gen.go
- ck_modify_record_zones_operation.gen.go
- ck_modify_records_operation.gen.go
- ck_modify_subscriptions_operation.gen.go
- ck_notification.gen.go
- ck_notification_id.gen.go
- ck_notification_info.gen.go
- ck_operation.gen.go
- ck_operation_configuration.gen.go
- ck_operation_group.gen.go
- ck_query.gen.go
- ck_query_cursor.gen.go
- ck_query_notification.gen.go
- ck_query_operation.gen.go
- ck_query_subscription.gen.go
- ck_record.gen.go
- ck_record_id.gen.go
- ck_record_key_value_setting_protocol.gen.go
- ck_record_value_protocol.gen.go
- ck_record_zone.gen.go
- ck_record_zone_id.gen.go
- ck_record_zone_notification.gen.go
- ck_record_zone_subscription.gen.go
- ck_reference.gen.go
- ck_server_change_token.gen.go
- ck_share.gen.go
- ck_share_access_requester.gen.go
- ck_share_blocked_identity.gen.go
- ck_share_metadata.gen.go
- ck_share_participant.gen.go
- ck_share_request_access_operation.gen.go
- ck_subscription.gen.go
- ck_sync_engine.gen.go
- ck_sync_engine_account_change_event.gen.go
- ck_sync_engine_configuration.gen.go
- ck_sync_engine_delegate_protocol.gen.go
- ck_sync_engine_did_fetch_changes_event.gen.go
- ck_sync_engine_did_fetch_record_zone_changes_event.gen.go
- ck_sync_engine_did_send_changes_event.gen.go
- ck_sync_engine_event.gen.go
- ck_sync_engine_failed_record_save.gen.go
- ck_sync_engine_failed_zone_save.gen.go
- ck_sync_engine_fetch_changes_context.gen.go
- ck_sync_engine_fetch_changes_options.gen.go
- ck_sync_engine_fetch_changes_scope.gen.go
- ck_sync_engine_fetched_database_changes_event.gen.go
- ck_sync_engine_fetched_record_deletion.gen.go
- ck_sync_engine_fetched_record_zone_changes_event.gen.go
- ck_sync_engine_fetched_zone_deletion.gen.go
- ck_sync_engine_pending_database_change.gen.go
- ck_sync_engine_pending_record_zone_change.gen.go
- ck_sync_engine_pending_zone_delete.gen.go
- ck_sync_engine_pending_zone_save.gen.go
- ck_sync_engine_record_zone_change_batch.gen.go
- ck_sync_engine_send_changes_context.gen.go
- ck_sync_engine_send_changes_options.gen.go
- ck_sync_engine_send_changes_scope.gen.go
- ck_sync_engine_sent_database_changes_event.gen.go
- ck_sync_engine_sent_record_zone_changes_event.gen.go
- ck_sync_engine_state.gen.go
- ck_sync_engine_state_serialization.gen.go
- ck_sync_engine_state_update_event.gen.go
- ck_sync_engine_will_fetch_changes_event.gen.go
- ck_sync_engine_will_fetch_record_zone_changes_event.gen.go
- ck_sync_engine_will_send_changes_event.gen.go
- ck_system_sharing_ui_observer.gen.go
- ck_user_identity.gen.go
- ck_user_identity_lookup_info.gen.go
- delegate_class_counter.gen.go
- doc.gen.go
- enums.gen.go
- functions.gen.go
- generate.go
- global_vars.gen.go
- typedefs.gen.go
- types.gen.go
- undefined_types.gen.go