Custom UITextField using @IBDesignable with Swift 3 SPTextField

A beautiful and animating text field. Written in Swift. Underlined UITextField.


  1. Create UITextField in your storyboard or programmatically.
  2. Set SPTextField as UITextField class.
  3. 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
  1. Useful methods for Calling Alert Animation
  • Create Outlet
@IBOutlet var newText: SPLoginTextField!
  • Call method for animation

Download Source Code.

SPTextField on Simulator

This project is maintained by Pranavan

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!
UITextField 3474391221474061009

Post a Comment Default Comments Disqus Comments


Home item

Popular Posts

Random Posts