Swiftpack.co - danielsaidi/OnboardingKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by danielsaidi.
danielsaidi/OnboardingKit 7.0.0
OnboardingKit is a Swift SDK that helps you create onboarding experiences in Swift and SwiftUI.
⭐️ 476
🕓 4 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/danielsaidi/OnboardingKit.git", from: "7.0.0")

OnboardingKit Logo

Version Swift 5.9 Swift UI MIT License Twitter: @danielsaidi Mastodon: @danielsaidi@mastodon.social

About OnboardingKit

OnboardingKit is a Swift SDK that helps you create onboarding experiences in Swift and SwiftUI.

OnboardingKit has different onboarding types. Standard onboardings are shown right away, and only once, while other types can require multiple presentation attempts, a certain number of "incorrect" actions, etc.

Installation

OnboardingKit can be installed with the Swift Package Manager:

https://github.com/danielsaidi/OnboardingKit.git

Getting started

In OnboardingKit, an Onboarding determines the state and behavior of an onboarding experience. You can use various onboarding types to get different behaviors.

The code below shows how to use a standard onboarding to present a first launch onboarding sheet:

import OnboardingKit
import SwiftUI

struct ContentView: View {

    @State
    private var isOnboardingPresented: Bool
    
    private let onboarding = Onboarding(id: "welcome") 

    var body: some View {
        Text("Hello, world")
            .task(tryPresentOnboarding)
            .sheet(isPresented: $isOnboardingPresented) {
                ...
            }
    }
    
    func tryPresentOnboarding() {
        onboarding.tryPresent { 
            isOnboardingPresented = true
        }
    }
}

The onboarding will honor its own rules and remember any previous presentation, so tryPresent will only trigger when it makes sense for the onboarding.

For more information, please see the getting started guide.

Documentation

The online documentation has more information, articles, code examples, etc.

Demo Application

The demo app lets you explore the library. To try it out, just open and run the Demo project.

Support my work

You can sponsor me on GitHub Sponsors or reach out for paid support, to help support my open-source projects.

Your support makes it possible for me to put more work into these projects and make them the best they can be.

Contact

Feel free to reach out if you have questions or if you want to contribute in any way:

License

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

GitHub

link
Stars: 476
Last commit: 4 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4 weeks ago

This version drastically simplifies the library and bumps the platform deployment targets to more modern platform versions.

Please see the docs and the demo for updated examples.

💡 Behavior changes

  • Onboarding and its subclasses have been simplified.
  • Onboarding is now based on tryPresent regardless of which class you use.

💥 Breaking changes

  • All deprecated code has been removed.
  • Hint has been removed.
  • Onboarding no longer has a userId property.
  • Onboarding no longer has a hasBeenPresented property.
  • Onboarding no longer has a registerPresentation function.
  • OnboardingPageView now takes page values instead of a tutorial.
  • Tutorial has been removed and replaced with new onboarding views.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics