Swift SDK
SwiftUI Integration
UserJot provides native SwiftUI support with view modifiers for seamless integration into your SwiftUI apps.
View Modifier Approach
The simplest way to add UserJot feedback to your SwiftUI views:
import SwiftUI
import UserJot
struct ContentView: View {
@State private var showingFeedback = false
var body: some View {
NavigationView {
VStack {
Button("Send Feedback") {
showingFeedback = true
}
.buttonStyle(.borderedProminent)
}
.navigationTitle("My App")
}
.userJotFeedback(isPresented: $showingFeedback)
}
}
Multiple UserJot Views
You can present different UserJot views using separate modifiers:
struct SettingsView: View {
@State private var showingFeedback = false
@State private var showingRoadmap = false
@State private var showingChangelog = false
var body: some View {
List {
Section("Product") {
Button("Send Feedback") {
showingFeedback = true
}
Button("View Roadmap") {
showingRoadmap = true
}
Button("What's New") {
showingChangelog = true
}
}
}
.userJotFeedback(isPresented: $showingFeedback)
.userJotRoadmap(isPresented: $showingRoadmap)
.userJotChangelog(isPresented: $showingChangelog)
}
}
Board-Specific Feedback
Direct users to specific feedback boards:
struct FeatureRequestView: View {
@State private var showingFeatureRequest = false
@State private var showingBugReport = false
var body: some View {
VStack(spacing: 20) {
Button("Request a Feature") {
showingFeatureRequest = true
}
.userJotFeedback(
isPresented: $showingFeatureRequest,
board: "feature-requests"
)
Button("Report a Bug") {
showingBugReport = true
}
.userJotFeedback(
isPresented: $showingBugReport,
board: "bug-reports"
)
}
}
}