Latest 1.3.0
Homepage https://github.com/NikolaKirev/OnboardKit
License MIT
Platforms ios 11.0
Authors

OnboardKit

Swift 4.2
Version
License
Carthage compatible
Twitter

Customizable user onboarding for your UIKit app in Swift

OnboardKit

Requirements

  • Swift 4.2
  • Xcode 10
  • iOS 11.0+

Installation

Carthage

github "NikolaKirev/OnboardKit"

CocoaPods

use_frameworks!

# Latest release in CocoaPods
pod 'OnboardKit'

# Get the latest on master
pod 'OnboardKit', :git => 'https://github.com/NikolaKirev/OnboardKit.git', :branch => 'master'

Don’t forget to import OnboardKit in the file you intend to use it.

Usage

  1. Create and populate a bunch of OnboardPage instances
    let page = OnboardPage(title: "Welcome to OnboardKit",
                       imageName: "Onboarding1",
                       description: "OnboardKit helps you add onboarding to your iOS app")
  2. Create an OnboardViewController
    let onboardingViewController = OnboardViewController(pageItems: [pageOne, ...]])
  3. Present the view controller
    onboardingVC.presentFrom(self, animated: true)

    (use this convenience method to make sure you present it modally)

Customization

Custom examples

Customizing Fonts and Colors

You can customize the look of your onboarding by changing the default colors and fonts.

  1. Initialize an AppearanceConfiguration instance with the desired custom style properties
    let appearance = AppearanceConfiguration(tintColor: .orange,
                                         titleColor: .red,
                                         textColor: .white,
                                         backgroundColor: .black,
                                         titleFont: UIFont.boldSystemFont(ofSize: 32.0),
                                         textFont: UIFont.boldSystemFont(ofSize: 17.0))
  2. Pass the AppearanceConfiguration instance as a parameter when initialising an OnboardViewController
    let onboardingVC = OnboardViewController(pageItems: onboardingPages,
                                         appearanceConfiguration: appearance)

Customizing Buttons

To customize the style of the advance and action buttons on each page of the onboarding flow, you can use a ButtonStyling closure.

  1. Create the closure
    let advanceButtonStyling: OnboardViewController.ButtonStyling = { button in
    button.setTitleColor(UIColor.lightGray, for: .normal)
    button.titleLabel?.font = UIFont.systemFont(ofSize: 16.0, weight: .semibold)
    }
  2. Pass the closure in the AppearanceConfiguration initializer
    let appearance = OnboardViewController.AppearanceConfiguration(tintColor: .orange,
                                                               advanceButtonStyling: advanceButtonStyling)

Author

Nikola Kirev

License

OnboardKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "OnboardKit",
    "version": "1.3.0",
    "summary": "Customisable user onboarding for your iOS app",
    "description": "OnboardKit gives you an easy way to add onboarding to your iOS app.nIt is written in Swift.",
    "homepage": "https://github.com/NikolaKirev/OnboardKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Nikola Kirev": "[email protected]"
    },
    "social_media_url": "http://twitter.com/NikolaKirev",
    "platforms": {
        "ios": "11.0"
    },
    "source": {
        "git": "https://github.com/NikolaKirev/OnboardKit.git",
        "tag": "v1.3.0"
    },
    "source_files": "OnboardKit"
}

Pin It on Pinterest

Share This