Skip to main content
GrantivaUI is a separate SwiftUI package that renders the feedback service for you. Add a feedback portal — feature requests, voting, comments, and support tickets — to your app without writing the screens yourself.
GrantivaUI currently covers feedback and support only. There are no attestation or feature flag components — call attest() and the flags API directly and build those surfaces yourself.

Requirements

Installation

Xcode

  1. Go to File > Add Package Dependencies
  2. Enter https://github.com/grantiva/GrantivaUI
  3. Add GrantivaUI to your app target

Package.swift

GrantivaUI pulls in grantiva/ios-sdk itself, so you do not need to declare the SDK separately.

Quick start

Three pieces wire it up: the SDK instance, a FeedbackStore 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.
Create one store and pass it to every view. The store is only ever mutated through the injected service.

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.
If you want the whole portal, this is the only view you need.

Feature request views

The list supports voting inline and pull-to-refresh. 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 reads GrantivaTheme from the environment, so one .grantivaTheme() modifier on a parent applies everywhere below it.
Every parameter has a default, so override only what you care about. 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.
The environment default is .preview, so previews of any GrantivaUI view work without setup. For tests you can supply your own closures. All eleven are required:
The submit-style closures return 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