PCKObjectable

public protocol PCKObjectable : ParseObject

Objects that conform to the PCKObjectable protocol are Parse interpretations of OCKObjectCompatible objects.

  • uuid Default implementation

    A universally unique identifier for this object.

    Default Implementation

    Declaration

    Swift

    var uuid: UUID? { get }
  • id

    A human readable unique identifier. It is used strictly by the developer and will never be shown to a user

    Declaration

    Swift

    var id: String { get }
  • A human readable unique identifier (same as id, but this is what’s on the Parse server, id is already taken in Parse). It is used strictly by the developer and will never be shown to a user

    Declaration

    Swift

    var entityId: String? { get set }
  • The semantic version of the database schema when this object was created. The value will be nil for objects that have not yet been persisted.

    Declaration

    Swift

    var schemaVersion: OCKSemanticVersion? { get set }
  • The date at which the object was first persisted to the database. It will be nil for unpersisted values and objects.

    Declaration

    Swift

    var createdDate: Date? { get set }
  • The last date at which the object was updated. It will be nil for unpersisted values and objects.

    Declaration

    Swift

    var updatedDate: Date? { get set }
  • The timezone this record was created in.

    Declaration

    Swift

    var timezone: TimeZone? { get set }
  • A dictionary of information that can be provided by developers to support their own unique use cases.

    Declaration

    Swift

    var userInfo: [String : String]? { get set }
  • A user-defined group identifier that can be used both for querying and sorting results. Examples may include: “medications”, “exercises”, “family”, “males”, “diabetics”, etc.

    Declaration

    Swift

    var groupIdentifier: String? { get set }
  • An array of user-defined tags that can be used to sort or classify objects or values.

    Declaration

    Swift

    var tags: [String]? { get set }
  • Specifies where this object originated from. It could contain information about the device used to record the data, its software version, or the person who recorded the data.

    Declaration

    Swift

    var source: String? { get set }
  • Specifies the location of some asset associated with this object. It could be the URL for an image or video, the bundle name of a audio asset, or any other representation the developer chooses.

    Declaration

    Swift

    var asset: String? { get set }
  • Any array of notes associated with this object.

    Declaration

    Swift

    var notes: [OCKNote]? { get set }
  • A unique id optionally used by a remote database. Its precise format will be determined by the remote database, but it is generally not expected to be human readable.

    Declaration

    Swift

    var remoteID: String? { get set }
  • A boolean that is true when encoding the object for Parse. If false the object is encoding for CareKit.

    Declaration

    Swift

    var encodingForParse: Bool { get set }
  • Copy the values of a ParseCareKit object

    Declaration

    Swift

    static func copyValues(from other: Self, to here: Self) throws -> Self
  • first(_:options:) Extension method, asynchronous

    Finds the first object on the server that has the same uuid.

    Declaration

    Swift

    static func first(_ uuid: UUID?,
                      options: API.Options = []) async throws -> Self

    Parameters

    uuid

    The UUID to search for.

    options

    A set of header options sent to the server. Defaults to an empty set.

    relatedObject

    An object that has the same uuid as the one being searched for.

    throws

    ParseError.

    Return Value

    The first object found with the matching uuid.

  • firstPublisher(_:options:) Extension method

    Finds the first object on the server that has the same uuid.

    Declaration

    Swift

    static func firstPublisher(_ uuid: UUID?,
                               options: API.Options = []) -> Future<Self, Error>

    Parameters

    uuid

    The UUID to search for.

    options

    A set of header options sent to the server. Defaults to an empty set.

    relatedObject

    An object that has the same uuid as the one being searched for.

    throws

    Error.

    Return Value

    The first object found with the matching uuid.

Defaults

  • ==(_:_:) Extension method

    Declaration

    Swift

    public static func == (lhs: Self, rhs: Self) -> Bool
  • hash(into:) Extension method

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • copyCommonValues(from:) Extension method

    Copies the common values of another PCKObjectable object.

    Declaration

    Swift

    public mutating func copyCommonValues(from other: Self)

    Parameters

    from

    The PCKObjectable object to copy from.

  • canConvertToCareKit() Extension method

    Determines if this PCKObjectable object can be converted to CareKit

    Declaration

    Swift

    public func canConvertToCareKit() -> Bool
  • first(_:options:completion:) Extension method

    Finds the first object on the server that has the same uuid.

    Declaration

    Swift

    static public func first(_ uuid: UUID?,
                             options: API.Options = [],
                             completion: @escaping(Result<Self, Error>) -> Void)

    Parameters

    uuid

    The UUID to search for.

    options

    A set of header options sent to the server. Defaults to an empty set.

    relatedObject

    An object that has the same uuid as the one being searched for.

    completion

    The block to execute. It should have the following argument signature: (Result<Self,Error>).

  • Create a DateInterval like how CareKit generates one.

    Declaration

    Swift

    public static func createCurrentDateInterval(for date: Date) -> DateInterval

    Parameters

    for

    the date to start the interval.

    Return Value

    a interval from for to the next day.

Encodable

  • encodeObjectable(to:) Extension method

    Encodes the PCKObjectable properties of the object

    Declaration

    Swift

    public func encodeObjectable(to encoder: Encoder) throws

    Parameters

    to

    the encoder the properties should be encoded to.