Quiltt Logo

iOS SDK

The Quiltt iOS SDK provides Components for seamless integration of the Quiltt Connector into your iOS app.

Documentation

For full documentation, additional examples and the source code, see Quiltt iOS SDK on Github.

Link to this section#Install

Link to this section#Swift Package Manager

  1. Open your project in Xcode.
  2. Select File > Add Package Dependency....
  3. Enter the URL of the Quiltt Connector Swift SDK repository, select the latest version and click Add Package.
  4. The Quiltt Connector Swift SDK is now integrated into your project. You can import it in your Swift files with import QuilttConnector.

Link to this section#Setting up OAuth

For production Environments, you must pass a https:// URL to oauthRedirectUrl. This URL must be a valid deep link to launch your app.

To set up a deep link to your app, please see the iOS Universal Links guide.

If you are bringing your own Plaid credentials, you must register the Quiltt callback URL as an allowed redirect URI in the Plaid Dashboard. See the Plaid OAuth guide for more information.
https://*.callback.quiltt.io

Link to this section#Usage

After importing QuilttConnector, you can use its classes and methods in your code. Here's a basic example:

import SwiftUI
import QuilttConnector
import WebKit

struct ConnectorView: View {
    @Binding var showHomeView: Bool
    @Binding var connectionId: String
    var body: some View {
        WebView(showHomeView: $showHomeView, connectionId: $connectionId)
    }
}

struct WebView: UIViewRepresentable {
    @Binding var showHomeView: Bool
    @Binding var connectionId: String
    @State var config = QuilttConnectorConnectConfiguration(
        connectorId: "<CONNECTOR_ID>",
        institution: "<OPTIONAL_INSTITUTION_SEARCH_TERM_TO_PREFILL_INSTITUTION>",
        oauthRedirectUrl: "<YOUR_HTTPS_UNIVERSAL_LINK>"
    )

    func makeUIView(context: Context) -> WKWebView {
        let quilttConnector = QuilttConnector.init()
        quilttConnector.authenticate(token: "<SESSION_TOKEN>")
        let webview = quilttConnector.connect(config: config,
                                              onEvent: { eventType, metadata in
                                                print("onEvent \(eventType), \(metadata)")
                                              },
                                              onExitSuccess: { metadata in
                                                print("onExitSuccess \(metadata)")
                                                connectionId = metadata.connectionId!
                                                showHomeView = true
                                              },
                                              onExitAbort: { metadata in
                                                print("onExitAbort \(metadata)")
                                                showHomeView = true
                                              },
                                              onExitError: { metadata in
                                                print("onExitError \(metadata)")
                                                showHomeView = true
                                              })
        return webview
    }

    func updateUIView(_ uiView: WKWebView, context: Context) {
        // Use this method to update the WKWebView with new configuration settings.
    }
}

#Preview {
    ConnectorView(showHomeView: .constant(false), connectionId: .constant("connectionId"))
}