textField(at:)
Returns the text field at the given index
Declaration
func textField(at textFieldIndex: Int) -> UITextField?Parameters
- textFieldIndex:
The index of the text field. The text field indices start at
0.
Return Value
The text field specified by index textFieldIndex.
Discussion
The number of text fields present in an alert is dependent on the style of the alert.
Alert Style | Text Fields |
|---|---|
No user-editable text fields. | |
A single text field at index | |
A single text field at index | |
The login field is at index |
If your application attempts to retrieve a text field with an index that is out of bounds, the alert raises an rangeException.