Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

send editingChanged action when editing #99

Merged
merged 1 commit into from Jul 17, 2018
Merged

send editingChanged action when editing #99

merged 1 commit into from Jul 17, 2018

Conversation

herre
Copy link
Contributor

@herre herre commented Apr 10, 2018

In order to be able to bind the text value of the AnimatedTextInput (eg when using RxSwift), the .editingChanged control event needs to be sent when the text is changed.

@@ -531,6 +531,7 @@ extension AnimatedTextInput: TextInputDelegate {

open func textInputDidChange(textInput: TextInput) {
updateCounter()
sendActions(for: .editingChanged)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand... what is sendActions(for: ) ? Is this an extension?
Please provide an implementation for this method, otherwise, the project won't compile.

Copy link
Contributor Author

@herre herre May 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're subclassing UIControl, it is good practice to send out appropriate UIControlEvents, eg in this case when text changes occur (cfr https://developer.apple.com/documentation/uikit/uicontrol).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @herre 👍

Copy link
Contributor

@victorBaro victorBaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition. Thank you

@@ -531,6 +531,7 @@ extension AnimatedTextInput: TextInputDelegate {

open func textInputDidChange(textInput: TextInput) {
updateCounter()
sendActions(for: .editingChanged)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @herre 👍

@victorBaro victorBaro merged commit 95e740e into jobandtalent:master Jul 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants