File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
Example/SVPinViewExample.xcworkspace/xcuserdata/srinivasvemuri.xcuserdatad Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 22Pod ::Spec . new do |s |
33
44 s . name = "SVPinView"
5- s . version = "1.0.6 "
5+ s . version = "1.0.7 "
66 s . summary = "SVPinView is a customisable library used for accepting alphanumeric pins or one-time passwords."
77
88 s . homepage = "https://github.com/xornorik/SVPinView"
Original file line number Diff line number Diff line change @@ -86,9 +86,7 @@ public class SVPinView: UIView {
8686 collectionView. register ( collectionViewNib, forCellWithReuseIdentifier: reuseIdentifier)
8787 flowLayout. scrollDirection = . vertical //weird!!!
8888 collectionView. isScrollEnabled = false
89-
90- password = [ String] ( repeating: " " , count: pinLength)
91-
89+
9290 self . addSubview ( view)
9391 view. frame = bounds
9492 view. autoresizingMask = [ UIView . AutoresizingMask. flexibleWidth, UIView . AutoresizingMask. flexibleHeight]
@@ -150,8 +148,12 @@ public class SVPinView: UIView {
150148 // store text
151149 let text = textField. text ?? " "
152150 let passwordIndex = index - 1
153- // delete if space
154- password [ passwordIndex] = text == " " ? " " : text
151+ if password. count > ( passwordIndex) {
152+ // delete if space
153+ password [ passwordIndex] = text == " " ? " " : text
154+ } else {
155+ password. append ( text)
156+ }
155157 validateAndSendCallback ( )
156158 }
157159
@@ -215,7 +217,6 @@ public class SVPinView: UIView {
215217 public func getPin( ) -> String {
216218
217219 guard !isLoading else { return " " }
218- print ( " ~~~~ \( password) " )
219220 guard password. count == pinLength && password. joined ( ) . trimmingCharacters ( in: CharacterSet ( charactersIn: " " ) ) . count == pinLength else {
220221 return " "
221222 }
You can’t perform that action at this time.
0 commit comments