Returns the text field at the given index
SDKs
- iOS 5.0–9.0Deprecated
- Mac Catalyst 13.0–13.0Deprecated
Framework
- UIKit
Declaration
func textField(at textFieldIndex: Int) -> UIText Field?
Parameters
textFieldIndex
The index of the text field. The text field indices start at
0
.
Return Value
The text field specified by index text
.
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 range
.