BaseUITextField
open class BaseUITextField: UITextField, UITextFieldDelegate, BaseView
BaseUITextField is a subclass of UITextField and implements UITextFieldDelegate, BaseView. It has some extra proporties and support for SyncEngine.
-
Flag for whether to resize the values for iPad.
Declaration
Swift
@IBInspectable open var sizeForIPad:Bool = false; -
Background color key from Sync Engine.
Declaration
Swift
@IBInspectable open var bgColorStyle:String? = nil -
Width of View Border.
Declaration
Swift
@IBInspectable open var border:Int = 0 -
Border color key from Sync Engine.
Declaration
Swift
@IBInspectable open var borderColorStyle:String? = nil -
Corner Radius for View.
Declaration
Swift
@IBInspectable open var cornerRadius:Int = 0 -
Flag for making circle/rounded view.
Declaration
Swift
@IBInspectable open var rounded:Bool = false -
Flag for Drop Shadow.
Declaration
Swift
@IBInspectable open var hasDropShadow:Bool = false -
Font name key from Sync Engine.
Declaration
Swift
@IBInspectable open var fontName:String = "fontRegular" -
Font size/style key from Sync Engine.
Declaration
Swift
@IBInspectable open var fontStyle:String = "medium" -
Font color key from Sync Engine.
Declaration
Swift
@IBInspectable open var fontColorStyle:String? = nil -
Placeholder Text Font color key from SyncEngine.
Declaration
Swift
@IBInspectable open var placeholderColor:String? = nil -
Text Vertical Padding - Default Value is Zero
Declaration
Swift
@IBInspectable open var verticalPadding:CGFloat=0 -
Text Horizontal Padding - Default Value is Zero
Declaration
Swift
@IBInspectable open var horizontalPadding:CGFloat=0 -
Max Character Count Limit for the text field.
Declaration
Swift
@IBInspectable open var maxCharLimit: Int -
Maintainig Own delegate.
Declaration
Swift
open override weak var delegate: UITextFieldDelegate? -
Overridden property to set placeholder text from SyncEngine (Hint ’#’ prefix).
Declaration
Swift
override open var placeholder: String?
-
Overridden method to setup/ initialize components.
Parameter
Parameter frame: View FrameDeclaration
Swift
override public init(frame: CGRect)Parameters
frameView Frame
-
Required constructor implemented.
Declaration
Swift
required public init?(coder aDecoder: NSCoder)
-
Overridden method to setup/ initialize components.
Declaration
Swift
override open func awakeFromNib() -
Overridden methed to update layout.
Declaration
Swift
override open func layoutSubviews() -
Overridden method to handle text paddings
Parameter
Parameter bounds: Text BoundsReturns
Calculated bounds with paddings.Declaration
Swift
override open func textRect(forBounds bounds: CGRect) -> CGRectParameters
boundsText Bounds
Return Value
Calculated bounds with paddings.
-
Overridden method to handle text paddings when editing.
Parameter
Parameter bounds: Text BoundsReturns
Calculated bounds with paddings.Declaration
Swift
override open func editingRect(forBounds bounds: CGRect) -> CGRectParameters
boundsText Bounds
Return Value
Calculated bounds with paddings.
-
Protocol method of textFieldShouldBeginEditing.
Parameter
Parameter textField: Text FieldReturns
Bool flag for should begin edititngDeclaration
Swift
open func textFieldShouldBeginEditing(_ textField: UITextField) -> BoolParameters
textFieldText Field
Return Value
Bool flag for should begin edititng
-
Protocol method of textFieldDidBeginEditing.
Parameter
Parameter textField: Text FieldDeclaration
Swift
open func textFieldDidBeginEditing(_ textField: UITextField)Parameters
textFieldText Field
-
Protocol method of textFieldShouldEndEditing. - Default value is true
Parameter
Parameter textField: Text FieldReturns
Bool flag for should end edititngDeclaration
Swift
open func textFieldShouldEndEditing(_ textField: UITextField) -> BoolParameters
textFieldText Field
Return Value
Bool flag for should end edititng
-
Protocol method of textFieldDidEndEditing
Parameter
Parameter textField: Text FieldDeclaration
Swift
open func textFieldDidEndEditing(_ textField: UITextField)Parameters
textFieldText Field
-
Protocol method of shouldChangeCharactersIn for limiting the character limit. - Default value is true
- Parameters:
- textField: Text Field
- range: Change Characters Range
- string: Replacement String
Returns
Bool flag for should change characters in rangeDeclaration
Swift
open func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> BoolParameters
textFieldText Field
rangeChange Characters Range
stringReplacement String
Return Value
Bool flag for should change characters in range
- Parameters:
-
Protocol method of textFieldShouldClear. - Default value is true
Parameter
Parameter textField: Text FieldReturns
Bool flag for should clear text fieldDeclaration
Swift
open func textFieldShouldClear(_ textField: UITextField) -> BoolParameters
textFieldText Field
Return Value
Bool flag for should clear text field
-
Protocol method of textFieldShouldReturn. - Default value is true
Parameter
Parameter textField: Text FieldReturns
Bool flag for text field should return.Declaration
Swift
open func textFieldShouldReturn(_ textField: UITextField) -> BoolParameters
textFieldText Field
Return Value
Bool flag for text field should return.
View on GitHub
BaseUITextField Class Reference