Skip to content

JamesSedlacek/LocalAuthenticationKit

Repository files navigation

LocalAuthenticationKit

Swift Package Manager GitHub stars GitHub forks GitHub contributors Pull Requests Badge Issues Badge

Description

LocalAuthenticationKit is a SwiftUI library for handling local authentication.


Requirements

  • iOS: 17.0 or later.
  • macOS: 14.0 or later.

Installation

You can install LocalAuthenticationKit 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/LocalAuthenticationKit.git
  1. Xcode will fetch the repository & the "LocalAuthenticationKit" library will be added to your project.

Usage

  1. Add .authenticateIfEnabled() to the root view in your project.
import LocalAuthenticationKit
import SwiftUI

@main
struct ExampleApp: App {
    var body: some Scene {
        ContentView()
            .authenticateIfEnabled()
    }
}

  1. Use a LocalAuthToggle() in the settings screen in your project.
import LocalAuthenticationKit
import SwiftUI

struct SettingsView {
    var body: some View {
        VStack {
            LocalAuthToggle()
        }
    }
}

Author

James Sedlacek, find me on X/Twitter or LinkedIn

About

SwiftUI library for handling local authentication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages