I’m trying to use iOS17’s TipKit to show some onboarding tips to the user across various screens. The problem I’m facing is at times the Tips are not shown when they are ready to be shown and gets shown at incorrect times. For example, below is a code example and screen shots of a Tip I’m showing from toolbar buttons for a view that shows grid of items. When it works it shows correctly, but some other times, the tip is not shown at all but it gets shown when user goes to the next screen where the tip is not even valid.
I’m confused if the TipKit at this stage is glitchy like this or if there is something I’m missing from implementation?
I can try to add in additional rules such as when user goes off screen to details I can invalidate a rule so the tip won’t get shown until the user is back on screen. But at this point I feel like unwanted overengineering for something that should have been straight forward for implementing.
Any ideas to mitigate the problem is mostly welcome. Code snippet for the above.
@available(iOS 17.0, *)
struct SampleTip: Tip {
var title: Text {
Text("Tip 1")
}
var message: Text? {
Text("This is Tip 1 message")
}
}
// Grid View With Items Shown
struct GridView {
var collectionItems: [Item] = []
var body: some View {
ZStack {
// LazyVGrid showing the grid and NavigationLink displays full screen rect
ScrollView(.vertical, showsIndicators: true) {
let gridItems: [GridItem] = [] // grid items
LazyVGrid(
columns: gridItems,
content: {
ForEach(collectionItems) { item in
NavigationLink {
Rectangle().fill(Color.random())
} label: {
Rectangle().fill(Color.random())
}
}
})
}
}
.navigationBarItems(trailing: navigationTrailingContent)
}
@ViewBuilder
private var navigationTrailingContent: some View {
Group {
HStack {
if #available(iOS 17.0, *) {
Toggle(isOn: $togleCondition, label: { EmptyView() })
.labelsHidden()
.popoverTip(SampleTip()) // Tip 1
} else {
Toggle(isOn: $togleCondition, label: { EmptyView() })
.labelsHidden()
}
}
}
}
}
I’ve looked into some 3rd party Tips sdks but they seem to be outdated or seemed buggier.
Thanks in advance.