Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

swift start tableView from bottom (reverse tableView)

Is it possible to reverse order a tableView? I search a lot for a solution but nothing works.

The effect is like whatsapp chat.

A normal tableView is:

----------
label 1
----------
label 2
----------
label 3
----------
empty
----------
empty
----------

scroll direction
   |
   |
   v

Desired result:

----------
empty
----------
empty
----------
empty
----------
empty
----------
label 3
----------
label 2
----------
label 1
----------

 scroll direction
      ^
      |
      |

Thanks for help

like image 508
Stefano Vet Avatar asked Jun 23 '26 13:06

Stefano Vet


1 Answers

Just scroll to the end and do the same whenever you insert a cell.

tableView.scrollToRowAtIndexPath(bottomIndexPath, atScrollPosition: .Bottom,
          animated: true)
like image 85
Mundi Avatar answered Jun 25 '26 04:06

Mundi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!