configure(_:)
Loads and configures the persistent state of all tips in your app.
Declaration
static func configure(_ configuration: [Tips.ConfigurationOption] = []) throwsParameters
- configuration:
An array of options for customizing your tip’s datastore location and default frequency control interval.
Discussion
Call this function during app initialization. By default, all tips persist to a default location with a display frequency of immediate.
@main
struct SampleApp: App {
init() {
do {
// Configure tips in the app.
try Tips.configure()
}
catch {
// Handle TipKit errors
print("Error initializing TipKit \(error.localizedDescription)")
}
}
}To change the default location of where your tips persist use the convenience method datastoreLocation(_:).
To change the display frequency use the convenience method displayFrequency(_:).
do {
// Configure tips in the app.
try Tips.configure([
.datastoreLocation(.groupContainer(identifier: "MyGroupContainer")),
.displayFrequency(.hourly)
])
}
catch {
// Handle TipKit errors
print("Error initializing TipKit \(error.localizedDescription)")
}