AnimatedFormFieldTableViewCell
AnimatedFormFieldTableViewCell copied to clipboard
UITextField for iOS that enables the user to see both the Input Text and the Placeholder
AnimatedFormFieldTableViewCell
The AnimatedFormFieldTableViewCell allows you to implement a UITableViewCell with an embedded UITextField that automatically scales the textfield's placeholder upon user interaction.
Installation: Grab the "AnimatedFormFieldTableViewCell.xib" and "AnimatedFormFieldTableViewCell.swift" files from the "AnimatedFormFieldTableViewCell" folder and drag them to your project".
In order to use AnimatedFormFieldTableViewCell, all you have to do is:
-
Register the
AnimatedFormFieldTableViewCellnib on the ViewController on which you are implementing your UITableView for your reuse identifier. -
Dequeue your cell on
CellForRowAtIndexPathas aAnimatedFormFieldTableViewCell. -
Change the placeholder's label text by calling
setLabelTexton the cell itself.
And you're pretty much done :). Everything should take care of itself from this point forward.
Notes:
-
In order to access the embedded
UITextFieldyou can simply call the cell'scellTextFieldproperty. -
The
AnimatedFormFieldTableViewCellconforms to theUITextFieldDelegateprotocol, so if you wish to implement any of theUITextFieldDelegatefor the cell's textField, you just need to set thedelegateon the cell itself (and not on the textField - there's no need for that - the cell will take care of that). -
For best results - cell height should be 60.