Git Product home page Git Product logo

onboardingkit's Introduction

OnboardingKit

OnboardingKit is a simple and interactive framework for making iOS onboarding experience easy and fun!

Features

  • Customizable page views
  • Customizable background images
  • Customazible containers' background images
  • Animatable page control
  • Animatable transitions between pages on swipes

Installation

CocoaPods

OnboardingKit is available for installation using the CocoaPods.

Add the following code to your Podfile:

  pod 'OnboardingKit'

Usage

Import the module.

  import OnboardingKit

Add a UIView instance that inherits from OnboardingView. Tradinionally, you do this through Storyboard or manually.

Implement OnboardingViewDataSource and OnboardingViewDelegate protocols with required methods. What you have to do is to let OnboardingView know how many pages it should build and provide configurations for these pages.

  extension DataModel: OnboardingViewDataSource, OnboardingViewDelegate {
      func numberOfPages() -> Int {
        return 1
      }
      
      func onboardingView(onboardingView: OnboardingView, configurationForPage page: Int) -> OnboardingConfiguration {
        return OnboardingConfiguration(
          image: UIImage(named: "DemoImage")!,
          itemImage: UIImage(named: "DemoIcon")!,
          pageTitle: "Demo Title",
          pageDescription: "Demo Description Text!",
          backgroundImage: UIImage(named: "DemoBackground"),
          topBackgroundImage: nil, // your image here
          bottomBackgroundImage: nil // your image here
      )
  }

OnboardingConfiguration is implemented this way:

  public struct OnboardingConfiguration {
    let image: UIImage
    let itemImage: UIImage
    let pageTitle: String
    let pageDescription: String
  
    let backgroundImage: UIImage?
    let topBackgroundImage: UIImage?
    let bottomBackgroundImage: UIImage?
  }

If you need a custom configuration for a PageView this is possible with a delegate's method onboardingView(_:, configurePageView _:, atPage _:).

  func onboardingView(onboardingView: OnboardingView, configurePageView pageView: PageView, atPage page: Int) {
    pageView.titleLabel.textColor = UIColor.whiteColor()
    pageView.titleLabel.layer.shadowOpacity = 0.6
    pageView.titleLabel.layer.shadowColor = UIColor.blackColor().CGColor
    pageView.titleLabel.layer.shadowOffset = CGSize(width: 0, height: 1)
    pageView.titleLabel.layer.shouldRasterize = true
    pageView.titleLabel.layer.rasterizationScale = UIScreen.mainScreen().scale
  }

That's it. :]

Community

  • For help & feedback please use issues.
  • Got a new feature? Please submit a pull request.
  • Email us with urgent queries.

License

OnboardingKit is available under the MIT license, see the LICENSE file for more information.

onboardingkit's People

Contributors

mozharovsky avatar icyberon avatar

Watchers

James Cloos avatar Lerist 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.