I have UITableview in my project. I am getting new data when clicking add new button on footer. here is my app(demonstrated) https://pastenow.ru/e327ad5e4978777b280552c4e92f032d
When clicking on Add New Btn there is some little scrolling to up. i want to disable it and need to not scrolling uitableview to any direction. here is screenshot (demonstrated) https://pastenow.ru/e489ca3b9b5f78c31ad388cf8b3d02b9
i have checked setcontentoffset of uitableview, but it not works i dont know why.
override func viewDidLoad() {
super.viewDidLoad()
for i in 0...10 {
items.append(i)
}
}
@IBAction func addNewBtnClicked(_ sender: Any) {
for i in 10...20 {
items.append(i)
}
tableView.reloadData()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "tableCell") as! MyCell
cell.titleLabel.text = "\(items[indexPath.row])"
return cell
}