{"id":1925,"url":"https://github.com/yankodimitrov/SwiftPasscodeLock","last_synced_at":"2025-08-02T05:33:11.721Z","repository":{"id":82752480,"uuid":"27310262","full_name":"yankodimitrov/SwiftPasscodeLock","owner":"yankodimitrov","description":"An iOS passcode lock with TouchID authentication written in Swift.","archived":false,"fork":false,"pushed_at":"2020-05-05T05:56:53.000Z","size":5147,"stargazers_count":680,"open_issues_count":47,"forks_count":260,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-24T06:10:50.703Z","etag":null,"topics":[],"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/yankodimitrov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-11-29T17:52:58.000Z","updated_at":"2025-05-18T02:13:56.000Z","dependencies_parsed_at":"2023-03-12T04:00:31.861Z","dependency_job_id":null,"html_url":"https://github.com/yankodimitrov/SwiftPasscodeLock","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yankodimitrov/SwiftPasscodeLock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankodimitrov%2FSwiftPasscodeLock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankodimitrov%2FSwiftPasscodeLock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankodimitrov%2FSwiftPasscodeLock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankodimitrov%2FSwiftPasscodeLock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yankodimitrov","download_url":"https://codeload.github.com/yankodimitrov/SwiftPasscodeLock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yankodimitrov%2FSwiftPasscodeLock/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268339405,"owners_count":24234544,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-01-05T20:15:59.127Z","updated_at":"2025-08-02T05:33:10.997Z","avatar_url":"https://github.com/yankodimitrov.png","language":"Swift","funding_links":[],"categories":["Security","Swift"],"sub_categories":["Unofficial","Other free courses"],"readme":"# PasscodeLock\nA Swift implementation of passcode lock for iOS with TouchID authentication.\n\n\u003cimg src=\"https://raw.githubusercontent.com/yankodimitrov/SwiftPasscodeLock/master/passcode-lock.gif\" height=\"386\"\u003e\n\n## Installation\nPasscodeLock requires Swift 2.0 and Xcode 7\n\n#### Carthage\n\nAdd the following line to your [Cartfile](https://github.com/carthage/carthage)\n```swift\ngithub \"yankodimitrov/SwiftPasscodeLock\"\n```\n## Usage\n\n1. Create an implementation of the `PasscodeRepositoryType` protocol.\n\n2. Create an implementation of the `PasscodeLockConfigurationType` protocol and set your preferred passcode lock configuration options. If you set the `maximumInccorectPasscodeAttempts` to a number greather than zero when the user reaches that number of incorrect passcode attempts a notification with name `PasscodeLockIncorrectPasscodeNotification` will be posted on the default `NSNotificationCenter`. \n\n3. Create an instance of the `PasscodeLockPresenter` class. Next inside your `UIApplicationDelegate` implementation call it to present the passcode in `didFinishLaunchingWithOptions` and `applicationDidEnterBackground` methods. The passcode lock will be presented only if your user has set a passcode.\n\n4. Allow your users to set a passcode by presenting the `PasscodeLockViewController` in `.SetPasscode` state:\n```swift\nlet configuration = ... // your implementation of the PasscodeLockConfigurationType protocol\n\nlet passcodeVC = PasscodeLockViewController(state: .SetPasscode, configuration: configuration)\n\npresentViewController(passcodeVC, animated: true, completion: nil)\n```\n\nYou can present the `PasscodeLockViewController` in one of the four initial states using the `LockState` enumeration options: `.EnterPasscode`, `.SetPasscode`, `.ChangePasscode`, `.RemovePasscode`.\n\nAlso you can set the initial passcode lock state to your own implementation of the `PasscodeLockStateType` protocol.\n\n## Customization\n\n#### Custom Design\n\nThe PasscodeLock will look for `PasscodeLockView.xib` inside your app bundle and if it can't find it will load its default one, so if you want to have a custom design create a new `xib` with the name `PasscodeLockView` and set its owner to an instance of `PasscodeLockViewController` class and module to `PasscodeLock`. \n\nThen connect the `view` outlet to the view of your `xib` file and make sure to connect the remaining `IBOutlet`s and `IBAction`s. Also make sure to set module to `PasscodeLock` on all `PasscodeSignPlaceholderView` and `PasscodeSignButton` in the nib.\n\nPasscodeLock comes with two view components: `PasscodeSignPlaceholderView` and `PasscodeSignButton` that you can use to create your own custom designs. Both classes are `@IBDesignable` and `@IBInspectable`, so you can see their appearance and change their properties right inside the interface builder:\n\n\u003cimg src=\"https://raw.githubusercontent.com/yankodimitrov/SwiftPasscodeLock/master/passcode-view.png\" height=\"270\"\u003e\n\n#### Localization\n\nTake a look at `PasscodeLock/en.lproj/PasscodeLock.strings` for the localization keys. Here again the PasscodeLock will look for the `PasscodeLock.strings` file inside your app bundle and if it can't find it will use the default localization file.\n\n## Demo App\n\nThe demo app comes with a simple implementation of the `PasscodeRepositoryType` protocol that is using the **NSUserDefaults** to store an retrieve the passcode. In your real applications you will probably want to use the **Keychain API**. Keep in mind that the **Keychain** records will not be removed when your user deletes your app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankodimitrov%2FSwiftPasscodeLock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyankodimitrov%2FSwiftPasscodeLock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyankodimitrov%2FSwiftPasscodeLock/lists"}