File tree Expand file tree Collapse file tree
KWVerificationCodeView/Classes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PODS:
2- - KWVerificationCodeView (0.1.1 )
2+ - KWVerificationCodeView (0.1.2 )
33
44DEPENDENCIES:
55 - KWVerificationCodeView (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99 :path: ../
1010
1111SPEC CHECKSUMS:
12- KWVerificationCodeView: bb32279b41a4535223f039ce49ca33246bf60a18
12+ KWVerificationCodeView: ec9b461e41b54eba269eb02c91ba67aad51a77e3
1313
1414PODFILE CHECKSUM: c5456285278196ae1d72df7acbfd1db2fab11376
1515
Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = 'KWVerificationCodeView'
3- s . version = '0.1.1 '
3+ s . version = '0.1.2 '
44 s . summary = 'A verification code view with validation.'
55 s . description = 'A customisable verification code view with built in validation. Can be used for one time passwords (OTPs), email verification codes etc.'
66 s . homepage = 'https://github.com/keepworks/kwverificationcodeview'
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ protocol KWTextFieldDelegate: class {
7777 private var keyboardAppearance = UIKeyboardAppearance . default
7878 weak var delegate : KWTextFieldDelegate ?
7979
80+ var code : String ? {
81+ return numberTextField. text
82+ }
83+
8084 // MARK: - Lifecycle
8185 override init ( frame: CGRect ) {
8286 super. init ( frame: frame)
Original file line number Diff line number Diff line change @@ -97,8 +97,16 @@ public protocol KWVerificationCodeViewDelegate: class {
9797 }
9898 }
9999 }
100+ // MARK: - IBOutlets
101+ @IBOutlet var view : UIView !
100102
101103 // MARK: - Variables
104+ public var isTappable : Bool = false {
105+ didSet {
106+ view. isUserInteractionEnabled = isTappable
107+ }
108+ }
109+
102110 fileprivate var textFieldViews = [ KWTextFieldView] ( )
103111 private var keyboardAppearance = UIKeyboardAppearance . default
104112 private var textFieldFont = UIFont . systemFont ( ofSize: 24.0 )
@@ -198,9 +206,11 @@ extension KWVerificationCodeView: KWTextFieldDelegate {
198206 return
199207 }
200208
201- let validIndex = textFieldViews. index ( of: textFieldView) ! == 0 ? 0 : textFieldViews. index ( of: textFieldView) ! - 1
202- textFieldViews [ validIndex] . activate ( )
203- textFieldViews [ validIndex] . reset ( )
209+ if textFieldView. code == " " {
210+ let validIndex = textFieldViews. index ( of: textFieldView) ! == 0 ? 0 : textFieldViews. index ( of: textFieldView) ! - 1
211+ textFieldViews [ validIndex] . activate ( )
212+ textFieldViews [ validIndex] . reset ( )
213+ }
204214 }
205215
206216 func didChangeCharacters( ) {
Original file line number Diff line number Diff line change 99 <capability name =" documents saved in the Xcode 8 format" minToolsVersion =" 8.0" />
1010 </dependencies >
1111 <objects >
12- <placeholder placeholderIdentifier =" IBFilesOwner" id =" -1" userLabel =" File's Owner" customClass =" KWVerificationCodeView" customModule =" KWVerificationCodeView" customModuleProvider =" target" />
12+ <placeholder placeholderIdentifier =" IBFilesOwner" id =" -1" userLabel =" File's Owner" customClass =" KWVerificationCodeView" customModule =" KWVerificationCodeView" customModuleProvider =" target" >
13+ <connections >
14+ <outlet property =" view" destination =" DUS-Hj-ChZ" id =" Kvn-eL-Ma1" />
15+ </connections >
16+ </placeholder >
1317 <placeholder placeholderIdentifier =" IBFirstResponder" id =" -2" customClass =" UIResponder" />
1418 <view userInteractionEnabled =" NO" contentMode =" scaleToFill" translatesAutoresizingMaskIntoConstraints =" NO" id =" DUS-Hj-ChZ" >
1519 <rect key =" frame" x =" 0.0" y =" 0.0" width =" 375" height =" 62" />
Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ The properties which can be directly set in the *Attributes Inspector* and their
5151
5252- ` Dark Keyboard ` - Default Keyboard Appearance
5353
54+ ### Variables
55+
56+ The ` KWVerificationCodeView ` has the following variables:
57+
58+ isTappable: Bool
59+
60+ Makes the KWVerficationCodeView tappable. Default value is ` false `
61+
5462### Methods
5563
5664The ` KWVerificationCodeView ` has the following methods:
You can’t perform that action at this time.
0 commit comments