TextFieldWrapper 0.1.0

TextFieldWrapper 0.1.0

测试已测试
语言语言 SwiftSwift
许可协议 MIT
发布最后发布2017年8月
SwiftSwift 版本3.0
SPM支持 SPM

S.M.Moinuddin 维护。



  • S.M.Moinuddin

TextFieldWrapper

您能做什么?

- 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 目录运行 pod install

import TextFieldWrapper

实现缩放(放大/缩小)

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

实现字符更改事件

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

防止修剪并检查验证

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

摇动动画可以通过三种方式访问

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

运行示例项目,您将有一个清晰的思路。

要求

iOS 9
Swift 3
Xcode 8

安装

TextFieldWrapper 通过 CocoaPods 提供。要安装它,只需在 Podfile 中添加以下行:

pod "TextFieldWrapper"

作者

S.M.Moinuddin, [email protected]

许可协议

TextFieldWrapper 在 MIT 许可协议下可用。有关更多信息,请参阅 LICENSE 文件。