-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathViewController.swift
More file actions
43 lines (35 loc) · 1.23 KB
/
Copy pathViewController.swift
File metadata and controls
43 lines (35 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// ViewController.swift
// SimplePasscodeView
//
// Copyright © 2018 Geeko Coco. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var passcodeView: SimplePasscodeView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//Extra documentation
//More Extra documentation
passcodeView.delegate = self
passcodeView.isSecureEntry = true
passcodeView.length = 5
passcodeView.keyboardType = .numberPad
passcodeView.pinborderColor = UIColor.blue.cgColor
passcodeView.pinfillColor = UIColor.lightGray
}
}
extension ViewController: SimplePasscodeDelegate {
func didDeleteBackward() {
//Do whatever you want
}
func didFinishEntering(_ passcode: String) {
//Do whatever you want
print("passcode: \(passcode)")
let alert = UIAlertController(title: "Passcode", message: passcode, preferredStyle: .alert)
let alertAction = UIAlertAction(title: "Ok", style: .cancel, handler: nil)
alert.addAction(alertAction)
present(alert, animated: true, completion: nil)
}
}