Skip to content

RamVadranam/paper-onboarding

 
 

Repository files navigation

header

paper-onboarding

Twitter CocoaPods CocoaPods Travis codebeat badge

shot on dribbble:

StackViewController Example App

The iPhone mockup available here.

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

Just add the Source folder to your project.

or use CocoaPods with Podfile:

pod 'paper-onboarding'

Usage

Storyboard

  1. Create a new UIView inheriting from PaperOnboarding

  2. Set itemsCount in attribute inspector

or Code

override func viewDidLoad() {
  super.viewDidLoad()

  let onboarding = PaperOnboarding(itemsCount: 3, dataSource: self)
  onboarding.translatesAutoresizingMaskIntoConstraints = false
  view.addSubview(onboarding)

  // add constraints
  for attribute: NSLayoutAttribute in [.Left, .Right, .Top, .Bottom] {
    let constraint = NSLayoutConstraint(item: onboarding,
                                        attribute: attribute,
                                        relatedBy: .Equal,
                                        toItem: view,
                                        attribute: attribute,
                                        multiplier: 1,
                                        constant: 0)
    view.addConstraint(constraint)
  }
}

For adding content use delegate methods:

func onboardingItemAtIndex(index: Int) -> OnboardingItemInfo {
   return [
     ("BIG_IMAGE1", "Title", "Description text", "IconName1", "BackgroundColor"),
     ("BIG_IMAGE2", "Title", "Description text", "IconName2", "BackgroundColor"),
     ("BIG_IMAGE2", "Title", "Description text", "IconName2", "BackgroundColor"),
   ][index]
 }

License

paper-onboarding is released under the MIT license. See LICENSE for details.

About

Maintained by app development agency Ramotion Inc. See our other open-source projects or hire us to design, develop, and grow your product.

Twitter URL Twitter Follow

About

PaperOnboarding is a material design slider

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 98.9%
  • Ruby 1.1%