Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gluonfield/swiftui-onboarding-slider
Onboarding/slider in SwiftUI
https://github.com/gluonfield/swiftui-onboarding-slider
Last synced: 4 days ago
JSON representation
Onboarding/slider in SwiftUI
- Host: GitHub
- URL: https://github.com/gluonfield/swiftui-onboarding-slider
- Owner: gluonfield
- License: mit
- Created: 2020-07-06T07:54:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T08:03:19.000Z (about 3 years ago)
- Last Synced: 2025-01-01T10:38:40.075Z (6 days ago)
- Language: Swift
- Size: 3.49 MB
- Stars: 82
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftUI Onboarding
## About
Onboarding/slider with swiping gesture written entirely in SwiftUI.## Demo
Video is worth a thousand words![Image of Yaktocat](./static/onboarding.gif)
## Instructions
Update `OnboardingDataModel.swift` with your data, each entry in the array will add new onboarding screen.```swift
extension OnboardingDataModel {
static var data: [OnboardingDataModel] = [
OnboardingDataModel(image: "onboarding-relax", heading: "Welcome to App", text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
OnboardingDataModel(image: "onboarding-lookingatart", heading: "Explore the World", text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
OnboardingDataModel(image: "onboarding-sharing1", heading: "Live Life Baby", text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
OnboardingDataModel(image: "onboarding-security1", heading: "Work Hard", text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
OnboardingDataModel(image: "onboarding-showclients", heading: "Stay Careless", text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."),
]
}
```## Tricks
For hooking into `Done` button click I have implemented escaping closure.```swift
OnboardingViewPure(data: data, doneFunction: {
/// Update your state here
self.onboardinDone = true
print("done onboarding")
})
```