Skip to content

An easy-to-use API that allows you to add onboarding tips anywhere in your application. SFOnboardingTourGuide allows you to display onboarding tips depending on whether the specific tip qualifies to be shown at a given point in time.

License

Notifications You must be signed in to change notification settings

jacksonbradley/OnboardingTourGuide

Repository files navigation

OnboardingTourGuide

An easy-to-use API that allows you to add onboarding tips anywhere in your application. SFOnboardingTourGuide allows you to display onboarding tips depending on whether the specific tip qualifies to be shown at a given point in time.

Onboaring Example

How to Use:

  1. Clone this project:
git clone https://github.com/SalesforceEng/OnboardingTourGuide.git
  1. Place the folder OnboardingTourGuide/Onboarding in your project.
  2. Import SFOnboardingTourGuide:
#import "SFOnboardingTourGuide.h"
  1. Have your class conform to SFOnboardingDelegate.
  2. Instantiate your tour guide and set its delegate:
self.tourGuide = [SFOnboardingDelegate alloc] init];
self.tourGuide.delegate = self;
  1. Tell the tour guide to show the tip when appropriate:
[self.tourGuide showTip:@"SFOnboardingTipMagicButton" forView:self.magicButton inView:self.view condition:SFOnboardingConditionShowOnce arrowDirection:SFOnboardingArrowDirectionDown withDelay:SFOnboardingTourGuideDefaultDelay animated:YES];
  1. Implement the required delegate method to let the delegate know what message to show:
- (NSString *)tourGuide:(SFOnboardingTourGuide *)tourGuide messageForTip:(NSString *)tipIdentifier {
    NSString *tip = nil;

    if ([tipIdentifier isEqualToString:@"SFOnboardingTipMagicButton"]) {
        tip = @"Tap on this button and magic will happen!";
    }

    return tip;
}

More Options

There are two main ways in which you can determine whether to show a tip at a given point at run-time:

  1. SFOnboardingCondition:
  • SFOnboardingConditionShowOnce          The tip is only shown once
  • SFOnboardingConditionShowEverytime   The tip is shown every time
  • SFOnboardingConditionShowIfAged        The tip is displayed only if it was last shown before a certain date and time
  1. Implement the delegate method tourGuide:willShowTip: in order to let the tour guide know if you still want to show the tip or not. This method gives you a chance to check the state of your application to see if showing the tip is still appropriate.

SFOnboardingDelegate provides many useful methods which you can implement to further customize the behavior of the onboarding tip. Refer to SFOnboardingDelegate.h for some helpful documentation.

Refer to the documentation in SFOnboardingTourGuide.h for more ways in which you can manipulate the onboarding tips.

#####To see an example of how to utilize SFOnboardingTourGuide, clone this repository and open the OnboardingTourGuide project in Xcode.

About

An easy-to-use API that allows you to add onboarding tips anywhere in your application. SFOnboardingTourGuide allows you to display onboarding tips depending on whether the specific tip qualifies to be shown at a given point in time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published