BorderLabelTextField
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.
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.
- Drag an UITextField into your Storyboard
- Set 'Custom Class' property field to this class called 'BorderLabelTextField'
- In the TextField properties, set the Border style to any other than the preselected one as it displays an unwanted border around the TextField
- 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, [email protected]
License
BorderLabelTextField is available under the MIT license. See the LICENSE file for more info.
