Contents

showAllTipsForTesting()

Show all tips regardless of their display rule eligibility or display frequency status for UI testing of tips.

Declaration

static func showAllTipsForTesting()

Overview

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

Tip statuses automatically revert back to available after invalidation when displayed using this override to enable repeat testing of presentation and dismissal.

TipKit’s display override testing functions have the following precedence:

Priority

Testing function

first

Showtipsfortesting(_:)

second

Hidetipsfortesting(_:)

third

Showalltipsfortesting()

fourth

Hidealltipsfortesting()

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
            Tips.showAllTipsForTesting()
            #endif

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

See Also

Testing