hideAllTipsForTesting()
Hide all tips regardless of their display rule eligibility for UI testing without tips.
Declaration
static func hideAllTipsForTesting()Overview
This function can also be called with the launch argument -com.apple.TipKit.HideAllTips 1.
TipKit’s display override testing functions have the following precedence:
Priority | Testing function |
|---|---|
first | |
second | |
third | |
fourth |
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.hideAllTipsForTesting()
#endif
try Tips.configure()
}
catch {
print("Error initializing TipKit \(error.localizedDescription)")
}
}
}