CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

TextFieldWrapper 0.1.0

TextFieldWrapper 0.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Aug 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by S.M.Moinuddin.



  • By
  • S.M.Moinuddin

TextFieldWrapper

What you can do?

- change font and color of placeholder
- limit textField input
- shake animation
- zoom in/out focus animation 
- character range validation
- Hoshi Effect with above feature
- closure callback of character change in textField
- closure callback of textFieldDidBeginEditing
- closure callback of textFieldDidEndEditing
- all other default features of UITextField!!!

Example

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

import TextFieldWrapper

implement zoom in/out:

yourTextField.zoomScale = 1.4 // some value > 1 for zoomIn effect.
yourTextField.addBlurToView = self.view // In which view you want to add transparent blur effect.

implement character changed event:

yourTextField.maxCharacter = 15
yourTextField.characterChangedEvent = { [weak self] (str, num) in
    // your implementation
}

Prevent Trimming and check validation

yourTextField.maxCharacter = 15
yourTextField.shouldTrim = false
yourTextField.characterChangedEvent = { [weak self] (str, num) in
// your implementation
}
let flag = yourTextField.isValid

shake animation can be accessed in 3 ways:

yourTextField.shake()
yourTextField.shake(borderColor: .red, borderWidth: 2.0)
yourTextField.shake(borderColor: .red, borderWidth: 4, completion: { 
[weak self] in
//your implementation
})

run the Example project, you will have a clean idea.

Requirements

iOS 9
Swift 3
Xcode 8

Installation

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

pod "TextFieldWrapper"

Author

S.M.Moinuddin, [email protected]

License

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