ForagePANTextField
public class ForagePANTextField : UIView, Identifiable, ForageElement, ForageElementDelegate
extension ForagePANTextField : UITextFieldDelegate
-
Declaration
Swift
@IBInspectable public var isEmpty: Bool { get }
-
Declaration
Swift
@IBInspectable public var isValid: Bool { get }
-
Declaration
Swift
@IBInspectable public var isComplete: Bool { get }
-
BorderWidth for the text field
Declaration
Swift
@IBInspectable public var borderWidth: CGFloat { get set }
-
BorderColor for the text field
Declaration
Swift
@IBInspectable public var borderColor: UIColor? { get set }
-
CornerRadius for the text field
Declaration
Swift
@IBInspectable public var cornerRadius: CGFloat { get set }
-
MasksToBounds for the text field
Declaration
Swift
@IBInspectable public var masksToBounds: Bool { get set }
-
Declaration
Swift
@IBInspectable public var padding: UIEdgeInsets { get set }
-
Placeholder for the text field
Declaration
Swift
@IBInspectable public var placeholder: String? { get set }
-
Text color for the text field
textColor
default value isblack
Declaration
Swift
@IBInspectable public var textColor: UIColor? { get set }
-
Size of the text for the text field
size
default value is24
Declaration
Swift
@IBInspectable public var size: Double { get set }
-
Tint color for the text field
tfTintColor
default value isblack
Declaration
Swift
@IBInspectable public var tfTintColor: UIColor? { get set }
-
Text alignment
textAlignment
default value isnatural
Declaration
Swift
@IBInspectable public var textAlignment: NSTextAlignment { get set }
-
Allow user to clear text field
clearButtonMode
default value isnever
Declaration
Swift
@IBInspectable public var clearButtonMode: UITextField.ViewMode { get set }
-
Change UIFont
UITextField
text fontDeclaration
Swift
@IBInspectable public var font: UIFont? { get set }
-
Declaration
Swift
@IBInspectable public var elementHeight: CGFloat { get set }
-
A delegate that informs the client about the state of the entered card number (validation, focus).
Declaration
Swift
public weak var delegate: ForageElementDelegate?
-
Declaration
Swift
override public func awakeFromNib()
-
Declaration
Swift
override public var intrinsicContentSize: CGSize { get }
-
Declaration
Swift
public func setPlaceholderText(_ text: String)
-
Declaration
Swift
public func clearText()
-
Declaration
Swift
public func focusDidChange(_ state: ObservableState)
-
Declaration
Swift
public func textFieldDidChange(_ state: ObservableState)
-
Declaration
Swift
public func textFieldDidBeginEditing(_ textField: UITextField)
-
Declaration
Swift
public func textFieldDidEndEditing(_ textField: UITextField)
-
Determines whether the text field should allow a change of characters within the specified range. This method is called when the user attempts to change the content of the text field.
Declaration
Swift
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString: String) -> Bool
Parameters
textField
The text field containing the text.
range
The range of characters to be replaced.
replacementString
The replacement string.
Return Value
true
if the changes should be allowed; otherwise,false
.
-
Make
ForagePANTextField
focused.Declaration
Swift
@discardableResult override public func becomeFirstResponder() -> Bool
-
Remove focus from
ForagePANTextField
.Declaration
Swift
@discardableResult override public func resignFirstResponder() -> Bool
-
Check if
ForagePANTextField
is focused.Declaration
Swift
override public var isFirstResponder: Bool { get }