From 1570ce331d1eb29a4231e2ba0a8c6edc2d5f31df Mon Sep 17 00:00:00 2001 From: Madhas Date: Wed, 18 Jul 2018 18:32:35 +0300 Subject: [PATCH] add methods to BasePassCodeViewController to make fakeTextField become and resign first responder --- CHANGELOG.md | 4 ++++ LeadKitAdditions.podspec | 2 +- .../PassCode/View/BasePassCodeViewController.swift | 12 ++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1c7870..7e28105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 0.3.2 + +- **Add**: functions to `BasePassCodeViewController` to make `fakeTextField` become and resign first responder + ### 0.3.1 - **Add**: `PinLayoutTableViewCell` and `SeparatorTableViewCell` to `Core-iOS-Extension`. diff --git a/LeadKitAdditions.podspec b/LeadKitAdditions.podspec index 8632cfe..464da23 100644 --- a/LeadKitAdditions.podspec +++ b/LeadKitAdditions.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKitAdditions" - s.version = "0.3.1" + s.version = "0.3.2" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKitAdditions" s.license = "Apache License, Version 2.0" diff --git a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift index a24be3a..a711480 100644 --- a/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift +++ b/Sources/Controllers/PassCode/View/BasePassCodeViewController.swift @@ -239,6 +239,18 @@ open class BasePassCodeViewController: UIViewController, ConfigurableController titleLabel?.attributedText = actionTitle(for: passCodeControllerState) } + // MARK: - Public functions + + /// Make fakeTextField become first responder + public func enableInput() { + fakeTextField.becomeFirstResponder() + } + + /// Make fakeTextField resign first responder + public func disableInput() { + fakeTextField.resignFirstResponder() + } + // MARK: - ConfigurableController open func bindViews() {