Latest 2.0.2
License MIT
Platforms ios 9.0
Frameworks UIKit

[![CI Status]( Phan Tran/TDOnboarding.svg?style=flat)]( Phan Tran/TDOnboarding)


To run the example project, clone the repo, and run pod install from the Example directory first.



TDOnboarding is available through CocoaPods. To install
it, simply add the following lines to your Podfile:

pod 'TDOnboarding'


TDOnboarding lets you quickly setup a new onboarding using [TDOnboadingItem] and present the onboading.

All you need to do is provide the items and options for the onboarding through its initializer:

let onboarding = TDOnboarding(items: items, options: ExampleOnboardingOptions())
onboarding.present(from: self, completion: nil)


Each onboarding item must conform to the TDOnboardingItem protocol, which is defined as:

public protocol TDOnboardingItem {
    var image: UIImage { get }
    var subtitle: NSAttributedString { get }
    var topTitle: NSAttributedString? { get }
    var bottomTitle: NSAttributedString? { get }
    var topActionButtonTitle: NSAttributedString? { get }
    var bottomActionButtonTitle: NSAttributedString? { get }


This is a protocol that lets you quickly configure the onboarding screen, it also includes default values for standard "The Distance" onboarding style, you should return nil to get defaul values. This enable easy extension to this library by adding more configurables to the enums.

The options includes:

public protocol TDOnboardingOptions {
    var defaultBackgroundImage: UIImage { get }
    var statusBarStyle: UIStatusBarStyle { get }
    var paginationCell: TDOnboardingPaginationCell.Type { get }
    func measure(for component: TDOnboardingMeasurableComponent) -> CGFloat?
    func configure(for component: TDOnboardingConfigurableComponent)
    func color(for component: TDOnboardingColorizableComponent) -> UIColor?

public enum TDOnboardingMeasurableComponent {
    case bottomPanelHeight
    case imageTopDistance
    case imageBottomDistance
    case bottomActionButtonWidth

public enum TDOnboardingColorizableComponent {
    case paginationItem
    case backgroundImageOverlay
    case bottomPanel

public enum TDOnboardingConfigurableComponent {
    case topActionButton(UIButton)
    case bottomActionButton(UIButton)

Custom Pagination View:

The library comes with default pagination view, however, you can create your own by creating and extending a collectionview cell with TDOnboardingPaginationCell

public protocol TDOnboardingPaginationCell {
    static var identifier: String { get }
    static var nib: UINib { get }
    func configure(for index: Int, isSelected: Bool, options: TDOnboardingOptions?)

The cell height max is 10pt.

The pagination view will automatically center the cells inside horizontally.

After that, all you need is provide the cell in the options:

struct ExampleOnboardingOptions: TDOnboardingOptions {
    ... // Other options
    var paginationCell: TDOnboardingPaginationCell.Type {
        return CustomPaginationItemCell.self

Components with configurations


Default Onboarding:



TDOnboarding provide delegation for button actions in the onboarding screen:

let onboarding = TDOnboarding(items: items, options: ExampleOnboardingOptions())
onboarding.delegate = self
onboarding.present(from: self, completion: nil)
public protocol TDOnboardingDelegate: class {
    func topActionButtonTapped(on onboarding: TDOnboarding, itemIndex: Int)
    func bottomActionButtonTapped(on onboarding: TDOnboarding, itemIndex: Int)


Anh Phan Tran, [email protected]


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

Latest podspec

    "name": "TDOnboarding",
    "version": "2.0.2",
    "summary": "A shortcut to create TD styled onboarding with easy customization",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Anh Phan Tran": "[email protected]"
    "source": {
        "git": "",
        "tag": "2.0.2"
    "platforms": {
        "ios": "9.0"
    "source_files": "TDOnboarding/**/*.swift",
    "resources": "TDOnboarding/**/*.{xib,storyboard,xcassets}",
    "frameworks": "UIKit"

Pin It on Pinterest

Share This