Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pvn/PKSecurePin
Browse files Browse the repository at this point in the history
  • Loading branch information
pvn committed Sep 8, 2018
2 parents 401c8d7 + 75f6fec commit e597399
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# PKSecurePin
Elegant Secure PIN with 4 digits in Swift

[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat
)](https://developer.apple.com/iphone/index.action)
[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat
)](https://developer.apple.com/swift)
[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat
)](http://mit-license.org)

**Feature:**
* Ease to use
* 4 digit pin input with confirm pin input
Expand All @@ -9,3 +16,34 @@ Elegant Secure PIN with 4 digits in Swift
* Auto jump to immediate next input on every insertion
* Auto jump to immediate previous input on every deletion
* Disallow to chose any input manually

<img src="./demo.gif" width="200" alt="Screenshot" />

# Usage
```swift

// create an instance of PKSecurePinViewController
let pinViewC = PKSecurePinViewController.init()

// create the navigation controller
let pinNav = UINavigationController(rootViewController: pinViewC)
pinNav.modalPresentationStyle = .popover

//pinview controller position
pinViewC.preferredContentSize = CGSize(width: 500, height: 200)

// create an instance for popover
let popover = pinNav.popoverPresentationController
popover?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
popover?.sourceView = self.view

//popover position
popover?.sourceRect = CGRect(x: UIScreen.main.bounds.width * 0.5 - 200,
y: UIScreen.main.bounds.height * 0.5 - 100,
width: 400, height: 200)

//present the navigation controller
self.present(pinNav, animated: true, completion: nil)



0 comments on commit e597399

Please sign in to comment.