Skip to content
GuidesChecked 20 November 2026

Add a feedback form to your SwiftUI app

Install the Swift package, call start once and show FeedbackView or build your own form.

Free for one project and 100 votes. Paid plans start with a 14 day trial, no card.

Start once, then show the board.

Call VoteFirst.start with your embed key when the app launches, then place VoteFirst.FeedbackView() wherever the board belongs.

The key starts with vf_pk_ and sits in your dashboard under Share. Nothing else is needed, because the key already names your project.

In a SwiftUI app the natural home for start is the init of the App struct. The call is synchronous and does no network work, so it cannot slow the first frame. Write init() { VoteFirst.start("vf_pk_...") } and the package is configured for every screen that follows.

FeedbackView brings its own navigation bar and title, so it works as a tab, in a sheet or as a whole screen with nothing wrapped around it. A TabView with Home() first and VoteFirst.FeedbackView() second, tagged with a lightbulb label, is a complete feedback tab. The rows show each request, its vote count and a button, and a plus opens the suggestion form.

The key is safe to ship because it opens only what your public board already shows to a browser. Your secret API key is the opposite. Pass one to start and the package refuses it, returns no client and trips an assertion in debug builds. That is deliberate: a secret inside a shipped binary is a leak in every copy.

MyApp.swift
struct MyApp: App {
    init() { VoteFirst.start("vf_pk_...") }

    var body: some Scene { WindowGroup { RootView() } }
}

Install

In Xcode choose File, Add Package Dependencies and paste the repository address, or write one line in Package.swift.

Add the package, and pin it to a minor version.

The line is .package(url: "https://github.com/votefirst-app/votefirst-swift", .upToNextMinor(from: "0.3.0")).

The package is a 0.x release and its README says the view API is still settling. Depending on up to the next minor version means a patch update arrives by itself, while a change to the views waits until you choose it. Move to a looser rule once the package reaches 1.0.

Requirements are iOS 15 or macOS 12 and later, Swift tools 5.9 and Xcode 15 or later. There are no dependencies, and the package builds under both Swift 5 and Swift 6 with strict concurrency. Measured on macOS arm64 in a stripped release build, the client alone adds 451 KB to a binary and the client with the screens adds 1078 KB.

There are three products. VoteFirst is the one to depend on, because it re-exports the other two. VoteFirstKit is the client with no SwiftUI in it, for a command line tool or a server side Swift app, and it builds on Linux. VoteFirstUI is the screens, and you rarely need to name it.

Placing it

A tab and a sheet need nothing extra. Inside a NavigationStack of your own, add .inline so you do not get two navigation bars.

Fit the board into the navigation you already have.

NavigationLink("Feedback") { VoteFirst.FeedbackView().inline } pushes the board onto your stack and keeps your back button.

FeedbackLink is a ready made row for a settings list. It is the label and the push together, so a List can hold VoteFirst.FeedbackLink() beside your own rows. For a roadmap tab, RoadmapView draws the columns in the order you arranged them on the web, and ChangelogView shows what shipped.

FeatureDetailView and ReleaseView have no navigation of their own, because something else always pushes or presents them. SubmitView brings its own, and .inline drops it inside your stack. If you show a detail or release view alone, add .withNavigation(), which uses NavigationStack where it exists and NavigationView below iOS 16 and macOS 13.

UIKit apps get a view controller. present(VoteFirst.viewController(), animated: true) shows the same board, so a codebase that is half UIKit does not need a second integration. The scene above shows the SwiftUI and UIKit versions side by side, drawing the same data.

Your own form

VoteFirst.suggest("Dark mode", details: "The white burns at night.") files a suggestion and returns the Feature it created.

Draw the form yourself with one async call.

Both fields are required by the server. The heading takes 254 characters and the details take 2000, so check the lengths before you send, not after.

Suppose the feedback screen in your app is a single TextField and a Send button. In the button action, wrap the call in a Task and use try await VoteFirst.suggest(heading, details: detail). Sending empty details answers a validation_failed error on the description field, so disable the button until both boxes hold text.

A suggestion is held for you to approve, and that includes the person who wrote it. The returned feature has isApproved set to false, it is not on the board, and reading it back by id answers not_found even for the same voter.

