Title: Theory / Important / CS / Programming / Objective-C / Library / UIKit / Control / Text field
On every note of this deck, unless a note says otherwise:
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Variables: UITextField textField

Typ: UITextField
Meaning: An object that displays an editable text area in your interface.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Subtype of: UIControl

Question: What occurs when a text field become first responder
Answer: A keyboard is opened
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc

Question: What to do when opening the keyboard
Answer: Ensure that the important content to display remains on screen. E.g. first responder text field
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc

Name: The first responder
Definition: The object receiving events, in particular keyboard touches
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit

Name: Overlay view
Definition: Small view displayed on the left and right sides of the text view’s editable area.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit Text Field
Example: "Clear button" to empty the field

Name: Clear button
Definition: The button that empty a field
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit Text Field

Name: A place holder
Definition: Text displayed when the text field is empty
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit Text Field
Intuition: Either eample or explanation of the field content

Variable: textField.interactionState
Meaning: The interaction state (?)

Variable: textField.inputAccessoryView
Meaning: If non nil, show this view above the standard system keyboard/custom input view. E.g. custom toolbar
Typ: UIView

Variable: textField.inputView
Meaning: If non-nil, the view that replaces the system keyboard when current field becomes first responder
Typ: UIView

Variable: textField.(right|left)ViewMode
Meaning: A mode that controls when the (right|left) overlay view appears in the text field.
Typ: UITextFieldViewMode
Initialization: UITextFieldViewModeNever

Variable: textField.(right|left)View
Meaning: The overlay view that displays on the (right (or trailing)|left (or leading)) side of the text field
Typ: UIView

Variable: textField.clearButtonMode
Meaning: mode that controls when the standard Clear button appears in the text field.
Typ: UITextFieldViewMode

Variable: textField.disabledBackground
Meaning: image that represents the background appearance of the text field when it is in a disabled state.
Typ: UIImage

Variable: textField.background
Meaning: The image that represents the background appearance of the text field when it is in an enabled state.
Typ: UIImage

Variable: textField.borderStyle
Meaning: The border style for the text field.
Typ: UITextBorderStyle
Initialization: UITextBorderStyleNone

Variable: textField.clearsOnInsertion
Meaning: whether inserting text replaces the previous contents.
Initialization: NO
Extra: set back to know each time the text field content is erased

Variable: textField.clearsOnBeginEditing
Meaning: whether the text field removes old text when editing begins.
Extra: Even if this property is set to YES, the text field delegate can override this behavior by returning NO from its textFieldShouldClear: method.

Variable: textField.editing
Meaning: whether the text field is currently in edit mode.

Variable: textField.minimumFontSize
Meaning: The size of the smallest permissible font when drawing the text field’s text.

Variable: textField.adjustsFontSizeToFitWidth
Meaning: whether to reduce the font size to fit the text string into the text field’s bounding rectangle.

Variable: textField.textAlignment
Meaning: The technique for aligning the text.

Variable: textField.textColor
Meaning: The color of the text.
Initialization: black

Variable: textField.font
Meaning: The font of the text.

Variable: textField.defaultTextAttributes
Meaning: The default attributes to apply to the text.
Typ: NSDictionary<NSAttributedStringKey, id> *
Initialization: a dictionary of text attributes with default values.

Variable: textField.attributedPlaceholder
Meaning: The styled string that displays when there is no other text in the text field.
Typ: NSAttributedString *
Initialization: nil

Variable: textField.placeholder
Meaning: The string that displays when there is no other text in the text field.
Typ: NSString

Variable: textField.attributedText
Meaning: The styled text that the text field displays.
Typ: NSAttributedString *

Variable: textField.text
Meaning: The text that the text field displays.
Typ: NSString*

Variable: textField.delegate
Meaning: The text field’s delegate.
Typ: id< UITextFieldDelegate >

Instruction: [textField
  textRectForBounds:bounds
]
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Returns: the drawing rectangle for the text field’s text.
Variables: UITextField textField
Extra: You should not call this method directly. If you want to customize the drawing rectangle for the text, you can override this method and return a different rectangle.
The default implementation of this method returns a rectangle that is derived from the control’s original bounds, but which does not include the area occupied by the receiver’s border or overlay views.

Instruction: [textField
  placeholderRectForBounds:bounds
]
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Returns: The computed drawing rectangle for the placeholder text.
Variables: UITextField textField
Extra: You should not call this method directly. If you want to customize the drawing rectangle for the placeholder text, you can override this method and return a different rectangle.
If the placeholder string is empty or nil, this method is not called.

Instruction: [textField
  drawPlaceholderInRect:rectDraws
]
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Effect: the text field’s placeholder text in the specified rectangle.
Context: UIKit
Variables: UITextField textField
Extra: You should not call this method directly. If you want to customize the drawing behavior for the placeholder text, you can override this method to do your drawing.
By the time this method is called, the current graphics context is already configured with the default environment and text color for drawing. In your overridden method, you can configure the current context further and then invoke super to do the actual drawing or do the drawing yourself. If you do render the text yourself, you should not invoke super.

Instruction: [textField
  borderRectForBounds:bounds
]
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Returns: The text field’s border rectangle.
Variables: UITextField textField
Extra: You should not call this method directly. If you want to provide a different border rectangle for drawing, you can override this method and return that rectangle.
The default implementation of this method returns the original bounds rectangle.

