Swiftpack.co - Hengyu/Onboarding as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Hengyu.
Hengyu/Onboarding 5.0.0
A fluent user-interface for app onboarding experience
⭐️ 0
🕓 18 weeks ago
iOS macOS tvOS macCatalyst
.package(url: "https://github.com/Hengyu/Onboarding.git", from: "5.0.0")

Onboarding

Onboarding provides a fluent user-interface for app onboarding experience.

Table of contents

Requirements

  • Swift 5.9
  • For UIKit. iOS 13.0+, macCatalyst 13.0+, tvOS 13.0+, visionOS 1.0+
  • For SwiftUI. iOS 15.0+, macOS 12.0+, tvOS 15.0+, visionOS 1.0+

Installation

Manual

Download the .zip from this repo and drag the /Sources/Onboarding folder into your project.

Swift Package Manager

Onboarding could be installed via Swift Package Manager. Open Xcode and go to File -> Add Packages..., search https://github.com/hengyu/Onboarding.git, and add the package as one of your project's dependency.

Usage

Onboarding is super easy to get started with.

Simply follow the usage in the example file.

import Onboarding

// 1. Prepare a set of tips items
let items: [TipsItem] = [
    .init(title: "Intro", content: "This is the summary of the app", image: UIImage(named: "intro"))
]

// 2. Create a help page using the tips items
let helpPage: HelpPageViewController = .init(items: items)

// 3. Present the help page
presentingViewController.present(helpPage, animated: true)

We also provide HelpView for buiding onboarding page in SwiftUI:

import Onboarding

public struct SettingsView: View {
    @State var presentsOnboarding: Bool = false
    let items: [TipsItem] = [
        .init(title: "Intro", content: "This is the summary of the app", image: UIImage(named: "intro"))
    ]

    public var body: some View {
        VStack {
            Button {
                presentsOnboarding = true
            } label: {
                Text("Show onboarding")
            }
        }
        .sheet(isPresented: $presentsOnboarding) {
            HelpView(items: items)
        }
    }
}

License

Onboarding is released under the MIT License.

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