exyte
  • July 29, 2025

Concentric Onboarding


iOS library for a walkthrough or onboarding flow with tap actions written with SwiftUI

 

   SPM Cocoapods License: MIT

Usage


  1. Create View‘s descendant class for your pages.
  2. Create at least two pages and fill them with content.
  3. Create an array of tuple – (page, background color).
  4. Create ConcentricOnboardingView and place it in your view hierarchy.

     

struct ContentView: View {
var body: some View {
return ConcentricOnboardingView(pageContents: [<your_page>, <your_background_color>])
}
}

  1. Pass duration as an argument if you want animation to be faster/slower

ConcentricOnboardingView(pageContents: [<your_page>, <your_background_color>])
.(duration: 2.0)

  1. Pass icon name as an argument if you want to change default icon on the button

ConcentricOnboardingView(pageContents: [<your_page>, <your_background_color>])
.(nextIcon: “chevron.forward”)

Public interface

goToNextPage(animated: Bool = true) – call this method manually if you need to
goToPreviousPage(animated: Bool = true) – call this method manually if you need to

Assignable closures

.animationWillBegin – called before animation starts
.animationDidEnd – called after animation ends
.didGoToLastPage – called after animation leading to last page ends
.didChangeCurrentPage – called after page changes
.insteadOfCyclingToFirstPage – replaces default navigation to first page after pressing next on last page
.insteadOfCyclingToLastPage – replaces default navigation to last page after pressing prev on first page while navigating backwards
.didPressNextButton – replaces default button action with user’s custom closure

Examples


To try the ConcentricOnboarding examples:

  • Clone the repo https://github.com/exyte/ConcentricOnboarding.git
  • Open ConcentricOnboardingExample.xcodeproj in the Xcode
  • Try it!

Installation


Swift Package Manager

dependencies: [
.package(url: “https://github.com/exyte/ConcentricOnboarding.git”)
]

Requirements


iOS 14+

Xcode 12+

Acknowledgements


Many thanks to Cuberto team for the design idea and inspiration.

GitHub


View Github

YOU MIGHT ALSO LIKE...
How to take action when a property changes

1. Taking Action When a Property Changes: Property Observers Swift lets you observe and respond to changes in a property’s ...

How to create your own structs? How to compute property values dynamically?

1. Creating Your Own Structs In Swift, a struct is a value type that you define with the struct keyword. ...

How to use trailing closures and shorthand syntax?

1. Trailing Closure Syntax When the last parameter to a function is a closure, you can write that closure after ...

How to create and use closures?

1. What Is a Closure (and Why Swift Loves Them) A closure in Swift is a self-contained block of functionality ...

How to provide default values for parameters How to handle errors in functions

1. Providing Default Values for Function Parameters (Deep Dive) 1.1 Syntax and Ordering Declaration You assign a default right in ...