Requirements
- iOS 18+ or macOS 15+
- GrantivaSDK 2.0.1+
Installation
Xcode
- Go to File > Add Package Dependencies
- Enter
https://github.com/grantiva/GrantivaUI - Add
GrantivaUIto your app target
Package.swift
grantiva/ios-sdk itself, so you do not need to declare the SDK separately.
Quick start
Three pieces wire it up: the SDK instance, aFeedbackStore that holds the state, and a FeedbackUIService injected through the environment.
FeedbackContainerView brings its own NavigationStack, so present it as a sheet or a full-screen cover rather than nesting it inside another one.
Store
FeedbackStore is a @MainActor @Observable class holding every piece of feedback state. Views read it directly — no view models.
Views
All views are public and take the store as their first argument.FeedbackContainerView
The drop-in. A tabbed container over feature requests and support tickets, with a toolbar + that presents the matching submit sheet and navigation into the detail views.Feature request views
FeatureRequestDetailView shows the description, vote button, and comments; SubmitFeatureRequestView is a form sheet that dismisses itself on success.
Support ticket views
TicketDetailView renders the message thread with user and admin messages distinguished, and includes a reply field.
Theming
Every view readsGrantivaTheme from the environment, so one .grantivaTheme() modifier on a parent applies everywhere below it.
backgroundColor and surfaceColor default to GrantivaTheme.adaptiveBackground and GrantivaTheme.adaptiveSurface, which resolve per platform and follow light and dark mode.
Dependency injection
FeedbackUIService is a struct of closures, one per operation. .live(_:store:) binds them to the SDK’s FeedbackService and writes results into your store, including optimistic vote-count updates and error capture.
.preview, so previews of any GrantivaUI view work without setup.
For tests you can supply your own closures. All eleven are required:
Bool so the presenting view knows whether to dismiss; the fetch closures return Void and write into the store.
Accessibility
- VoiceOver — list rows and interactive elements carry combined labels
- Dynamic Type — all text uses system font styles and scales