{"id":18027714,"url":"https://github.com/divadretlaw/passcodekit","last_synced_at":"2025-03-27T02:30:59.073Z","repository":{"id":188017563,"uuid":"677971004","full_name":"divadretlaw/PasscodeKit","owner":"divadretlaw","description":"🔐 Easily add a passcode to your iOS app","archived":false,"fork":false,"pushed_at":"2024-04-14T11:10:29.000Z","size":208,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-03T07:32:00.534Z","etag":null,"topics":["passcode","passcode-authentication","passcodelock","swift","swiftui","ui-components"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/divadretlaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-08-13T08:58:04.000Z","updated_at":"2024-05-26T17:36:18.000Z","dependencies_parsed_at":"2023-09-24T10:14:07.643Z","dependency_job_id":"d91bf551-2941-4ebd-855e-9a8695fc6219","html_url":"https://github.com/divadretlaw/PasscodeKit","commit_stats":null,"previous_names":["divadretlaw/passcodekit"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divadretlaw%2FPasscodeKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divadretlaw%2FPasscodeKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divadretlaw%2FPasscodeKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divadretlaw%2FPasscodeKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divadretlaw","download_url":"https://codeload.github.com/divadretlaw/PasscodeKit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222183038,"owners_count":16944872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["passcode","passcode-authentication","passcodelock","swift","swiftui","ui-components"],"created_at":"2024-10-30T08:12:20.299Z","updated_at":"2024-10-30T08:12:20.777Z","avatar_url":"https://github.com/divadretlaw.png","language":"Swift","readme":"# PasscodeKit\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fdivadretlaw%2FPasscodeKit%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/divadretlaw/PasscodeKit)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fdivadretlaw%2FPasscodeKit%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/divadretlaw/PasscodeKit)\n\nEasily add a passcode to your iOS app\n\n## Usage\n\nPasscodeKit is split into two modules and depending on what you need you can use the main or core module.\n\n### PasscodeKit\n\n\u003cimg width=\"200\" alt=\"Screenshot\" src=\"https://github.com/divadretlaw/PasscodeKit/assets/6899256/f9328b38-7b17-42b0-ab4b-3e07dad4f1d6\"\u003e\n\nThe default module, with UI and handling already setup. Simply add `.passcode(title:hint:)`, with an optional title and hint view, to your root view.\n\n```swift\n@main\nstruct MyApp: App {\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n                .passcode(\"Enter Passcode\") {\n                    // Optional view as a hint above the code view\n                }\n        }\n    }\n}\n```\n\nThe passcode has to be setup by the user in order to be used, you can add this modifier to any view to start the setup.\n\n```swift\n.setupPasscode(isPresented: $setupPasscode, type: .numeric(6))\n```\n\nTo remove the passcode again, use the environment variables to access the . You can also set the manager environment variable to override the used Keychain instance and key where the key that is used to store the data.\n\n```swift\n@Environment(\\.passcode.manager) private var passcodeManager\n```\n\nThen simply remove the entry for the passcode\n\n```swift\npasscodeManager.delete()\n```\n\n### PasscodeCore\n\nThe core module, that handles displaying the passcode window. By default it has no UI to enter a passcode or setting up and storing the passcode, but you can use this as a base to implement your own UI.\n\n```swift\n.passcode(mode: PasscodeMode) { dismiss in\n    // some Passcode input UI, call `dismiss(animated:)` once finished\n} background: {\n    // some optional background view\n}\n```\n\n#### Localization\n\nCustomize / Localize the `PasscodeKit` by providing a `Passcode.strings` file in your main app bundle. See the default [Passcode.strings](Sources/PasscodeKit/Resources/Passcode.strings) file for English Strings.\n\n## Installation\n\n### Xcode\n\nAdd the following package URL to Xcode\n\n```\nhttps://github.com/divadretlaw/PasscodeKit\n```\n\nSelect the module you need\n\n![Xcode](https://github.com/divadretlaw/PasscodeKit/assets/6899256/081ca701-deb1-4230-9e8e-25d9fe24e803)\n\n### Swift Package Manager\n\n```swift\nlet package = Package(\n    dependencies: [\n        .package(url: \"https://github.com/divadretlaw/PasscodeKit.git\", from: \"0.7.0\")\n    ],\n    targets: [\n        .target(\n            name: \u003c#Target Name#\u003e,\n            dependencies: [\n                .product(name: \"PasscodeKit\", package: \"PasscodeKit\")\n            ]\n        )\n    ]\n)\n```\n\n## License\n\nSee [LICENSE](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivadretlaw%2Fpasscodekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivadretlaw%2Fpasscodekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivadretlaw%2Fpasscodekit/lists"}