DNTutorial manages a set of tutorial elements that guide users on how to interact with your app.
The implementation of DNTutorial is very simple and was mainly based on Paper by Facebook.
To run the example project, clone the repo, and run
pod install from the Example directory first.
To use DNTutorial, import the DNTutorial header file to your view controller and add it as a delegate of DNTutorial. To present a tutorial, simply create the tutorial elements you would like to present.
An example of creating a tutorial sequence.
DNTutorialBanner *banner = [DNTutorialBanner bannerWithMessage:@"A banner message" completionMessage:@"Completion message" key:@"banner"]; DNTutorialGesture *scrollGesture = [DNTutorialGesture gestureWithPosition:center type:DNTutorialGestureTypeScrollLeft key:@"gesture"]; DNTutorialStep *step = [DNTutorialStep stepWithTutorialElements:@[banner, scrollGesture] forKey:@"step"]; [DNTutorial presentTutorialWithSteps:@[step1] inView:self.view delegate:self];
To style the appearance of a banner simply call the style method
[banner styleWithColor:[UIColor blackColor] completedColor:[UIColor blueColor] opacity:0.7 font:[UIFont systemFontOfSize:13]];
DNTutorial comes with two standard tutorial elements (DNTutorialBanner, DNTutorialGesture).
Both standard classes derive from the same base class, DNTutorialElement. This polymorphic class provides an easy framework for you to come up with your own tutorial element subclasses that can work with the tutorial system right from outside the box.
And if you come up with a cool class, just submit a pull request so that I can add it to the repo.
DNTutorial is available through CocoaPods. To install it, simply add the following line to your Podfile:
There are two options:
DNTutorial requires iOS 7 or later.
Add ability to hide and show a tutorial step and see how it syncs with skipping a tutorial step.
Dismiss objects based on user actions √
Look into NSObject as the base type for tutorialElements √
Flexible implementation with polimorphic base classes for easy customizable subclasses √
Save state on user defaults √
DNTutorial is available under the MIT license. See the LICENSE file for more info.