SwiftUI Integration
Use SwiftUI view modifiers to present JotReview sheets.
.jotReviewFeedback(isPresented:)
The easiest way to present the feedback sheet in SwiftUI is the .jotReviewFeedback view modifier. Attach it to any view in your hierarchy and drive it with a @State boolean.
struct SettingsView: View { @State private var showFeedback = false
var body: some View {
List {
Section("Support") {
Button("Share Feedback") {
showFeedback = true
}
}
}
.navigationTitle("Settings")
.jotReviewFeedback(isPresented: $showFeedback)
}
}
`
You can also open directly to a specific board by passing the board parameter (see the board-specific section below).
.jotReviewRoadmap(isPresented:)
Present the Roadmap tab directly with the .jotReviewRoadmap modifier:
var body: some View {
VStack {
Button("What's Coming Next?") {
showRoadmap = true
}
}
.jotReviewRoadmap(isPresented: $showRoadmap)
}
}
`
This is equivalent to calling JotReview.showFeedback(section: .roadmap) but fits naturally into SwiftUI's declarative binding pattern.
.jotReviewChangelog(isPresented:)
Show the Updates (changelog) tab with the .jotReviewChangelog modifier. This is great for "What's New" links in onboarding flows or settings screens:
var body: some View {
Button(action: { showChangelog = true }) {
Label("What's New", systemImage: "sparkles")
}
.jotReviewChangelog(isPresented: $showChangelog)
}
}
`
Multiple views with separate state
Each view that presents a JotReview sheet should have its own @State variable. You can attach multiple modifiers to the same view or to different views in the hierarchy:
ProfileView()
.tabItem { Label("Profile", systemImage: "person") }
}
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Menu {
Button("Share Feedback") { showFeedback = true }
Button("What's New") { showChangelog = true }
} label: {
Image(systemName: "ellipsis.circle")
}
}
}
.jotReviewFeedback(isPresented: $showFeedback)
.jotReviewChangelog(isPresented: $showChangelog)
}
}
`
Board-specific feedback
If your workspace has multiple boards (e.g., Features, Bugs, iOS App), you can open the feedback sheet pre-filtered to a specific board by passing the board's slug:
var body: some View {
Button("Report a Bug") {
showBugReport = true
}
.jotReviewFeedback(isPresented: $showBugReport, board: "bugs")
}
}
`
The board slug is the URL-safe name visible in your JotReview dashboard. Navigate to Settings > Feedback to find board slugs.
If the board slug is not found or is not provided, the sheet defaults to showing all boards.