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

Overview

SwiftyOnboard is being sponsored by the following tool; please help to support us by taking a look and signing up to a free trial GitAds

SwiftyOnboard

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

Swift Version Build Status License 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

Requirements

  • iOS 9.0+
  • Xcode 7.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:

pod repo update
pod install

Carthage

To install via Carthage add this to your Cartfile:

github "juanpablofernandez/SwiftyOnboard"

Manually

  1. Drag and drop SwiftyOnboard.swift SwiftyOnboardOverlay.swift SwiftyOnboardPage.swift in your project.
  2. That's it!

Usage

  1. Import SwiftyOnboard module to your ViewController class
import SwiftyOnboard
  1. Add SwiftyOnboard to ViewController, then set dataSource and delegate for it
class ViewController: UIViewController {
    override func viewDidLoad() {
            super.viewDidLoad()

            let swiftyOnboard = SwiftyOnboard(frame: view.frame)
            view.addSubview(swiftyOnboard)
            swiftyOnboard.dataSource = self
        }
}
  1. Conform your ViewController to SwiftyOnboardDataSource protocol and implement all the methods, e.g.
extension ViewController: SwiftyOnboardDataSource {

        func swiftyOnboardNumberOfPages(swiftyOnboard: SwiftyOnboard) -> Int {
            return 3
        }

        func swiftyOnboardPageForIndex(swiftyOnboard: SwiftyOnboard, index: Int) -> SwiftyOnboardPage? {
            let page = SwiftyOnboardPage()
            return page
        }
}
  1. SwiftyOnboard works with default implementation. Override it to customize its behavior

Properties

SwiftyOnboard has the following properties:

public var dataSource: SwiftyOnboardDataSource?

An object that supports the SwiftyOnboardDataSource protocol and can provide views to populate the SwiftyOnboard.

public var delegate: SwiftyOnboardDelegate?

An object that supports the SwiftyOnboardDelegate protocol and can respond to SwiftyOnboard events.

public var shouldSwipe: Bool

Whether or not swiping is enabled [default = true].

public var fadePages: Bool

Whether or not pages will fade upon transition [default = true].

Methods

SwiftyOnboard class has the following methods:

func goToPage(index: Int, animated: Bool)

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:

func swiftyOnboardNumberOfPages(swiftyOnboard: SwiftyOnboard) -> Int

Return the number of items (pages) in the onboarding.

func swiftyOnboardViewForBackground(swiftyOnboard: SwiftyOnboard) -> UIView?

Return a view to be displayed as the background of the onboarding.

func swiftyOnboardPageForIndex(swiftyOnboard: SwiftyOnboard, index: Int) -> SwiftyOnboardPage?

Return a view (page) to be displayed at the specified index in the onboarding.

func swiftyOnboardViewForOverlay(swiftyOnboard: SwiftyOnboard) -> SwiftyOnboardOverlay?

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]

func swiftyOnboardOverlayForPosition(swiftyOnboard: SwiftyOnboard, overlay: SwiftyOnboardOverlay, for position: Double)

Edit the overlay (view) for the desired position. e.g. [Change the "continue button" text to "Done", when the last page is reached]

func swiftyOnboardBackgroundColorFor(_ swiftyOnboard: SwiftyOnboard, atIndex index: Int) -> UIColor?

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:

func swiftyOnboard(swiftyOnboard: SwiftyOnboard, currentPage index: Int)

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.

func swiftyOnboard(swiftyOnboard: SwiftyOnboard, leftEdge position: Double)

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.

func swiftyOnboard(swiftyOnboard: SwiftyOnboard, tapped index: Int)

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.

