PCKVersionable
public protocol PCKVersionable : PCKObjectable, PCKSynchronizable
Objects that conform to the PCKVersionable protocol are Parse interpretations of OCKVersionedObjectCompatible objects.
-
The UUID of the previous version of this object, or nil if there is no previous version. The UUIDs are in no particular order.
Declaration
Swift
var previousVersionUUIDs: [UUID]? { get set } -
The UUID of the next version of this object, or nil if there is no next version. The UUIDs are in no particular order.
Declaration
Swift
var nextVersionUUIDs: [UUID]? { get set } -
The date that this version of the object begins to take precedence over the previous version. Often this will be the same as the
createdDate, but is not required to be.Declaration
Swift
var effectiveDate: Date? { get set } -
The date on which this object was marked deleted. Note that objects are never actually deleted, but rather they are marked deleted and will no longer be returned from queries.
Declaration
Swift
var deletedDate: Date? { get set } -
find(for:Extension method, asynchronousoptions: ) Find versioned objects asynchronously like
fetchin CareKit. Finds the newest version that has not been deleted.Declaration
Swift
func find(for date: Date, options: API.Options = []) async throws -> [Self]Parameters
forThe date the objects are active.
optionsA set of header options sent to the server. Defaults to an empty set.
callbackQueueThe queue to return to after completion. Default value of
.main.throwsParseError.Return Value
An array of objects matching the query.
-
save(options:Extension method, asynchronous) Saves a
PCKVersionableobject.Declaration
Swift
func save(options: API.Options = []) async throws -> SelfParameters
uuidThe UUID to search for.
optionsA set of header options sent to the server. Defaults to an empty set.
relatedObjectAn object that has the same
uuidas the one being searched for.throwsParseError.Return Value
The saved version.
-
findPublisher(for:Extension methodoptions: ) Find versioned objects asynchronously like
fetchin CareKit. Finds the newest version that has not been deleted. Publishes when complete.Declaration
Swift
func findPublisher(for date: Date, options: API.Options = []) -> Future<[Self], ParseError>Parameters
forThe date the objects are active.
optionsA set of header options sent to the server. Defaults to an empty set.
Return Value
Future<[Self],ParseError>. -
savePublisher(for:Extension methodoptions: ) Saves a
PCKVersionableobject. asynchronously. Publishes when complete.Declaration
Swift
func savePublisher(for date: Date, options: API.Options = []) -> Future<Self, ParseError>Parameters
optionsA set of header options sent to the server. Defaults to an empty set.
Return Value
Future<[Self],ParseError>. -
copyVersionedValues(from:Extension method) Copies the common values of another PCKVersionable object.
Declaration
Swift
public mutating func copyVersionedValues(from other: Self)Parameters
fromThe PCKVersionable object to copy from.
-
save(options:Extension methodcompletion: ) Saves a
PCKVersionableobject.Declaration
Swift
public func save(options: API.Options = [], completion: @escaping(Result<PCKSynchronizable, Error>) -> Void)Parameters
optionsA set of header options sent to the server. Defaults to an empty set.
completionThe block to execute. It should have the following argument signature:
(Result<PCKSynchronizable,Error>).
-
query(for:Extension method) Querying versioned objects just like CareKit. Creates a query that finds the newest version that has not been deleted. This is the query used by
find(for date: Date). Use this query to build from if you desire a more intricate query.Declaration
Swift
public static func query(for date: Date) -> Query<Self>Parameters
forThe date the object is active.
Return Value
Query<Self>. -
find(for:Extension methodoptions: callbackQueue: completion: ) Find versioned objects asynchronously like
fetchin CareKit. Finds the newest version that has not been deleted.Declaration
Swift
public func find(for date: Date, options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping(Result<[Self], ParseError>) -> Void)Parameters
forThe date the objects are active.
optionsA set of header options sent to the server. Defaults to an empty set.
callbackQueueThe queue to return to after completion. Default value of
.main.completionThe block to execute. It should have the following argument signature:
(Result<[Self],ParseError>).
-
encodeVersionable(to:Extension method) Encodes the PCKVersionable properties of the object
Declaration
Swift
public func encodeVersionable(to encoder: Encoder) throwsParameters
tothe encoder the properties should be encoded to.
View on GitHub
Install in Dash
PCKVersionable Protocol Reference