{"id":20274887,"url":"https://github.com/pvn/pksecurepin","last_synced_at":"2025-04-11T05:23:22.385Z","repository":{"id":62450034,"uuid":"147940600","full_name":"pvn/PKSecurePin","owner":"pvn","description":"Elegant dynamic secure PINs, which may have 'n' inputs based on confguration with or without confirmation PIN using swift code","archived":false,"fork":false,"pushed_at":"2018-09-16T15:34:01.000Z","size":3276,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T18:09:42.695Z","etag":null,"topics":["otp","pin","pinlock","secure-text","swift4","textfield"],"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/pvn.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}},"created_at":"2018-09-08T14:28:24.000Z","updated_at":"2023-03-02T04:15:23.000Z","dependencies_parsed_at":"2022-11-01T23:18:07.510Z","dependency_job_id":null,"html_url":"https://github.com/pvn/PKSecurePin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvn%2FPKSecurePin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvn%2FPKSecurePin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvn%2FPKSecurePin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvn%2FPKSecurePin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvn","download_url":"https://codeload.github.com/pvn/PKSecurePin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248346400,"owners_count":21088451,"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":["otp","pin","pinlock","secure-text","swift4","textfield"],"created_at":"2024-11-14T13:06:51.290Z","updated_at":"2025-04-11T05:23:22.360Z","avatar_url":"https://github.com/pvn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PKSecurePin\nElegant Secure PIN with dynamic inputs digits in Swift\n\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat\n)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat\n)](https://developer.apple.com/swift)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat\n)](http://mit-license.org)\n\n**Feature:**\n* Ease to use\n* Dynamic pins with or without confirmation pin based on configuration\n* Accept only digit as input\n* Restrict to enter 1 digit per input\n* Auto jump to immediate next input on every insertion\n* Auto jump to immediate previous input on every deletion\n* Restrict the input or to select other PIN without entering the digit for current PIN\n\n\u003cimg src=\"./demo.gif\" width=\"200\" alt=\"Screenshot\" /\u003e\n\u003cimg src=\"./iphone_demo.gif\" width=\"200\" alt=\"Screenshot\" /\u003e\n\n# Installation\n### CocoaPods\nIn your `Podfile`:\n```\npod \"PKSecurePin\"\n```\n### Manual\nCopy the entire `PKSecurePin` folder which contains two swift files and add to your project\n```\ncp -rf PKSecurePin/ \u003cto_your_project_dir\u003e\n```\n\n# Usage\n```swift\n            // adopt the protocol\n            class ViewController: UIViewController, UIPopoverPresentationControllerDelegate, PKSecurePinControllerDelegate\n            \n            // create an instance of PKSecurePinViewController, with how many PIN, OTP or confirmation, position from top\n            //NOTE: Please specify the correct value for topPos for the PIN text field w.r.t. to iPad \u0026 iPhone\n            var pinViewC = PKSecurePinViewController.init(numberOfPins: 6, withconfirmation: true, topPos: 230)\n            \n            // PKSecurePinControllerDelegate methods implementation\n            func didFinishSecurePin(pinValue: String) {\n                //show the message if you want to display on success, else comment the below line\n                pinViewC.showMessage(PKSecurePinError(errorString:\"Success\", errorCode: 200, errorIsHidden: false))\n                //Go ahead with the business logic which you want to achieve with the PIN\n            }\n            \n            // set the background color for PIN controller\n            pinViewC.view.backgroundColor = UIColor.white\n            \n            //set the delegate\n            pinViewC.delegate = self\n\n            // create the pin navigation controller\n            let pinNav = UINavigationController(rootViewController: pinViewC)\n\n            // set the presentation style\n            pinNav.modalPresentationStyle = .popover\n\n            //pinview controller position\n            pinViewC.preferredContentSize = CGSize(width: UIScreen.main.bounds.width * 0.5, height: 200)\n\n            // create an instance for popover\n            let popover = pinNav.popoverPresentationController\n            popover?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)\n            popover?.sourceView = self.view\n\n            //popover position\n            popover?.sourceRect = CGRect(x: UIScreen.main.bounds.width * 0.5 - UIScreen.main.bounds.width * 0.25, y: UIScreen.main.bounds.height * 0.5 - 100, width: UIScreen.main.bounds.width * 0.5, height: 200)\n\n            //present the pin navigation controller\n            self.present(pinNav, animated: true, completion: nil)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvn%2Fpksecurepin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvn%2Fpksecurepin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvn%2Fpksecurepin/lists"}