Conditional TipKit tips
TipKit is now available to use in the fifth beta of Xcode 15, and it has shown up just in time for me to use it in the app I’m working on at the moment.
In a lot of ways, it is similar to a manager I wrote recently for handling event-driven prompts in a different app, but it’s nice to not have to carry that overhead around, even if it was a nice, neat little component.
One thing I found myself wanting to do was to only show a tip if a particular view was not visible - for example a splash screen or some other overlay view.
You can do this with parameters in the tips themselves - in the same was the isLoggedIn parameter works in Apple’s example, you could tie that parameter to the inverse of whatever condition presents the overlay view.
However if you have a number of tips that rely on that same condition, perhaps this little snippet is useful to prevent repetition.