Post

Replies

Boosts

Views

Activity

TipKit: Are tips marked "IgnoresDisplayFrequency" also ignored by display frequency?
Greetings, I have set up two tips in my app, and my app is configured with Tips.configure([.displayFrequency(.daily)]. Tip 1 is set up with no options. Tip 2 has the IgnoresDisplayFrequency(true) option set: var options: [Option] { MaxDisplayCount(3) // We want the user to see these because it's important. IgnoresDisplayFrequency(true) } This option works as expected, as far as I can tell, in terms of making sure that Tip 2 is shown even if I've already seen Tip 1 today. If I interact with my app such that Tip 1 is displayed, and I then interact with it such that Tip 2 should be displayed, Tip 2 shows immediately, even though a day hasn't passed. However, if I do this the other way around, so that Tip 2 is displayed first, and then I interact so that Tip 1 should be displayed, my expectation would be that Tip 1 is not displayed, because another tip has already been shown today. I expected that it would not be shown until the following day, since it is not configured to ignore the tip frequency. That's not what happens, though. Tip 1 is displayed right away, even though Tip 2 has just been shown. This makes me think that setting IgnoresDisplayFrequency on Tip 2 is causing it to also be ignored when considering whether other tips should be shown. I did try omitting IgnoresDisplayFrequency option, and then as expected, only one tip is shown on a day, no matter which one is shown first.
0
1
466
May ’24
TipKit: "The filter function is not supported in this rule."
Greetings, Working on adding some simple rules to my first TipKit tips. I'm following the example from the WWDC TipKit talk, which included a rule intended to ensure that the user had accessed a particular feature at least three times in the past five days. So it had code that looked like this: #Rule(Self.enteredBackyardDetailView) { $0.donations .filter { $0.date > Date.now.addingTimeInterval(-5 * 60 * 60 * 24) } .count >= 3 I'm trying to do something similar -- essentially, I want to know if the user has been using this feature for at least a day. So I tried this: #Rule(Self.viewedDetails) { $0.donations .filter { $0.date < Date.now.addingTimeInterval(-1 * 60 * 60 * 24) } .count > 0 } i.e., Is there at least one event that was donated more than a day ago? However, Xcode flags the .filter line with the message "The filter function is not supported in this rule." Huh? This smells to me a lot like the limitations that SwiftData has with not being able to do certain kinds of operations in predicates. But this was clearly intended to be supported in the design, since the exact example was shown in the WWDC session on TipKit. So, am I missing something? Is there a different way to structure this so that I can use .filter, or is there some other way of expressing the condition without using filter? I did try using .first { same expression } != nil, but Xcode then said that rules must include a count comparison... Thanks!
3
1
549
May ’24
TipKit: Change color of TipView close button?
Greetings, I'm dipping a toe into TipKit and trying it out. I placed a TipView into one of my SwiftUI views, and the default styling didn't fit well within our app, so I changed the background and text colors. However, I can't find a way to change the color of the close button ("X"). Unfortunately, the default color is very hard to see against the background color that I selected. Is it possible to set the color of that close button? For the time being, I have created a TipViewStyle that replicates the default styling with my color changes applied, but this seems unnecessarily complex for something as simple as setting the color of that button. Thanks!
2
0
716
May ’24