HomeiOS Developmentios - UITableView a number of row updates: inserts+removes

ios – UITableView a number of row updates: inserts+removes


I’m making an attempt to make a chat utilizing UITableView. New messages preserve showing from the underside (desk is rotated 180 as traditional for these instances) – let’s name this operation insertion. Additionally some messages that are already within the desk needs to be up to date – standing change, textual content edits, and many others… Let’s name this one edit.

So, for insertion, I take advantage of tableView.insertRows(at... with .high animation sort (as a result of desk is the wrong way up) to make the cell “slide” from exterior of the display screen. And edit is a deleteRows adopted by insertRows each with no animation, it simply wants to remain in place and simply replace its “insides”. All of that is occurring in a similar tableView.beginUpdates() tableView.endUpdates() block.

The issue is the undesirable animation for among the edits. I’ve put collectively a easy chat imitation mission. The app inserts new message each 3 seconds, and likewise modifications the colour of two earlier messages. So UITableView has to do two edits and one insert in a single go. Listed here are the frames of a video of the problem (cannot connect a video right here):

enter image description here
enter image description here
enter image description here
enter image description here

Perhaps that is the supposed behaviour, however it appears dangerous I believe. What I wish to occur is for the inserted message to slip from the underside, and each edits to simply keep of their respective locations, solely transferring up through the insertion with the remainder of desk content material, like all non edited cells. Please assist in the event you guys have any expertise with this.

Right here is the mission: https://github.com/f3dm76/TableIssueExample

The video is within the readme of the mission.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments