-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPasscodeConfiguration.swift
More file actions
70 lines (62 loc) · 2.15 KB
/
Copy pathPasscodeConfiguration.swift
File metadata and controls
70 lines (62 loc) · 2.15 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// PasscodeConfiguration.swift
// SimplePasscodeView
//
// Copyright © 2018 Geeko Coco. All rights reserved.
//
import UIKit
// Pin Appreance Defaults
private var font = UIFont.systemFont(ofSize: 22)
private var fontColor = UIColor.black
private var borderColor = UIColor.lightGray.cgColor
private var fillColor = UIColor.lightGray
public protocol PinViewConfigurable {
var pinfont: UIFont {get set}
var pinfontColor: UIColor {get set}
var pinborderColor: CGColor {get set}
var pinfillColor: UIColor {get set}
}
public extension PinViewConfigurable {
var pinfont: UIFont {
get {return font}
set {font = newValue}}
var pinfontColor: UIColor {
get {return fontColor}
set {fontColor = newValue}}
var pinborderColor: CGColor {
get {return borderColor}
set {borderColor = newValue}}
var pinfillColor: UIColor {
get {return fillColor}
set {fillColor = newValue}}
}
// Passcode Appreance Defaults
private var passcodeLength = 6
private var passcodeIsSecureEntry = true
private var passcodeDefaultSpacing: Float = 5
private var passcodeCustomSpacingPosition = -1
private var passcodeCustomSpacing = 20
public protocol PasscodeConfigurable: PinViewConfigurable {
var length: Int {get set}
var isSecureEntry: Bool {get set}
var defaultSpacing: Float {get set}
var customSpacingPosition: Int {get set}
var customSpacing: Int {get set}
}
public extension PasscodeConfigurable {
var length: Int {
get {return passcodeLength}
set {passcodeLength = newValue}}
var isSecureEntry: Bool {
get {return passcodeIsSecureEntry}
set {passcodeIsSecureEntry = newValue}}
var defaultSpacing: Float {
get {return passcodeDefaultSpacing}
set {passcodeDefaultSpacing = newValue}}
var customSpacingPosition: Int {
get {return passcodeCustomSpacingPosition}
set {passcodeCustomSpacingPosition = newValue}}
var customSpacing: Int {
get {return passcodeCustomSpacing}
set {passcodeCustomSpacing = newValue}}
}