PCKUtility

public class PCKUtility

Utility functions designed to make things easier.

  • Can setup a connection to Parse Server based on a ParseCareKit.plist file.

    The key/values supported in the file are a dictionary named ParseClientConfiguration:

    • Server - (String) The server URL to connect to Parse Server.
    • ApplicationID - (String) The application id of your Parse application.
    • ClientKey - (String) The client key of your Parse application.
    • LiveQueryServer - (String) The live query server URL to connect to Parse Server.
    • UseTransactionsInternally - (Boolean) Use transactions inside the Client SDK.
    • DeleteKeychainIfNeeded - (Boolean) Deletes the Parse Keychain when the app is running for the first time.

    Declaration

    Swift

    public class func setupServer(fileName: String = "ParseCareKit",
                                  authentication: ((URLAuthenticationChallenge,
                                                    (URLSession.AuthChallengeDisposition,
                                                      URLCredential?) -> Void) -> Void)? = nil)

    Parameters

    fileName

    Name of .plist file that contains config. Defaults to “ParseCareKit”.

    authentication

    A callback block that will be used to receive/accept/decline network challenges. Defaults to nil in which the SDK will use the default OS authentication methods for challenges. It should have the following argument signature: (challenge: URLAuthenticationChallenge, completionHandler: (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void. See Apple’s documentation for more for details.

  • Get the current Parse Encoder with custom date strategy.

    Declaration

    Swift

    public class func encoder() -> ParseEncoder
  • Get the current JSON Encoder with custom date strategy.

    Declaration

    Swift

    public class func jsonEncoder() -> JSONEncoder
  • Get the current JSON Decoder with custom date strategy.

    Declaration

    Swift

    public class func decoder() -> JSONDecoder