ParseConfig
public protocol ParseConfig: ParseType,
Decodable,
CustomDebugStringConvertible,
CustomStringConvertible
Objects that conform to the ParseConfig
protocol are able to access the Config on the Parse Server.
When conforming to ParseConfig
, any properties added can be retrieved by the client or updated on
the server.
-
fetch(options:
Extension method, asynchronous) Fetch the Config asynchronously.
Throws
An error of typeParseError
.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(options: API.Options = []) async throws -> Self
Parameters
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
The return type of self.
-
save(options:
Extension method, asynchronous) Update the Config asynchronously.
Throws
An error of typeParseError
.Declaration
Swift
func save(options: API.Options = []) async throws -> Bool
Parameters
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
true
if saved,false
if save is unsuccessful.
-
fetchPublisher(options:
Extension method) Fetch the Config asynchronously. 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(options: API.Options = []) -> Future<Self, ParseError>
Parameters
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.
-
savePublisher(options:
Extension method) Update the Config asynchronously.
Declaration
Swift
func savePublisher(options: API.Options = []) -> Future<Bool, ParseError>
Parameters
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.
-
fetch(options:
Extension method) Fetch the Config synchronously.
Throws
An error of typeParseError
.Note
The default cache policy for this method is.reloadIgnoringLocalCacheData
. If a developer desires a different policy, it should be inserted inoptions
.Declaration
Swift
public func fetch(options: API.Options = []) throws -> Self
Parameters
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
Returns
Self
. -
fetch(options:
Extension methodcallbackQueue: completion: ) Fetch the Config asynchronously.
Note
The default cache policy for this method is.reloadIgnoringLocalCacheData
. If a developer desires a different policy, it should be inserted inoptions
.Declaration
Swift
public func fetch(options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<Self, ParseError>) -> Void)
Parameters
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
A block that will be called when retrieving the config completes or fails. It should have the following argument signature:
(Result<Self, ParseError>)
. -
save(options:
Extension method) Update the Config synchronously.
Note
The default cache policy for this method is.reloadIgnoringLocalCacheData
. If a developer desires a different policy, it should be inserted inoptions
.Declaration
Swift
public func save(options: API.Options = []) throws -> Bool
Parameters
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
Returns
true
if updated,false
otherwise. -
save(options:
Extension methodcallbackQueue: completion: ) Update the Config asynchronously.
Note
The default cache policy for this method is.reloadIgnoringLocalCacheData
. If a developer desires a different policy, it should be inserted inoptions
.Declaration
Swift
public func save(options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<Bool, ParseError>) -> Void)
Parameters
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
A block that will be called when retrieving the config completes or fails. It should have the following argument signature:
(Result<Bool, ParseError>)
.
-
current
Extension methodGets/Sets properties of the current config in the Keychain.
Declaration
Swift
internal(set) static var current: Self? { get set }
Return Value
Returns the latest
ParseConfig
on this device. If there is none, returnsnil
.
-
debugDescription
Extension methodDeclaration
Swift
public var debugDescription: String { get }
-
description
Extension methodDeclaration
Swift
public var description: String { get }