Pointer

public struct Pointer<T> : ParsePointer, Fetchable, Encodable, Hashable where T : ParseObject
extension Pointer: CustomDebugStringConvertible
extension Pointer: CustomStringConvertible

A Pointer referencing a ParseObject.

  • The id of the object.

    Declaration

    Swift

    public var objectId: String
  • The class name of the object.

    Declaration

    Swift

    public var className: String
  • Create a Pointer type.

    Throws

    An error of type ParseError.

    Declaration

    Swift

    public init(_ target: T) throws

    Parameters

    target

    Object to point to.

  • Create a Pointer type.

    Declaration

    Swift

    public init(objectId: String)

    Parameters

    objectId

    The id of the object.

  • Convert a Pointer to its respective ParseObject.

    Declaration

    Swift

    public func toObject() -> T

    Return Value

    A ParseObject created from this Pointer.

Async/Await

  • Fetches the ParseObject aynchronously with the current data from the server and sets an error if one occurs.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    func fetch(includeKeys: [String]? = nil,
               options: API.Options = []) async throws -> T

    Parameters

    includeKeys

    The name(s) of the key(s) to include that are ParseObjects. Use ["*"] to include all keys. This is similar to include and includeAll for Query.

    options

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

    Return Value

    The ParseObject with respect to the Pointer.

Combine

  • Fetches the ParseObject aynchronously with the current data from the server and sets an error if one occurs. Publishes when complete.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    func fetchPublisher(includeKeys: [String]? = nil,
                        options: API.Options = []) -> Future<T, ParseError>

    Parameters

    includeKeys

    The name(s) of the key(s) to include that are ParseObjects. Use ["*"] to include all keys. This is similar to include and includeAll for Query.

    options

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

    Return Value

    A publisher that eventually produces a single value and then finishes or fails.

  • Determines if a ParseObject and Pointerhave the same objectId.

    Declaration

    Swift

    func hasSameObjectId(as other: T) -> Bool

    Parameters

    as

    ParseObject to compare.

    Return Value

    Returns a true if the other object has the same objectId or false if unsuccessful.

  • Determines if two Pointer‘s have the same objectId.

    Declaration

    Swift

    func hasSameObjectId(as other: `Self`) -> Bool

    Parameters

    as

    Pointer to compare.

    Return Value

    Returns a true if the other object has the same objectId or false if unsuccessful.

  • Fetches the ParseObject synchronously with the current data from the server and sets an error if one occurs.

    Throws

    An error of ParseError type.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    func fetch(includeKeys: [String]? = nil,
               options: API.Options = []) throws -> T

    Parameters

    includeKeys

    The name(s) of the key(s) to include that are ParseObjects. Use ["*"] to include all keys. This is similar to include and includeAll for Query.

    options

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

    Return Value

    The ParseObject with respect to the Pointer.

  • Fetches the ParseObject asynchronously and executes the given callback block.

    Note

    The default cache policy for this method is .reloadIgnoringLocalCacheData. If a developer desires a different policy, it should be inserted in options.

    Declaration

    Swift

    func fetch(includeKeys: [String]? = nil,
               options: API.Options = [],
               callbackQueue: DispatchQueue = .main,
               completion: @escaping (Result<T, ParseError>) -> Void)

    Parameters

    includeKeys

    The name(s) of the key(s) to include. Use ["*"] to include all keys.

    options

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

    callbackQueue

    The queue to return to after completion. Default value of .main.

    completion

    The block to execute when completed. It should have the following argument signature: (Result<T, ParseError>).

CustomDebugStringConvertible

  • Declaration

    Swift

    public var debugDescription: String { get }

CustomStringConvertible

  • Declaration

    Swift

    public var description: String { get }