Declared in UITextField+BFKit.h

Overview

This category adds some useful methods to UITextField

Class Methods

initWithFrame:placeholder:color:font:size:returnType:keyboardType:secure:borderStyle:autoCapitalization:keyboardAppearance:enablesReturnKeyAutomatically:clearButtonMode:autoCorrectionType:delegate:

+ (instancetype _Nonnull)initWithFrame:(CGRect)frame placeholder:(NSString *_Nonnull)placeholder color:(UIColor *_Nonnull)color font:(FontName)fontName size:(float)size returnType:(UIReturnKeyType)returnType keyboardType:(UIKeyboardType)keyboardType secure:(BOOL)secure borderStyle:(UITextBorderStyle)borderStyle autoCapitalization:(UITextAutocapitalizationType)capitalization keyboardAppearance:(UIKeyboardAppearance)keyboardAppearence enablesReturnKeyAutomatically:(BOOL)enablesReturnKeyAutomatically clearButtonMode:(UITextFieldViewMode)clearButtonMode autoCorrectionType:(UITextAutocorrectionType)autoCorrectionType delegate:(id<UITextFieldDelegate> _Nullable)delegate
Discussion

Create an UITextField and set some parameters

Parameters

frame

TextField’s frame

placeholder

TextField’s text placeholder

color

TextField’s text color

fontName

TextField’s text font

size

TextField’s text size

returnType

TextField’s return key type

keyboardType

TextField’s keyboard type

secure

Set if the TextField is secure or not

borderStyle

TextField’s border style

capitalization

TextField’s text capitalization

keyboardAppearence

TextField’s keyboard appearence

enablesReturnKeyAutomatically

Set if the TextField has to automatically enables the return key

clearButtonMode

TextField’s clear button mode

autoCorrectionType

TextField’s auto correction type

delegate

TextField’s delegate. Set nil if it has no delegate

Return Value

Returns the created UITextField

Declared In

UITextField+BFKit.h