downloaded sample chat demo app from net. I have to change the layout direction of two custom cells (incoming messages left side, outgoing messages right side). Both incoming and outgoing cells layout direction are left as of now. So, I changed outgoing cells direction as right with UISemanticContentAttributeForceRightToLeft
.
It is working fine with incoming messages left side, outgoing messages right side. But custom tableview
cells are flickering while reloading tableview.
Please help me with this without changing the design of outgoing message cells.
You should remove the
dispatch_async
stuff fromcellForrowAtIndexPath
.That function is already running in the UI thread, so there is no need to dispatch anything into the main queue.
Also, since cells are being reused, you should also set the
semanticContentAttribute
to left-to-right whenindexPath.row%2 != 0
, because otherwise you'll end up in only right-to-left cells after scrolling a while: