LuxChat  2.0
Instant messenger for iOS
Instance Methods | Properties | List of all members
JVFloatLabeledTextView Class Reference

#import <JVFloatLabeledTextView.h>

Inheritance diagram for JVFloatLabeledTextView:

Instance Methods

(void) - setPlaceholder:floatingTitle:
 

Properties

IBInspectable NSString * placeholder
 
UILabel * placeholderLabel
 
UILabel * floatingLabel
 
IBInspectable CGFloat floatingLabelYPadding
 
IBInspectable CGFloat floatingLabelXPadding
 
IBInspectable CGFloat placeholderYPadding
 
UIFont * floatingLabelFont
 
IBInspectable UIColor * floatingLabelTextColor
 
IBInspectable UIColor * floatingLabelActiveTextColor
 
IBInspectable BOOL floatingLabelShouldLockToTop
 
IBInspectable UIColor * placeholderTextColor
 
IBInspectable BOOL animateEvenIfNotFirstResponder
 
NSTimeInterval floatingLabelShowAnimationDuration UI_APPEARANCE_SELECTOR
 
NSTimeInterval floatingLabelHideAnimationDuration UI_APPEARANCE_SELECTOR
 

Detailed Description

JVFloatLabeledTextView is a UITextView subclass that implements the "Float Label Pattern".

Due to space constraints on mobile devices, it is common to rely solely on placeholders as a means to label fields. This presents a UX problem, in that, once the user begins to fill out a form, no labels are present.

JVFloatLabeledTextView aims to improve the user experience by having placeholders transition into "floating labels" that hover above the text view after it is populated with text.

JVFloatLabeledTextView supports iOS 7+.

Credits for the concept to Matt D. Smith (), and his original design: http://mattdsmith.com/float-label-pattern/

Method Documentation

- (void) setPlaceholder: (NSString *)  placeholder
floatingTitle: (NSString *)  floatingTitle 

Sets the placeholder and the floating title

Parameters
placeholderThe string that to be shown in the text view when no other text is present.
floatingTitleThe string to be shown above the text view once it has been populated with text by the user.

Property Documentation

- (IBInspectable BOOL) animateEvenIfNotFirstResponder
readwritenonatomicassign

Indicates whether the floating label's appearance should be animated regardless of first responder status. By default, animation only occurs if the text field is a first responder.

- (UILabel*) floatingLabel
readnonatomicstrong

Read-only access to the floating label.

- (IBInspectable UIColor*) floatingLabelActiveTextColor
readwritenonatomicstrong

Text color to be applied to the floating label while the text view is a first responder. Tint color is used by default if an floatingLabelActiveTextColor is not provided.

- (UIFont*) floatingLabelFont
readwritenonatomicstrong

Font to be applied to the floating label. Defaults to [UIFont boldSystemFontOfSize:12.0f]. Provided for the convenience of using as an appearance proxy.

- (IBInspectable BOOL) floatingLabelShouldLockToTop
readwritenonatomicassign

Indicates whether the floating label should lock to the top of the text view, or scroll away with text when the text view is scrollable. By default, floating labels will lock to the top of the text view and their background color will be set to the text view's background color Note that this works best when floating labels have a non-clear background color.

- (IBInspectable UIColor*) floatingLabelTextColor
readwritenonatomicstrong

Text color to be applied to the floating label while the text view is not a first responder. Defaults to [UIColor grayColor]. Provided for the convenience of using as an appearance proxy.

- (IBInspectable CGFloat) floatingLabelXPadding
readwritenonatomicassign

Padding to be applied to the x coordinate of the floating label upon presentation.

- (IBInspectable CGFloat) floatingLabelYPadding
readwritenonatomicassign

Padding to be applied to the y coordinate of the floating label upon presentation.

- (IBInspectable NSString*) placeholder
readwritenonatomiccopy

The placeholder string to be shown in the text view when no other text is present.

- (UILabel*) placeholderLabel
readnonatomicstrong

Read-only access to the placeholder label.

- (IBInspectable UIColor*) placeholderTextColor
readwritenonatomicstrong

Text color to be applied to the placeholder. Defaults to [[UIColor lightGrayColor] colorWithAlphaComponent:0.65f].

- (IBInspectable CGFloat) placeholderYPadding
readwritenonatomicassign

Padding to be applied to the y coordinate of the placeholder.

- (NSTimeInterval floatingLabelShowAnimationDuration) UI_APPEARANCE_SELECTOR
readwritenonatomicassign

Duration of the animation when showing the floating label. Defaults to 0.3 seconds.

- (NSTimeInterval floatingLabelHideAnimationDuration) UI_APPEARANCE_SELECTOR
readwritenonatomicassign

Duration of the animation when hiding the floating label. Defaults to 0.3 seconds.


The documentation for this class was generated from the following files: