A clean toolkit for onboarding (iOS & macOS)
MIT License
A clean toolkit for onboarding (iOS & macOS)
To integrate OnboardKit into your Xcode project using Swift Package Manager, add the following as a dependency to your Package.swift
:
.package(url: "https://github.com/sentryco/OnboardKit", branch: "main")
Here is a basic example of how to set up OnboardKit in your SwiftUI application:
import SwiftUI
import OnboardKit
@main
struct MyAppIOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
struct ContentView: View {
@State var needsOnboarding: Bool = true
var body: some View {
OnboardContainer(needsOnboarding: $needsOnboarding) { (_ needsOnboarding: Binding<Bool>) in
OnboardView(
pageModels: OnboardModel.dummyModels, // point to your own onboarding models here
onComplete: {
needsOnboarding.wrappedValue = false
}
)
} background: {
ZStack {
Rectangle() // this is where the app main view goes
.fill(Color.init(light: Color.lightGray.lighter(amount: 0.8), dark: Color.darkGray.darker(amount: 0.8))) // light or dark mode
Text("Your app goes here")
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.edgesIgnoringSafeArea(.all)
}
}
}
OnboardKit utilizes several dependencies to enhance its functionality.
Contributions are welcome! Please fork the repository and submit pull requests with any new features or fixes.
OnboardKit is released under the MIT License. See LICENSE for details.