Custom UITextField using @IBDesignable with Swift 3 SPTextField
https://bethedev.blogspot.com/2017/12/custom-uitextfield-using-ibdesignable.html
A beautiful and animating text field. Written in Swift. Underlined UITextField.
Usage
- Create
UITextField
in your storyboard or programmatically. - Set
SPTextField
asUITextField
class. - Customization for SPTextField:
- Left Image : Text Field main Icon/Image (Set as template on Assets)
- Right Padding : Spacing between text and icon
- Border Inactive : Text field inactiive underline color
- Border Active : Text field Active underline color
- Alert Image : Right Side Alert Image Icon
- Image Size : Both main and alert image icon sizes
- Useful methods for Calling Alert Animation
- Create Outlet
@IBOutlet var newText: SPLoginTextField!
- Call method for animation
newText.invalidFieldAlert()!
Download Source Code.
SPTextField on Simulator
If this code was helpful, I would love to hear from you or If you have any questions please post your comments below.
Thank you!
This comment has been removed by a blog administrator.
ReplyDelete