Simplify your app's onboarding process with a collection of ready-to-use SwiftUI components. OnboardingKit offers a seamless way to introduce your users to your app.
OnboardingKit is available as a Swift Package. You can easily add it to your project with Xcode:
- Open your project in Xcode
- Select File > Swift Packages > Add Package Dependency...
- Enter the package repository URL: https://github.com/BortoAle/OnboardingKit
- Follow the prompts to choose the package options and add the package to your project.
For more detailed instructions on using Swift Package Manager, refer to the Swift Package Manager documentation.
OnboardingRow
allows you to create individual onboarding steps with an icon, title, and description. Each row represents a single step or concept in your onboarding flow.
OnboardingRow(image: Image(systemName: "star.fill"), title: "Feature Highlight", description: "Discover the amazing features of our app.")
Present a full onboarding experience as a welcome sheet from any view, using the .welcomeSheet
modifier. This method allows for a seamless introduction to your app for first-time users.
@AppStorage("isOnboardingShown") var isOnboardingShown: Bool = false
let onboardingRows = [
OnboardingRow(image: Image(systemName: "hand.wave.fill"), title: "Welcome", description: "Get a warm welcome to our app."),
OnboardingRow(image: Image(systemName: "lightbulb.fill"), title: "Discover", description: "Learn about unique features."),
OnboardingRow(image: Image(systemName: "paintbrush.fill"), title: "Customize", description: "Make the app yours with easy customization.")
]
var body: some View {
YourMainView()
.welcomeSheet(isPresented: $isOnboardingShown, onDismiss: {
isOnboardingShown = false
}, rows: onboardingRows, title: "Welcome to Our App", onConfirm: {
isOnboardingShown = false
})
}