Contents

resetDatastore()

Resets the tips’ datastore to the initial state for re-testing tip display rules and eligibility.

Declaration

static func resetDatastore() throws

Overview

Must be called before configure(_:).

This function can also be called with the launch argument -com.apple.TipKit.ResetDatastore 1.

import SwiftUI
import TipKit

@main
struct LandmarkTips: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }

    init() {
        setupTips()
    }

    // Configure tips in the app.
    func setupTips() {
        do {
            #if DEBUG
            try Tips.resetDatastore()
            #endif

            try Tips.configure()
        }
        catch {
            print("Error initializing TipKit \(error.localizedDescription)")
        }
    }
}

See Also

Testing