ParseSwift

public struct ParseSwift

ParseSwift contains static methods to handle global configuration for the Parse framework.

  • Configure the Parse Swift client. This should only be used when starting your app. Typically in the application(... didFinishLaunchingWithOptions launchOptions...).

    Declaration

    Swift

    static public func initialize(configuration: ParseConfiguration,
                                  migrateFromObjcSDK: Bool = false)

    Parameters

    configuration

    The Parse configuration.

  • Configure the Parse Swift client. This should only be used when starting your app. Typically in the application(... didFinishLaunchingWithOptions launchOptions...).

    Declaration

    Swift

    static public func initialize(
        applicationId: String,
        clientKey: String? = nil,
        masterKey: String? = nil,
        serverURL: URL,
        liveQueryServerURL: URL? = nil,
        allowCustomObjectId: Bool = false,
        keyValueStore: ParseKeyValueStore? = nil,
        migrateFromObjcSDK: Bool = false,
        authentication: ((URLAuthenticationChallenge,
                          (URLSession.AuthChallengeDisposition,
                           URLCredential?) -> Void) -> Void)? = nil
    )

    Parameters

    applicationId

    The application id of your Parse application.

    clientKey

    The client key of your Parse application.

    masterKey

    The master key of your Parse application.

    serverURL

    The server URL to connect to Parse Server.

    liveQueryServerURL

    The live query server URL to connect to Parse Server.

    allowCustomObjectId

    Allows objectIds to be created on the client. side for each object. Must be enabled on the server to work.

    keyValueStore

    A key/value store that conforms to the ParseKeyValueStore protocol. Defaults to nil in which one will be created an memory, but never persisted. For Linux, this this is the only store available since there is no Keychain. Linux users should replace this store with an encrypted one.

    migrateFromObjcSDK

    If your app previously used the iOS Objective-C SDK, setting this value to true will attempt to migrate relevant data stored in the Keychain to ParseSwift. Defaults to false.

    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.

  • Update the authentication callback.

    Declaration

    Swift

    static public func updateAuthentication(_ authentication: ((URLAuthenticationChallenge,
                                                         (URLSession.AuthChallengeDisposition,
                                                          URLCredential?) -> Void) -> Void)?)

    Parameters

    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.

  • Delete the Parse iOS Objective-C SDK Keychain from the device.

    Note

    ParseSwift uses a different Keychain. After migration, the iOS Objective-C SDK Keychain is no longer needed.

    Warning

    The keychain cannot be recovered after deletion.

    Declaration

    Swift

    public static func deleteObjectiveCKeychain() throws