Skip to content

Commit 3f46509

Browse files
committed
Resolve conflicts
2 parents 0c56693 + a1b92c1 commit 3f46509

6 files changed

Lines changed: 33 additions & 7 deletions

File tree

Example/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- KWVerificationCodeView (0.1.1)
2+
- KWVerificationCodeView (0.1.2)
33

44
DEPENDENCIES:
55
- KWVerificationCodeView (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: ../
1010

1111
SPEC CHECKSUMS:
12-
KWVerificationCodeView: bb32279b41a4535223f039ce49ca33246bf60a18
12+
KWVerificationCodeView: ec9b461e41b54eba269eb02c91ba67aad51a77e3
1313

1414
PODFILE CHECKSUM: c5456285278196ae1d72df7acbfd1db2fab11376
1515

KWVerificationCodeView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::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'

KWVerificationCodeView/Classes/KWTextFieldView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

KWVerificationCodeView/Classes/KWVerificationCodeView.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff 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() {

KWVerificationCodeView/Classes/KWVerificationCodeView.xib

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
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"/>

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

5664
The `KWVerificationCodeView` has the following methods:

0 commit comments

Comments
 (0)