Skip to content

BorderLabelTextField is a subclass of UITextField that adds a label above the input that breaks the border of the UITextField.

License

Notifications You must be signed in to change notification settings

broken-bytes/BorderLabelTextField

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BorderLabelTextField

Swift Version License Platform

BorderLabelTextField is a subclass of UITextField that adds a label above the input that breaks the border of the UITextField.

Example

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

Screenshot

Installation

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

pod 'BorderLabelTextField'

Usage

Using this UITextField subclass is straighforward.

  1. Drag an UITextField into your Storyboard
  2. Set 'Custom Class' property field to this class called 'BorderLabelTextField'
  3. In the TextField properties, set the Border style to any other than the preselected one as it displays an unwanted border around the TextField
  4. Assign Inspectable properties to your desire.

Alternatively, instantiate via code and set the desired properties.

Limitations

Due to the nature of IBInspectable properties, it is possible to set values that break the design of the TextField. This contains things like a label that takes all the space of the TextField, Borders that take up all space etc. While these problems will persists for some time until a reasonable fix is found, it is easy to work around them by testing what your TextField looks like. These Properties are all user defined so a runtime issue with these limitations is very unlikely to occur.

Author

broken-bytes, dev@broken-bytes.io

License

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

About

BorderLabelTextField is a subclass of UITextField that adds a label above the input that breaks the border of the UITextField.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published