The bottommost cell of my table view is a cell with a textField. When the user taps it, I want to scroll it so that the cell is right above the keyboard.

When I call the `scrollRectToVisible(...)` with `animated` `false` everything works as expected, but when `animated` is set to `true` the table scrolls the cell only so far, that the bottom of the textField is right above the keyboard *(See left picture)*. Yet the bottonInsets should be correct, since I can scroll the cell the last bit manually and the cell sits right how it should *(See right picture)*.

I think the table view scrolling the textField's bottom edge above the keyboard is the default behavior of a table view, but I'm afraid I don't know why it seems to override my own scrolling when I want it animated.

*Left picture:  

The textFields bottom edge right above the keyboard (I kept the border style so you can see it better).*

*Right picture:
How I want it. Cell's bottom edge right above the keyboard.*

[![enter image description here](https://i.stack.imgur.com/9n6vk.png)](https://i.stack.imgur.com/9n6vk.png)

```
func repositionTextfieldCell(in tableView: UITableView) {
    guard let textFieldCell = tableView.bottommostCell() else { return }
    guard let keyboardRect = activeKeyboardRect else { return }

    // - Adjust insets

    var bottomInset = keyboardRect.size.height

    tableView.contentInset.bottom = bottomInset
    tableView.scrollIndicatorInsets.bottom = bottomInset

    // - Make cell visible

    let x = textFieldCell.frame.minX
    let y = textFieldCell.frame.maxY

    tableView.scrollRectToVisible(CGRect(origin: CGPoint(x: x, y: y),
                                         size: CGSize(width: 1, height: 1)), animated: true)
}

```