Latest | 1.0.3 |
---|---|
Homepage | https://github.com/forgot/FAFloatLabeledTextInput |
License | MIT |
Platforms | ios 9.0 |
Authors |
Overview
A Swift 4.2 implementation of the UX pattern known as the "Float Label Pattern".
FAFloatLabeledTextInput
includes subclasses for both UITextField
and UITextView
. Additionally, it provides a UITableViewCell
subclass for each thats ready to work out of the box, and the FAFloatLabeledTextViewTableViewCell
is configured to grow as needed to accommodate text.
This design was heavily inspired by @jverdi’s JVFloatLabeledTextField and @aksswami’s FloatLabelFields.
Standard Example
UITableViewCell Example
Usage
Simply use FAFloatLabledTextField
or FAFloatLabledTextView
in place of UITextField
or UITextView
.
The UITableViewCell
subclasses can be used directly in code, or in Interface Builder by setting the prototype cell’s class to either FAFloatLabeledTextFieldTableViewCell
or FAFloatLabeledTextViewTableViewCell
.
let titleField = FAFloatLabelTextField()
titleField.placeholder = "Title"
titleField.placeholderFont = .systemFont(ofSize: 16.0)
titleField.floatingLabelFont = .boldSystemFont(ofSize: 11.0)
let description = FAFloatLabelTextView()
descriptionField.placeholder = "Description"
descriptionField.placeholderFont = .systemFont(ofSize: 16.0)
descriptionField.floatingLabelFont = .boldSystemFont(ofSize: 11.0)
The code is well documented, and there are many options available, so I encourage you to give it a read.
Example Project
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
This component uses Swift 4.2, which means it requires iOS 7 or later.
Installation
FAFloatLabeledTextInput is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'FAFloatLabeledTextInput'
Author
Ideas? Questions? Open an issue, or hit me up on Twitter.
License
FAFloatLabeledTextInput is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "FAFloatLabeledTextInput", "version": "1.0.3", "summary": "Floating Labels For UITextField And UITextView", "description": "Like it says on the box, FAFloatLabeledTextInput contains subclasses for UITextField and UITextView that allow for floating labels.nnAlso included are some UITableViewCell subclasses that wrap the UITextField and UITextView subclasses, with the latter allowing for automatic height adjustment so it can grow as you add new lines.", "homepage": "https://github.com/forgot/FAFloatLabeledTextInput", "screenshots": [ "https://user-images.githubusercontent.com/2170669/54080457-b255ec00-42b5-11e9-85c7-2a89d5c8ff92.gif", "https://user-images.githubusercontent.com/2170669/54080460-c26dcb80-42b5-11e9-89d2-340089101619.gif" ], "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "forgot": "[email protected]" }, "source": { "git": "https://github.com/forgot/FAFloatLabeledTextInput.git", "tag": "1.0.3" }, "social_media_url": "https://twitter.com/forgot", "swift_version": "4.2", "platforms": { "ios": "9.0" }, "source_files": "FAFloatLabeledTextInput/Classes/**/*" }
Fri, 15 Mar 2019 11:39:05 +0000