Swift SDK
Swift SDK Quick Start
Get UserJot feedback collection integrated into your iOS app in just a few minutes.
Beta Notice: The Swift SDK is currently in beta (v0.1.0). The API may change before the 1.0 release.
Requirements
- iOS 13.0+ or macOS 10.15+
- Swift 5.5+
- Xcode 13.0+
Installation
Add UserJot to your iOS project using Swift Package Manager:
Using Xcode
- Open your project in Xcode
- Go to File → Add Package Dependencies
- Enter the package URL:
https://github.com/UserJot/userjot-ios - Click Add Package
Using Package.swift
Add the following to your Package.swift dependencies:
dependencies: [
.package(url: "https://github.com/UserJot/userjot-ios", from: "0.1.0")
]
Verify Installation
After installation, verify the SDK is properly integrated:
import UserJot
Build your project (⌘+B). If the build succeeds, the SDK is properly installed.
Setup
Finding Your Project ID
- Log in to your UserJot Dashboard
- Navigate to Settings → General
- Copy your Project ID
Initialize UserJot
Initialize UserJot with your project ID:
import UserJot
// In your AppDelegate's didFinishLaunchingWithOptions
// or in your App struct's init() for SwiftUI apps
UserJot.setup(projectId: "YOUR_PROJECT_ID")
Basic Usage
Show Feedback Modal
Present the feedback interface as a native iOS sheet:
// Show default feedback form
UserJot.showFeedback()
// Show feedback for a specific board
UserJot.showFeedback(board: "feature-requests")
Identify Users (Optional)
For better feedback tracking, identify your users:
// Basic identification
UserJot.identify(userId: "user123")
// With additional details
UserJot.identify(
userId: "user123",
email: "user@example.com",
firstName: "John",
lastName: "Doe"
)
SwiftUI Example
Here’s a complete SwiftUI example:
import SwiftUI
import UserJot
@main
struct MyApp: App {
init() {
UserJot.setup(projectId: "YOUR_PROJECT_ID")
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
struct ContentView: View {
@State private var showingFeedback = false
var body: some View {
NavigationView {
VStack {
Button("Send Feedback") {
showingFeedback = true
}
.padding()
}
.navigationTitle("My App")
.userJotFeedback(isPresented: $showingFeedback)
}
}
}
UIKit Example
For UIKit apps, present feedback from any view controller:
import UIKit
import UserJot
class ViewController: UIViewController {
@IBAction func feedbackButtonTapped() {
UserJot.showFeedback()
}
}
What’s Next?
- Configure user identification for personalized feedback
- Explore SwiftUI integration options
- Set up server-side authentication for enhanced security