Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kpavankotesh committed Dec 1, 2017
2 parents 0c56693 + a1b92c1 commit 3f46509
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- KWVerificationCodeView (0.1.1)
- KWVerificationCodeView (0.1.2)

DEPENDENCIES:
- KWVerificationCodeView (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: ../

SPEC CHECKSUMS:
KWVerificationCodeView: bb32279b41a4535223f039ce49ca33246bf60a18
KWVerificationCodeView: ec9b461e41b54eba269eb02c91ba67aad51a77e3

PODFILE CHECKSUM: c5456285278196ae1d72df7acbfd1db2fab11376

Expand Down
2 changes: 1 addition & 1 deletion KWVerificationCodeView.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'KWVerificationCodeView'
s.version = '0.1.1'
s.version = '0.1.2'
s.summary = 'A verification code view with validation.'
s.description = 'A customisable verification code view with built in validation. Can be used for one time passwords (OTPs), email verification codes etc.'
s.homepage = 'https://github.com/keepworks/kwverificationcodeview'
Expand Down
4 changes: 4 additions & 0 deletions KWVerificationCodeView/Classes/KWTextFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ protocol KWTextFieldDelegate: class {
private var keyboardAppearance = UIKeyboardAppearance.default
weak var delegate: KWTextFieldDelegate?

var code: String? {
return numberTextField.text
}

// MARK: - Lifecycle
override init(frame: CGRect) {
super.init(frame: frame)
Expand Down
16 changes: 13 additions & 3 deletions KWVerificationCodeView/Classes/KWVerificationCodeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,16 @@ public protocol KWVerificationCodeViewDelegate: class {
}
}
}
// MARK: - IBOutlets
@IBOutlet var view: UIView!

// MARK: - Variables
public var isTappable: Bool = false {
didSet {
view.isUserInteractionEnabled = isTappable
}
}

fileprivate var textFieldViews = [KWTextFieldView]()
private var keyboardAppearance = UIKeyboardAppearance.default
private var textFieldFont = UIFont.systemFont(ofSize: 24.0)
Expand Down Expand Up @@ -198,9 +206,11 @@ extension KWVerificationCodeView: KWTextFieldDelegate {
return
}

let validIndex = textFieldViews.index(of: textFieldView)! == 0 ? 0 : textFieldViews.index(of: textFieldView)! - 1
textFieldViews[validIndex].activate()
textFieldViews[validIndex].reset()
if textFieldView.code == " " {
let validIndex = textFieldViews.index(of: textFieldView)! == 0 ? 0 : textFieldViews.index(of: textFieldView)! - 1
textFieldViews[validIndex].activate()
textFieldViews[validIndex].reset()
}
}

func didChangeCharacters() {
Expand Down
6 changes: 5 additions & 1 deletion KWVerificationCodeView/Classes/KWVerificationCodeView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWVerificationCodeView" customModule="KWVerificationCodeView" customModuleProvider="target"/>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KWVerificationCodeView" customModule="KWVerificationCodeView" customModuleProvider="target">
<connections>
<outlet property="view" destination="DUS-Hj-ChZ" id="Kvn-eL-Ma1"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DUS-Hj-ChZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="62"/>
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ The properties which can be directly set in the *Attributes Inspector* and their

- `Dark Keyboard` - Default Keyboard Appearance

### Variables

The `KWVerificationCodeView` has the following variables:

isTappable: Bool

Makes the KWVerficationCodeView tappable. Default value is `false`

### Methods

The `KWVerificationCodeView` has the following methods:
Expand Down

0 comments on commit 3f46509

Please sign in to comment.