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 typeParseError
.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.
-
fetch(includeKeys:
Asynchronousoptions: ) 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 inoptions
.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
ParseObject
s. Use["*"]
to include all keys. This is similar toinclude
andincludeAll
forQuery
.options
A set of header options sent to the server. Defaults to an empty set.
Return Value
The
ParseObject
with respect to thePointer
.
-
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 inoptions
.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
ParseObject
s. Use["*"]
to include all keys. This is similar toinclude
andincludeAll
forQuery
.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
andPointer
have the sameobjectId
.Declaration
Swift
func hasSameObjectId(as other: T) -> Bool
Parameters
as
ParseObject
to compare.Return Value
Returns a
true
if the other object has the sameobjectId
orfalse
if unsuccessful. -
Fetches the
ParseObject
synchronously with the current data from the server and sets an error if one occurs.Throws
An error ofParseError
type.Note
The default cache policy for this method is.reloadIgnoringLocalCacheData
. If a developer desires a different policy, it should be inserted inoptions
.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
ParseObject
s. Use["*"]
to include all keys. This is similar toinclude
andincludeAll
forQuery
.options
A set of header options sent to the server. Defaults to an empty set.
Return Value
The
ParseObject
with respect to thePointer
. -
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 inoptions
.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>)
.
-
Declaration
Swift
public var debugDescription: String { get }
-
Declaration
Swift
public var description: String { get }