juanpablofernandez
SwiftyOnboard
Swift

A swifty iOS framework that allows developers to create beautiful onboarding experiences.

Last updated Jun 30, 2026
1.3k
Stars
107
Forks
32
Issues
0
Stars/day
Attention Score
63
Language breakdown
No language data available.
โ–ธ Files click to expand
README

SwiftyOnboard

A simple iOS framework that allows developers to create onboarding experiences.

[![Swift Version][swift-image]][swift-url] [![Build Status][travis-image]][travis-url] [![License][license-image]][license-url] CocoaPods Carthage compatible Platform

SwiftyOnboard makes it easy to add onboarding to any iOS application. SwiftyOnboard handles all of the logic behind the pagination of views, which allows you to quickly add a highly customizable onboarding to your app, all in a lightweight framework.

Contents

* CocoaPods * Manually * Properties * Methods * Protocols * DataSource * Delegate

Requirements

  • iOS 12.0+
  • Xcode 10.3+

Installation

CocoaPods

You can use CocoaPods to install SwiftyOnboard by adding this to your Podfile:
use_frameworks!
pod 'SwiftyOnboard'
If you get the `Unable to find a specification for SwiftyOnboard. error after running pod install.

Run the following commands on your project directory: <pre><code class="lang-">pod repo update</code></pre> <pre><code class="lang-">pod install</code></pre>

Carthage

To install via Carthage add this to your Cartfile: <pre><code class="lang-ruby">github &quot;juanpablofernandez/SwiftyOnboard&quot;</code></pre>

Manually

  • Drag and drop <pre><code class="lang-SwiftyOnboard">.swift</code></pre> <pre><code class="lang-SwiftyOnboardOverlay">.swift</code></pre> <pre><code class="lang-SwiftyOnboardPage">.swift</code></pre> in your project.
  • That's it!

Usage

  • Import SwiftyOnboard module to your ViewController class
<pre><code class="lang-swift">import SwiftyOnboard</code></pre>
  • Add SwiftyOnboard to ViewController, then set dataSource and delegate for it
<pre><code class="lang-swift">class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad()

let swiftyOnboard = SwiftyOnboard(frame: view.frame) view.addSubview(swiftyOnboard) swiftyOnboard.dataSource = self } }</code></pre>

  • Conform your ViewController to SwiftyOnboardDataSource protocol and implement all the methods, e.g.
<pre><code class="lang-swift">extension ViewController: SwiftyOnboardDataSource {

func swiftyOnboardNumberOfPages(swiftyOnboard: SwiftyOnboard) -&gt; Int { return 3 }

func swiftyOnboardPageForIndex(swiftyOnboard: SwiftyOnboard, index: Int) -&gt; SwiftyOnboardPage? { let page = SwiftyOnboardPage() return page } }</code></pre>

  • SwiftyOnboard works with default implementation. Override it to customize its behavior
<!-- Example project with CocoaPods. -->

Properties

SwiftyOnboard has the following properties: <pre><code class="lang-swift">public var dataSource: SwiftyOnboardDataSource?</code></pre> An object that supports the SwiftyOnboardDataSource protocol and can provide views to populate the SwiftyOnboard. <pre><code class="lang-swift">public var delegate: SwiftyOnboardDelegate?</code></pre> An object that supports the SwiftyOnboardDelegate protocol and can respond to SwiftyOnboard events. <pre><code class="lang-swift">public var shouldSwipe: Bool</code></pre> Whether or not swiping is enabled [default = true]. <pre><code class="lang-swift">public var fadePages: Bool</code></pre> Whether or not pages will fade upon transition [default = true].

Methods

SwiftyOnboard class has the following methods: <pre><code class="lang-swift">func goToPage(index: Int, animated: Bool)</code></pre> This method allows you to move to a certain page in the onboarding.

Protocols

The SwiftyOnboard follows the Apple convention for data-driven views by providing two protocol interfaces, SwiftyOnboardDataSource and SwiftyOnboardDelegate.

SwiftyOnboardDataSource

SwiftyOnboardDataSource protocol has the following methods: <pre><code class="lang-swift">func swiftyOnboardNumberOfPages(swiftyOnboard: SwiftyOnboard) -&gt; Int</code></pre> Return the number of items (pages) in the onboarding. <pre><code class="lang-swift">func swiftyOnboardViewForBackground(swiftyOnboard: SwiftyOnboard) -&gt; UIView?</code></pre> Return a view to be displayed as the background of the onboarding. <pre><code class="lang-swift">func swiftyOnboardPageForIndex(swiftyOnboard: SwiftyOnboard, index: Int) -&gt; SwiftyOnboardPage?</code></pre> Return a view (page) to be displayed at the specified index in the onboarding. <pre><code class="lang-swift">func swiftyOnboardViewForOverlay(swiftyOnboard: SwiftyOnboard) -&gt; SwiftyOnboardOverlay?</code></pre> Return an overlay (view) to be displayed on top of the onboarding pages. e.g. [The continue and skip buttons which don't move with the pages, also included is the page control] <pre><code class="lang-swift">func swiftyOnboardOverlayForPosition(swiftyOnboard: SwiftyOnboard, overlay: SwiftyOnboardOverlay, for position: Double)</code></pre> Edit the overlay (view) for the desired position. e.g. [Change the "continue button" text to "Done", when the last page is reached] <pre><code class="lang-swift">func swiftyOnboardBackgroundColorFor(_ swiftyOnboard: SwiftyOnboard, atIndex index: Int) -&gt; UIColor?</code></pre> Set the background color for the page at the given index. (Very useful when you have pages with different background colors)

SwiftyOnboardDelegate

SwiftyOnboardDelegate protocol has the following methods: <pre><code class="lang-swift">func swiftyOnboard(swiftyOnboard: SwiftyOnboard, currentPage index: Int)</code></pre> This method is called whenever a page is shown, it holds the index to that page. It is called regardless of whether the page was swiped programmatically or through user interaction. <pre><code class="lang-swift">func swiftyOnboard(swiftyOnboard: SwiftyOnboard, leftEdge position: Double)</code></pre> This method is called whenever the pages are scrolling, it holds the current distance between the left side of the screen and the left side of the first page. <pre><code class="lang-swift">func swiftyOnboard(swiftyOnboard: SwiftyOnboard, tapped index: Int)</code></pre> This method is called whenever a page is tapped by the user, it holds the index of the tapped page.

Notes

  • Landscape mode is not supported

Contribute

Contributions are welcomed! There are however certain guidelines you must follow when you contribute:
  • Have descriptive commit messages.
  • Make a pull request for every feature (Don't make a pull request that adds 3 new features. Make an individual pull request for each of those features, with a descriptive message).
  • Don't update the example project, or any other irrelevant files.
I want to see your amazing onboarding. Take screenshots and/or record a gif and send it my way!

License

Distributed under the MIT license. See LICENSE` for more information.

[swift-image]:https://img.shields.io/badge/swift-5.0-orange.svg [swift-url]: https://swift.org/ [license-image]: https://img.shields.io/badge/License-MIT-blue.svg [license-url]: LICENSE [travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square [travis-url]: https://travis-ci.org/dbader/node-datadog-metrics [codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dad [codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com

ยฉ 2026 GitRepoTrend ยท juanpablofernandez/SwiftyOnboard ยท Updated daily from GitHub