说明: SwiftUI library for handling onboarding, stars:154, update:2024-04-25 21:01:12
# OnboardingKit
[![Swift Package Manager](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![GitHub stars](https://img.shields.io/github/stars/JamesSedlacek/OnboardingKit.svg)](https://github.com/JamesSedlacek/OnboardingKit/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/JamesSedlacek/OnboardingKit.svg?color=blue)](https://github.com/JamesSedlacek/OnboardingKit/network)
[![GitHub contributors](https://img.shields.io/github/contributors/JamesSedlacek/OnboardingKit.svg?color=blue)](https://github.com/JamesSedlacek/OnboardingKit/network)
## Description
`OnboardingKit` is a SwiftUI library for handling onboarding.
## Requirements
- **iOS**: 17.0 or later.
- **macOS**: 14.0 or later.
## Installation
You can install `OnboardingKit` using the Swift Package Manager.
1. In Xcode, select "File" > "Add Package Dependencies".
2. Copy & paste the following into the "Search or Enter Package URL" search bar.
```
https://github.com/JamesSedlacek/OnboardingKit.git
```
4. Xcode will fetch the repository & the "OnboardingKit" library will be added to your project.
## Usage
1. Create an `Onboarding Configuration`.
```swift
import OnboardingKit
import SwiftUI
extension OnboardingConfiguration {
static let prod = Self.init(privacyUrlString: "",
accentColor: .green,
features: [])
}
```
2. Add `.showOnboardingIfNeeded()` to the root view in your project.
```swift
import OnboardingKit
import SwiftUI
@main
struct ExampleApp: App {
var body: some Scene {
ContentView()
.showOnboardingIfNeeded(using: .prod)
}
}
```
## Author
James Sedlacek, find me on [X/Twitter](https://twitter.com/jsedlacekjr) or [LinkedIn](https://www.linkedin.com/in/jamessedlacekjr/)