Instruction: [textField
  editingRectForBounds:bounds
]
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Returns: the rectangle for displaying editable text.
Variables: UITextField textField
Extra: You should not call this method directly. If you want to provide a different editing rectangle for the text, you can override this method and return that rectangle. By default, this method returns a region in the text field that is not occupied by any overlay views.

Instruction: [textField
  clearButtonRectForBounds:bounds
]
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Returns: the drawing rectangle for the built-in Clear button.
Variables: UITextField textField
Extra: You should not call this method directly. If you want to place the clear button in a different location, you can override this method and return the new rectangle. Your method should call the super implementation and modify the returned rectangle’s origin only. Changing the size of the clear button may cause unnecessary distortion of the button image.

Instruction: [textField
  (left|right)ViewRectForBounds:bounds
]
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Returns: The drawing rectangle of the text field’s left|right overlay view.
Variables: UITextField textField
Extra: You should not call this method directly. If you want to place the left overlay view in a different location, you can override this method and return the new rectangle. Note that the drawing rectangle remains unchanged in a right-to-left user interface.

Typ: UITextBorderStyle
TypMeaning: The type of border around the text field.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Variables: UITextField textField
Value: UITextBorderStyleNone
The text field does not display a border.
Value2: UITextBorderStyleLine
Displays a thin rectangle around the text field.
Value3: UITextBorderStyleBezel
Displays a bezel-style border for the text field. This style is typically used for standard data-entry fields.
Value4: UITextBorderStyleRoundedRect
Displays a rounded-style border for the text field.

Typ: UITextFieldViewMode
TypMeaning: define when overlay views appear in a text field.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Variables: UITextField textField
Value: UITextFieldViewModeNever
The overlay view never appears.
Value2: UITextFieldViewModeWhileEditing
The overlay view is displayed only while text is being edited in the text field.
Value3: UITextFieldViewModeUnlessEditing
The overlay view is displayed only when text is not being edited.
Value4: UITextFieldViewModeAlways
The overlay view is always displayed if the text field contains text.

Typ: UITextFieldDidEndEditingReason
TypMeaning: the reason for ending editing in a text field.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Variables: UITextField textField
Value: UITextFieldDidEndEditingReasonCommitted
The text field changes were accepted by the user.
Value2: UITextFieldDidEndEditingReasonCancelled
The text field changes were aborted.

Constant: UITextFieldDidEndEditingReasonKey
Meaning: A key that indicates the reason for ending editing in a text field.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Typ: NSString*

Constant: UITextFieldTextDidBeginEditingNotification
Meaning: A notification that alerts observers when an editing session begins in a text field.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Typ: NSNotificationName

Constant: UITextFieldTextDidChangeNotification
Meaning: A notification that alerts observers when the text in a text field changes.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Typ: NSNotificationName

Constant: UITextFieldTextDidEndEditingNotification
Meaning: A notification that alerts observers when the editing session ends for a text field.
Page: https://developer.apple.com/documentation/uikit/uitextfield?language=objc
Context: UIKit
Typ: NSNotificationName

Typ: UITextFieldDelegate
Meaning: A set of optional methods to manage the editing and validation of text in a text field object.
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc

Instruction: [textFieldDelegate
  textFieldShouldBeginEditing:textField
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Returns: whether to begin editing in the specified text field.
Variables: UITextFieldDelegate textFieldDelegate
Extra: Called when a text field is selected

Instruction: [textFieldDelegate
  textFieldDidBeginEditing:textField
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Effect: Tells the delegate when editing begins in the specified text field.
Variables: UITextFieldDelegate textFieldDelegate

Instruction: [textFieldDelegate
  textFieldShouldEndEditing:textField
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Returns: whether to stop editing in the specified text field.
Variables: UITextFieldDelegate textFieldDelegate
Extra: The text field calls this method when it is asked to resign the first responder status.

Instruction: [textFieldDelegate
  textFieldDidEndEditing:textField
  reason:reason
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Effect: Tells the delegate when editing stops for the specified text field, and the reason it stopped.
Variables: UITextFieldDelegate textFieldDelegate

Instruction: [textFieldDelegate
  textFieldDidEndEditing:textField
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Effect: Tells the delegate when editing stops for the specified text field.
Variables: UITextFieldDelegate textFieldDelegate

Instruction: [textFieldDelegate
  textField:textField
  shouldChangeCharactersInRange:range
  replacementString:string
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Returns: whether to change the specified text.
Variables: UITextFieldDelegate textFieldDelegate

Instruction: [textFieldDelegate
  textFieldShouldClear:textField
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Returns: whether to remove the text field’s current contents.
Variables: UITextFieldDelegate textFieldDelegate
Extra: The text field calls this method in response to the user pressing the built-in clear button.

Instruction: [textFieldDelegate
  textFieldShouldReturn:textField
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Returns: whether to process the pressing of the Return button for the text field.
Variables: UITextFieldDelegate textFieldDelegate

Instruction: [textFieldDelegate
  textFieldDidChangeSelection:textField
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Effect: Tells the delegate when the text selection changes in the specified text field.
Variables: UITextFieldDelegate textFieldDelegate

Instruction: [textFieldDelegate
  textField:textField
  editMenuForCharactersInRange:range
  suggestedActions:suggestedActions
]
Page: https://developer.apple.com/documentation/uikit/uitextfielddelegate?language=objc
Effect: Asks the delegate for the menu to display in the text field, based on the text range and actions the system provides.
Variables: UITextFieldDelegate textFieldDelegate