Keep the value the call handed you instead of fetching it again, and tell the writer that the team will read it first. A person who files an idea, cannot find it and sees an error will assume it was lost.

The same package covers votes. VoteFirst.upvote(featureID: 21519) casts one and VoteFirst.unvote(featureID: 21519) takes it back, and a List of your own rows can bind a heart button to either. The voter is never an argument. One is minted on first use, kept in the keychain and sent with every request, so nobody can vote as somebody else.

In your app
let filed = try await VoteFirst.suggest("Dark mode", details: "The white burns at night.")

A vote on a train is not lost.

When the network fails, a write goes into a queue on the device and is sent later, in the order it was made.

Only a network failure queues. A write the server refused is not retried, because asking again would get the same answer.

Every write carries an idempotency key from the moment it is made, so a request that reached the server but lost its answer cannot count twice when it is replayed. The built in screens send the queue when a screen appears and when somebody pulls to refresh. If you draw your own interface, await VoteFirst.waiting tells you how many writes are queued and await VoteFirst.send() puts them out.

The queue drains while your app is running and something asks it to. It does not wake the app in the background, so a vote cast offline reaches the server the next time the person opens the app. Draw a queued vote as voted straight away, and let the count catch up.

The scene shows the offline case on a phone, with a vote made without a connection and counted when the board reconnects.

App Store review

The package ships a privacy manifest. It declares an anonymous voter identifier and the suggestions and comments people write.

Tell App Review what the package collects.

Tracking is false, there are no tracking domains and no required reason API is used.

The voter token lives in the keychain, not in user defaults, because reading user defaults is a required reason API. That keeps the manifest short. In App Store Connect you still declare the user content and identifier answers, and the package documentation lists what to tick.

An app that shows text written by other people has to give users a way to report and block it. The screens include a report action, and hidden content stays hidden on that device. Set a support email and your terms and privacy addresses in the Configuration, because Apple asks a host of user written content to publish terms and a place to complain.

Messages are the other half of the story. Writing a notice in the dashboard shows it inside the app, such as an outage or a fix in review, and one line puts it on a screen you already have: Home().voteFirstMessages(). You can change or switch it off later without shipping a new build.

What the package gives an iOS app

A board in two lines

Start and show are enough for a ranked list, comments and a suggestion form, tinted with your project's accent.

Calls for your own screens

One call per route, so a custom interface keeps the same voter and the same offline queue.

Votes that survive a bad signal

Writes made offline are queued on the device and replayed with the key they were made with.

From empty project to first suggestion

Allow about twenty minutes, most of it Xcode resolving the package.

Copy the embed key

Open the dashboard, go to Share and copy the key that starts with vf_pk_.

Add the package

Depend on the VoteFirst product and pin it up to the next minor version.

Start and show

Call start in your App init and place FeedbackView on a tab.

File a test suggestion

Send one from a simulator, then approve it in the dashboard and watch it appear.

What to know before you ship

  • Suggestions wait for your approval, so a new one does not appear on the board at once.
  • This guide was written against package 0.3.0, and a minor release can change the views.
  • The queue drains while the app runs, not in the background.
  • There is no Android build of this package.

What iOS developers ask

Does the app need a backend or its own accounts?

No. Each device gets an anonymous voter on first use. If your app has accounts, you can sign your own users in so a vote belongs to a person.

Does it work on macOS?

Yes, from macOS 12. The same screens run on a Mac, and the repository holds a macOS sample and an iPhone sample.

Does it work in a UIKit app?

Yes. VoteFirst.viewController() returns a view controller you can present or push.

Will the board match my app?

By default the screens follow the phone and your project's accent. Set VoteFirst.theme.appearance = .board to use your hosted board's colors.

What does the package cost?

Nothing on its own. The Free plan holds one project and 100 votes, Lite is $9/mo and Pro is $39/mo, and both paid plans start with a 14 day trial and no card.

What happens when the key is rotated?

Every copy of the app that carries the old key stops working until it is updated. A shipped app waits for review, so rotate only when a key has leaked.

Put a board in your next build

Start on Free with one project and 100 votes, then move to Lite at $9/mo or Pro at $39/mo. A 14 day trial opens either one, and it asks for no card.