---
title: "textField(at:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uialertview/textfield(at:)"
---

# textField(at:)

Returns the text field at the given index

## Declaration

```swift
func textField(at textFieldIndex: Int) -> UITextField?
```

## Parameters

- `textFieldIndex`: The index of the text field. The text field indices start at 0.

## Return Value

Return Value The text field specified by index textFieldIndex.

## Discussion

Discussion The number of text fields present in an alert is dependent on the style of the alert.  |   |   |   |   |  If your application attempts to retrieve a text field with an index that is out of bounds, the alert raises an rangeException.

## See Also

### Configuring buttons

- [addButton(withTitle:)](uikit/uialertview/addbutton(withtitle:).md)
- [numberOfButtons](uikit/uialertview/numberofbuttons.md)
- [buttonTitle(at:)](uikit/uialertview/buttontitle(at:).md)
- [cancelButtonIndex](uikit/uialertview/cancelbuttonindex.md)
- [firstOtherButtonIndex](uikit/uialertview/firstotherbuttonindex.md)
