Swift SDK Quick Start

Add JotReview to your iOS or macOS app in minutes.

Requirements

Before installing the SDK, make sure your project meets these minimum requirements:

  • iOS 15.0+ or macOS 12.0+
  • Swift 5.7+
  • Xcode 14+

The SDK ships as a Swift package with no third-party dependencies.

Install with Swift Package Manager (Xcode UI)

  1. 1.Open your project in Xcode
  2. 2.Go to File > Add Package Dependencies...
  3. 3.Enter the repository URL:
1https://github.com/jotreview-app/jotreview-ios
  1. 1.Select Up to Next Major Version with 1.0.0 as the minimum version
  2. 2.Click Add Package, then select JotReview as the library to add to your target

Install via Package.swift

If you manage your dependencies through a Package.swift file, add JotReview as a dependency:

1// Package.swift
2let package = Package(
3 name: "MyApp",
4 platforms: [.iOS(.v15), .macOS(.v12)],
5 dependencies: [
6 .package(
7 url: "https://github.com/jotreview-app/jotreview-ios",
8 from: "1.0.0"
9 ),
10 ],
11 targets: [
12 .target(
13 name: "MyApp",
14 dependencies: [
15 .product(name: "JotReview", package: "jotreview-ios")
16 ]
17 ),
18 ]
19)

Initialize the SDK

Call JotReview.setup(projectId:) once at app launch, before any views are displayed. In SwiftUI, do this in your @main App struct. In UIKit, do this in application(_:didFinishLaunchingWithOptions:).

SwiftUI:

1import SwiftUI

@main struct MyApp: App { init() { JotReview.setup(projectId: "proj_a1b2c3d4") }

var body: some Scene { WindowGroup { ContentView() } } } `

UIKit:

1import UIKit

@main class AppDelegate: UIResponder, UIApplicationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { JotReview.setup(projectId: "proj_a1b2c3d4") return true } } `

Your project ID is available in your JotReview dashboard under Settings > Login & SSO.

Show the feedback sheet

After setup, show the feedback sheet from anywhere in your app:

1

// Present modally (works from any UIViewController or SwiftUI view) JotReview.showFeedback()

// Open directly to a specific section JotReview.showFeedback(section: .roadmap) JotReview.showFeedback(section: .updates) `

The sheet is a full native modal that presents on top of your content. Users can dismiss it with a swipe or by tapping Done.

Identify users

Call JotReview.identify after login to associate feedback with a specific user:

1JotReview.identify(
2 userId: "usr_7x9k2m",
3 email: "ada@example.com",
4 firstName: "Ada",
5 lastName: "Lovelace"
6)

See the Identify Users article for the full parameter reference and secure authentication.

Complete SwiftUI example

A minimal app with JotReview fully integrated:

1import SwiftUI

@main struct MyApp: App { init() { JotReview.setup(projectId: "proj_a1b2c3d4") }

var body: some Scene { WindowGroup { ContentView() } } }

struct ContentView: View { @State private var showFeedback = false

var body: some View { NavigationStack { List { Text("Welcome to My App") } .navigationTitle("Home") .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button("Feedback") { showFeedback = true } } } .jotReviewFeedback(isPresented: $showFeedback) } } } `

UIKit example

1import UIKit

class HomeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad()

      @objc func openFeedback() { JotReview.showFeedback() } } `