Skip to content

Contextual Feature Recommender

roux g. buciu edited this page Feb 24, 2022 · 3 revisions

Overview

The Contextual Feature Recommender (CFR) is that purple popup thing that... pops up (🤦)... and is used to introduce users to a new feature.

In use

The ContextualHintViewModel needs to be initialized with a Profile and a hint type. To add a new hint type, add it to ContextualHintViewType. Finally, create an instance of the ContextualHintViewController.

Then, before you can actually use the CFR, you'll need to first call the configure(...) function, passing in the anchor, the delegate, and other respective actions. This will initialize a timer which will call the function. The default time is 0.5 seconds. However, in the view model's startTimer() method, you may assign different timings based on the type of CFR you're making.

Make sure that the place you're calling the CFR from is, in fact, a UIPopoverPresentationControllerDelegate.

Depending on how your view is built, and actions within it, you may want to stop the CFR from appearing before the timer causes it to do so. TO do this, simply call the stopTimer() function on your contextual view controller.

Clone this wiki locally