SwiftUI Guide

SwiftUI In-App
Survey Implementation

Native SwiftUI patterns for collecting user feedback. Works with your existing architecture.

Quick Overview

FeedbackWall works natively with SwiftUI. Configure once at app init, then trigger surveys anywhere. Surveys present as sheets that integrate with SwiftUI's presentation system. Prefer AI? Use the AI prompt from your dashboard to let Cursor or Claude handle the integration.

Why FeedbackWall for SwiftUI

Native Swift

Pure Swift SDK. No bridging headers, no web views.

SwiftUI presentation

Uses native sheet presentation. Respects your app's environment.

Async/await ready

Modern concurrency support. Works with structured concurrency.

Zero dependencies

Only uses Foundation and SwiftUI. No third-party libraries.

Basic SwiftUI setup

1. Configure at app launch

import FeedbackWall

@main
struct MyApp: App {
    init() {
        FeedbackWall.configure(
            apiKey: "your-api-key",
            baseURL: URL(string: "https://feedbackwall.io")!
        )
    }
    
    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

2. Trigger from any view

struct CheckoutSuccessView: View {
    var body: some View {
        VStack {
            Text("Order Complete!")
            Button("Done") {
                FeedbackWall.showIfAvailable(trigger: "checkout_complete")
            }
        }
    }
}

Common SwiftUI patterns

After navigation (onAppear)

struct MilestoneView: View {
    var body: some View {
        VStack { Text("Level 10!") }
            .onAppear {
                FeedbackWall.showIfAvailable(trigger: "milestone")
            }
    }
}

After async operation

Button("Upload") {
    Task {
        await uploadFile()
        FeedbackWall.showIfAvailable(trigger: "upload_complete")
    }
}

With user identification

// After sign in
FeedbackWall.identify(
    userId: user.id,
    traits: ["plan": user.plan]
)

// On sign out
FeedbackWall.reset()

SwiftUI-specific tips

Don't trigger in body

Use onAppear, button actions, or task modifiers. View body can be called multiple times.

Use environment for config

Use SwiftUI's environment or compile-time flags for different API keys per environment.

Handle dismiss gracefully

Surveys dismiss automatically. Don't manually dismiss or track their state.

Let AI do the work

In your FeedbackWall dashboard, go to Documentation and copy the AI prompt. Paste it into Cursor or Claude to integrate automatically.

Common questions

Does it work with SwiftUI previews?

Yes. Trigger calls in preview mode do nothing since there's no configured API key.

Can I customize appearance?

Yes. Themes are configured in the dashboard. Colors, fonts, and radii can be customized.

What iOS versions?

iOS 15.0 and later. Built with modern Swift 5.9+ and requires Xcode 15+.

Does it interfere with navigation?

No. Surveys present as modal sheets without affecting your navigation state.

Add surveys to your SwiftUI app

Get started in under 5 minutes. Native Swift, no dependencies.

Start free trial →

14-day free trial. SwiftUI native.