среда, 2 октября 2019 г.

MSVTextFieldPod #iOS #Swift UITextField with closures http://msv-main.blogspot.com/2019/10/msvtextfieldpod.html




MSVTextFieldPod is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MSVTextFieldPod'

Author

Serge Moskalenko, https://github.com/sergemoskalenko

License

MSVTextFieldPod is available under the MIT license. See the LICENSE file for more info.

MSVTextFieldPod

MSVTextFieldPod

CI Status Version License Platform

Example

img

To run the example project, clone the repo, and run pod install from the Example directory first.

There is simple task: How to make UITextfield highlight when tapped? (On focus)

simpleTextField.onFocus { textField, isBegin in     textField.backgroundColor = isBegin ? UIColor.yellow : UIColor.lightGray  }

How to check input and highlight?

simpleTextField.onFocus { textField, isBegin in     textField.backgroundColor = isBegin ? UIColor.yellow : UIColor.lightGray  }.onChange { _, string in     return string.count < 10 // check for 10 symbols max  }

Requirements

Installation

MSVTextFieldPod is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MSVTextFieldPod'

Author

Serge Moskalenko, https://github.com/sergemoskalenko

License

MSVTextFieldPod is available under the MIT license. See the LICENSE file for more info.

Related Posts Plugin for WordPress, Blogger...