DocsMobile apps

iOS SDK

Install the Swift package, register screens and targets, and add the launcher (SwiftUI & UIKit).

Requires iOS 14+ and Swift 5.7+. Works with SwiftUI and UIKit; code samples have a tab for each.

1. Add the Swift package

In Xcode, File → Add Package Dependencies, paste the URL and choose Up to Next Major Version.

Package URL
https://github.com/lovelysomething/tooltip-tour-ios

2. Configure the SDK

Configure once at launch, pre-fetch all tours so every screen loads instantly, and forward deep links for the Visual Inspector.

import SwiftUI
import TooltipTour

@main
struct MyApp: App {
    init() {
        TooltipTour.shared.configure(
            siteKey: "sk_xxxxxxxxxx",
            baseURL: "https://app.lovelysomething.com"
        )
        Task { await TooltipTour.shared.prefetchAll() }
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
                .onOpenURL { url in
                    TooltipTour.shared.handleDeepLink(url)
                }
        }
    }
}

3. Register screens

Tell the SDK which screen is showing so the right tour loads.

import TooltipTour

struct HomeView: View {
    var body: some View {
        ScrollView {
            VStack { /* your content */ }
                .ttScrollable()   // enables scroll-to-step during tours
        }
        .ttPage("home")           // ← register this screen
    }
}

4. Register targets

Tag each view a step should highlight. The identifier must match the step’s target in the dashboard.

Text("Welcome back")
    .ttTarget("welcomeTitle")

Button("Get started") { }
    .ttTarget("getStartedButton")

5. Register the Inspector URL scheme

For the Visual Inspector: in Xcode, Target → Info → URL Types → +, and set both Identifier and URL Schemes to tooltiptour. The deep-link handler from step 2 does the rest.

6. Add the launcher once, at the root

Place TTLauncherView once, above your TabView or navigation stack. It follows .ttPage() changes, loads the right tour and hides itself on screens without one.

WindowGroup {
    ZStack {
        ContentView()        // your TabView / NavigationStack
        TTLauncherView()     // one instance handles every screen
    }
}

7. Build a tour and test

Create a walkthrough with Screen set to home, add steps, then run the app. Check that:

  • the launcher appears only on screens with an active walkthrough, and slides away on others;
  • tapping it shows the welcome card over a dim overlay;
  • each step highlights the right view and scrolls to it if needed;
  • finishing or dismissing returns the launcher.

Advanced

Scrollable screens

For steps that may be off-screen, put .ttScrollable() on the content inside your ScrollView. Without it tours still work, but won’t scroll to hidden steps.

Swift
ScrollView {
    VStack(spacing: 20) {
        TopSection()
        BottomSection()   // ← a step may target something here
    }
    .ttScrollable()       // ← on the VStack, inside the ScrollView
}

NavigationSplitView

onDisappear may not fire when the sidebar selection changes. Drive page registration yourself:

Swift
.onChange(of: selectedItem) { _, newItem in
    if let newItem {
        TTPageRegistry.shared.setPage(newItem.pageIdentifier)
    }
}
Something missing or unclear? Tell us and we’ll fix the page.