Git Product home page Git Product logo

ystutorialviewcontroller's Introduction

YSTutorialViewController

Create flat design tutorial pages quickly. It can read page data from json file, no coding required for pages ! Fully customisable.

Demo

alt tag

Install

Manual

Copy & paste YSTutorialViewController folder into your project

CocoaPods

pod 'YSTutorialViewController'

Usage

Create a YSTutorialViewController.

	 self.tutorialViewController = [[YSTutorialViewController alloc] init];
    [self.tutorialViewController setDataSource:self];
    [self.tutorialViewController setDelegate:self];
    [self.tutorialViewController reloadTutorialViewController];
    [self.view addSubview:self.tutorialViewController.view];

YSTutorialViewControllerDataSource

Feed the data source with your pages array

- (NSInteger)numberOfPagesInTutorialViewController:(YSTutorialViewController *)viewController {
    return self.tutorialPages.count;
}

- (YSTutorialPageView *)tutorialViewController:(YSTutorialViewController *)viewController tutorialPageViewForIndex:(NSInteger)index {
    return (YSTutorialPageView *)self.tutorialPages[index];
}

YSTutorialViewControllerDelegate

Optional delegate methods for taking control of actions

@protocol YSTutorialViewControllerDelegate

@optional

- (UIImage *)tutorialViewControllerBackgroundImageForIndex:(NSInteger)index;
- (void)tutorialViewControllerDidPressedCloseButton: (YSTutorialViewController *)viewController;
- (void)tutorialViewController:(YSTutorialViewController *)viewController didScrollToPageAtIndex:(NSInteger)index;

@end

YSTutorialPageSerializer

If you want to use a json file for creating pages you can serialize a YSTutorialPageView array with + (NSArray *)tutorialPageViewsWithJSONFile:(NSString *)path method

    self.tutorialPages = [YSTutorialPageSerializer tutorialPageViewsWithJSONFile:@"tutorialPages"];

Creating YSTutorialPageViews manually

    YSTutorialPageView *page = [[YSTutorialPageView alloc] initWithImageNamed:@"tutImage.png"
                                                              bottomViewColor:[UIColor redColor]
                                                                    iconNamed:@"tutIcon.png"
                                                                        title:@"Title goes here"
                                                                         text:@"This is the text that describes your app's awesome feature"];

YSTutorialViewControllerAppearance

You can describe an appearance and init your YSTutorialViewController with it. YSTutorialViewControllerAppearance looks like this

@property (nonatomic, strong) UIColor *titleLabelColor;
@property (nonatomic, strong) UIFont *titleLabelFont;

@property (nonatomic, strong) UIColor *descriptionLabelColor;
@property (nonatomic, strong) UIFont *descriptionLabelFont;

@property (nonatomic, assign) CGFloat tutorialPageBottomViewHeight;
@property (nonatomic, strong) UIColor *pageControlTintColor;

@property (nonatomic, assign) CGFloat backgroundImageViewOverlayAlpha;
@property (nonatomic, strong) UIColor *backgroundImageViewOverlayColor;

@property (nonatomic, strong) UIColor *closeButtonColor;
@property (nonatomic, assign) CGFloat closeButtonLineWidth;
- (instancetype)initWithAppearance:(YSTutorialViewControllerAppearance *)appearance;

ystutorialviewcontroller's People

Contributors

cemolcay avatar readmecritic avatar

Stargazers

 avatar Sebastian Barajas avatar  avatar Yasin Aktimur avatar Mesut Cilingir avatar Vasant Mungra avatar George Steiner avatar Gavin Bunney avatar Sergii Tatsii avatar Rostyslav Dovhaliuk avatar Mehdi Badjian avatar Ken Vermeille avatar Ayoze Roberto Bernardo avatar

Watchers

 avatar James Cloos avatar  avatar Giuseppe Bruno avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.