I'm using UIKit and setting up TipKit with the suggested defaults
try? Tips.configure([
.displayFrequency(.immediate),
.datastoreLocation(.applicationDefault)
])
within
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
}
Every time I swipe out of the app the tips start reappearing again - even the ones that have been invalidated. Has this happened for anyone else and does anyone else have a solution?
Here's an example of one of my tips
struct createTabTipHomePage: Tip {
var title = styleTipTitle("Title")
var message = styleTipMessage("Message")
var asset: Image {
Image(systemName: "plus.square")
.resizable()
}
var rules: [Rule] {
[
#Rule(TipActions.$homeTrandingScrolledToCreateTrigger) {
$0 == true
}
]
}
var options: [TipOption] {
[Tip.MaxDisplayCount(1)]
}
func showAction() {
TipActions.homeTrandingScrolledToCreateTrigger.toggle()
}
}
The solution for me was to not make the Tip struct private. Now it's remembering its state.
@LogicalLight's solution with setting an ID also solved it. Then you can have the struct private.