Comments
  • Page Control doesn't synchronize with a swipe action

    Page Control doesn't synchronize with a swipe action

    Dear developer, I tried to install this SwiftyOnboard pod into my project, but its page control doesn't synchronize with a swipe action. For example, even if I swipe the display to the next page, the dot point of page control doesn't move. Plus, even if I tap the dot, the display doesn't move to the designated page. In order to synchronize page control and swipe and tap actions like the demo, where and which code should I add? My environment is Xcode 9 beta 6, macOS Sierra. I'm a beginner who started learning of iOS development 2 months ago, so I wonder if you cloud explain a solution to me simply. Thanks in advance from Japan.

    opened by alan-d-haller 13
  • Check out my fork

    Check out my fork

    Hey, really neat framework.

    I refactored some of the protocols to match up with the Swift 3 syntax. I also added a new color transitioning feature.

    https://github.com/Minitour/SwiftyOnboard

    Keep up the good work 😄

    opened by Minitour 5
  • Fix deprecation warning in Swift 4.0

    Fix deprecation warning in Swift 4.0

    • Replace usage of UIColor constructor init(colorLiteralRed:green:blue:alpha:) with init(red:green:blue:alpha:)
    • Fix spellings of percent and percentage for better code readability
    opened by jimmyti 4
  • Updated overlay layout constraints to use layoutMarginsGuide.

    Updated overlay layout constraints to use layoutMarginsGuide.

    By using layoutMarginsGuide, the pageControl does not overlap the swipe up bar on the iPhone X. I also tested the layout on the iPhone 5S and iPhone 7 simulators to ensure layout looked correct. I decreased the topAnchor constant for the skipButton from 40 to 10 since the layoutMarginsGuide already pushes it down from the top a bit.

    opened by mpatzer 3
  • Scroll vertical with navigation bar

    Scroll vertical with navigation bar

    Hello,

    The scroll worked perfectly until i added a navigation controller and then a navigation bar. Now my page is scrolling vertically.

    Before navigation bar spotmeals presentation ios

    After navigation bar spotmeals presentation ios bug

    Seems like the height of navigation bar is added to the scroll height of content.

    Regards,

    opened by Nexmind 3
  • Added Color transitioning

    Added Color transitioning

    • Modified some function names to match up with Swift 3.0 syntax
    • Added optional data source method to allow color transition between pages.
    • Added delegate methods for Continue/Skip buttons.
    opened by Minitour 3
  • SwiftyOnboardPage isn't setup correctly if the view isn't fullscreen.

    SwiftyOnboardPage isn't setup correctly if the view isn't fullscreen.

    This is because, the container view's x & y are shifted, according to the non-fullscreen view's x & y.

    Steps to reproduce:

    1. In the example project's use 'Storyboard Example View Controller'
    2. Adjust the view that is connected to the code, and shrink in size.
    Screenshot 2019-11-17 at 10 16 39
    1. Try running, and find that the customPage is also shifted wrt the view's x & y.
    opened by Revanth-Kausikan 2
  • Build fail on iOS 11/Swift 4

    Build fail on iOS 11/Swift 4

    Trying to use this and I'm getting a build time error from Swift Compiler and it appears some changes from Swift 3 to Swift broke part..

    Argument of '#selector' refers to instance method 'didTapPageControl' that is not exposed to Objective-C

    'init(colorLiteralRed:green:blue:alpha:)' is unavailable: This initializer is only meant to be used by color literals

    Argument of '#selector' refers to instance method 'tappedPage()' that is not exposed to Objective-C

    opened by zacrose14 2
  • Delegate should be defined as weak

    Delegate should be defined as weak

    You should define the delegate as a weak variable to prevent memory cycles.

    https://github.com/juanpablofernandez/SwiftyOnboard/blob/master/SwiftyOnboard/SwiftyOnboard.swift#L64

    opened by funkenstrahlen 2
  • Add support for Swift 4.2 and Xcode 10.1

    Add support for Swift 4.2 and Xcode 10.1

    • Update project files to adopt new default configurations in Xcode 10.1
    • Update source to support Swift 4.2
    • Update Example project to adopt view controller-based status bar appearance to resolve deprecation warnings
    opened by jimmyti 1
  • SwiftyOnboardPage not showing

    SwiftyOnboardPage not showing

    the code is calling func swiftyOnboardPageForIndex(_ swiftyOnboard: SwiftyOnboard, index: Int) -> SwiftyOnboardPage? {

    but SwiftyOnboardPage is not showing

    opened by syrakozz 1
  • Title not fitting completely in label

    Title not fitting completely in label

    I cannot fit more than 2 lines of text to the SwiftyOnboardPage title label. Is there a way to get more lines? numberOfLines is set to 0 (auto) originally and I tried to manually set it to 0 and 3. I also tried to call sizeToFit() and set adjustsFontSizeToFitWidth = true. If it matters I have manually set a custom font with size of 22 and I am testing on iPhone 6 Plus simulator.

    opened by Vaintti 0
  • Can't override page init

    Can't override page init

    Bug

    If I try to customize some constraints, I have a problem. My first idea is to create a SwiftyOnboardPage class and override thesetUp ()method to my constraints. Its not work, after that I try to overrideinit ()method, butinit () in SwiftyOnboardPage` does not have a public type.

    Solution

    After then I updated the original init () method in SwiftyOnboardPage and all works pretty well.

    Bug

    Same problem is override setUp method

    Solution

    Set setUp method as open

    If you have any other idea to craate your own page, please tell me.

    opened by jakubforman 0
Owner
Juan Pablo Fernandez
iOS Developer
Juan Pablo Fernandez
Onboarding - Completed project for creating Onboarding screens in SwiftUI

Onboarding Completed project for creating Onboarding screens in SwiftUI.

Khawlah Bawazir 0 Jan 13, 2022
SwiftyWalkthrough is a library for creating great walkthrough experiences in your apps, written in Swift.

SwiftyWalkthrough is a library for creating great walkthrough experiences in your apps, written in Swift. You can use the library to allow users to navigate and explore your app, step by step, in a predefined way controlled by you.

Rui Costa 370 Nov 24, 2022
iOS library Paper Onboarding is a material design UI slider written on Swift.

iOS library Paper Onboarding is a material design UI slider written on Swift. We specialize in the designing and coding of custom UI

Ramotion 3.2k Jan 5, 2023
SwiftUI library for a walkthrough or onboarding flow with tap actions

Concentric Onboarding iOS library for a walkthrough or onboarding flow with tap actions written with SwiftUI We are a development agency building phen

Exyte 955 Jan 4, 2023
OnboardKit - Customizable user onboarding for your UIKit app in Swift

OnboardKit Customizable user onboarding for your UIKit app in Swift Requirements Swift 5.0 Xcode 10 iOS 11.0+ Installation Carthage github "NikolaKire

Nikola Kirev 470 Dec 23, 2022
An animated popover that pops out a given frame, great for subtle UI tips and onboarding.

Animated popover that pops out of a frame. You can specify the direction of the popover and the arrow that points to its origin. Color, border radius

Andrea Mazzini 3k Jan 8, 2023
DeliveryOnboardingSwiftUI - A Delivery Onboarding screen made with SwiftUI

DeliveryOnboardingSwiftUI Its a Onboarding screen made with SwiftUI

null 1 Feb 5, 2022
Configurable animated onboarding screen written programmatically in Swift for UIKit

Configurable animated onboarding screen written programmatically in Swift for UIKit – inspired by many Apple-designed user interfaces in iOS – with Insignia as an example.

Lukman “Luke” Aščić 370 Dec 27, 2022
SuggestionsKit is a framework for iOS that was created in order to provide developers with the opportunity to educate users on various features of applications.

SuggestionsKit is a framework for iOS that was created in order to provide developers with the opportunity to educate users

Ilya 63 Nov 30, 2022
An iOS framework to easily create simple animated walkthrough, written in Swift.

Intro Overview An iOS framework to easily create simple animated walkthrough, written in Swift. Requirements iOS8 Installation with CocoaPods Intro is

Nurdaulet Bolatov 33 Oct 1, 2021
Awesome tool for create tutorial walkthrough or coach tour

AwesomeSpotlightView is a nice and simple library for iOS written on Swift 5. It's highly customizable and easy-to-use tool. Works perfectly for tutor

Alexander Shoshiashvili 309 Jan 5, 2023
Create walkthroughs and guided tours (coach marks) in a simple way, with Swift.

Add customizable coach marks into your iOS project. Available for both iPhone and iPad. ⚠️ Instructions 2.0.1 brings a couple of breaking changes, ple

Frédéric Maquin 4.9k Jan 3, 2023
A simple keyframe-based animation framework for iOS, written in Swift. Perfect for scrolling app intros.

RazzleDazzle is a simple AutoLayout-friendly keyframe animation framework for iOS, written in Swift. Perfect for scrolling app intros. RazzleDazzle gr

IFTTT 3.4k Jan 1, 2023
A simple keyframe-based animation framework for UIKit. Perfect for scrolling app intros.

Jazz Hands is a simple keyframe-based animation framework for UIKit. Animations can be controlled via gestures, scroll views, KVO, or ReactiveCocoa. J

IFTTT 6.4k Dec 28, 2022
BWWalkthrough is a simple library that helps you build custom walkthroughs for your iOS App

What is BWWalkthrough? BWWalkthrough (BWWT) is a class that helps you create Walkthroughs for your iOS Apps. It differs from other similar classes in

Yari @bitwaker 2.8k Jan 4, 2023
Fully customisable tooltip view in Swift for iOS.

Description EasyTipView is a fully customizable tooltip view written in Swift that can be used as a call to action or informative tip. Contents Featur

Teo 2.9k Dec 27, 2022
WVWalkthroughView is an objective C based utility to highlight certain parts for iOS apps.

WVWalkthroughView A simple utility written in Objective C to help developers walk a user through their app. It allows a message to be displayed, a par

Praagya Joshi 29 Mar 25, 2021
✨ An elegant way to guide your beloved users in iOS apps - Material Showcase.

Material Showcase for iOS An elegant and beautiful tap showcase view for iOS apps based on Material Design Guidelines. Requirement iOS 10.0+ Swift 4.2

Aromajoin 349 Dec 5, 2022
An iOS framework to easily create a beautiful and engaging onboarding experience with only a few lines of code.

Onboard Click Here For More Examples Important Onboard is no longer under active development, and as such if you create any issues or submit pull requ

Mike 6.5k Dec 17, 2022
Onboarding - Completed project for creating Onboarding screens in SwiftUI

Onboarding Completed project for creating Onboarding screens in SwiftUI.

Khawlah Bawazir 0 Jan 13, 2022