GithubHelp home page GithubHelp logo

baytelman / eaintroview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ealeksandrov/eaintroview

0.0 7.0 0.0 2.64 MB

Highly customizable drop-in solution for introduction views.

License: MIT License

Objective-C 99.11% Ruby 0.89%

eaintroview's Introduction

#EAIntroView - simple iOS Introductions

BackgroundImage BackgroundImage

This is highly customizable drop-in solution for introduction views. Some features (remember, most features are optional and can be turned off):

  • beautiful demo project to look on some examples
    • customizability is unlimited, one can make complex introView with animations and interactive pages, so do not limit yourself with existing examples
  • for each basic page:
    • background (with cross-dissolve transition between pages)
    • custom iOS7 motion effects (parallax) on background
    • title view (+ Y position)
    • title text (+ font, color and Y position)
    • description text (+ font, color, width and Y position)
    • subviews array (added to page after building default layout)
  • possibility to set your own custom view for page:
    • pageWithCustomView:
    • pageWithCustomViewFromNibNamed:
  • possibility to set block action on page events:
    • pageDidLoad
    • pageDidAppear
    • pageDidDisappear
  • many options to customize parent view:
    • swipe from last page to close
    • switching pages with one simple tap
    • custom background image or color
    • custom page control
    • custom skip button
    • pinned titleView (+ Y position, can be hidden on some pages)
  • delegate protocol to listen:
    • introDidFinish:
    • intro:pageAppeared:withIndex:
  • actions on IntroView:
    • setPages:
    • showInView:animateDuration:
    • hideWithFadeOutDuration:
    • setCurrentPageIndex:animated:
  • storyboard/IB support

License: MIT.

##CocoaPods

CocoaPods is the recommended way to use EAIntroView in your project.

  • Simply add this line to your Podfile: pod 'EAIntroView', '~> 2.6.0'
  • Run pod install.
  • Include with #import "EAIntroView.h" to use it wherever you need.
  • Subscribe to the EAIntroDelegate to enable delegate/callback interaction.

##Manual installation

  • Add EAIntroPage and EAIntroView headers and implementations to your project (4 files total).
  • Include with #import "EAIntroView.h" to use it wherever you need.
  • Subscribe to the EAIntroDelegate to enable delegate/callback interaction.

##How To Use It

Sample project have many examples of customization. Here are only simple ones.

###Step 1 - Build Pages Each page created with [EAIntroPage page] class method. Then you can customize any property, all of them are optional. Another approach is to pass your own (can be nib), custom view in EAIntroPage, this way most other options are ignored.

// basic
EAIntroPage *page1 = [EAIntroPage page];
page1.title = @"Hello world";
page1.desc = sampleDescription1;
// custom
EAIntroPage *page2 = [EAIntroPage page];
page2.title = @"This is page 2";
page2.titleFont = [UIFont fontWithName:@"Georgia-BoldItalic" size:20];
page2.titlePositionY = 220;
page2.desc = sampleDescription2;
page2.descFont = [UIFont fontWithName:@"Georgia-Italic" size:18];
page2.descPositionY = 200;
page2.titleIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"title2"]];
page2.titleIconPositionY = 100;
// custom view from nib
EAIntroPage *page3 = [EAIntroPage pageWithCustomViewFromNibNamed:@"IntroPage"];
page3.bgImage = [UIImage imageNamed:@"bg2"];

###Step 2 - Create Introduction View Once all pages have been created, you are ready to create the introduction view. Just pass them in right order in the introduction view. You can also pass array of pages after IntroView's initialization, it will rebuild its contents.

EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.view.bounds andPages:@[page1,page2,page3,page4]];

Don't forget to set the delegate if you want to use any callbacks.

[intro setDelegate:self];

###Step 3 - Show Introduction View

[intro showInView:self.view animateDuration:0.0];

###Storyboard/IB Since 1.3.0 EAIntroView supports init from IB. Since 2.0.0 EAIntroPage supports it too.

  1. Drop UIView to your IB document.
  2. Set its class to EAIntroView.
  3. Create IBOutlet property in your view controller: @property(nonatomic,weak) IBOutlet EAIntroView *introView;.
  4. Connect IBOutlet with EAIntroView in IB.
  5. Build array of pages (you can use pageWithCustomViewFromNibNamed: here with separate nibs for each page).
  6. Pass pages array to EAIntroView property in setPages:.

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.