0

I have created a Table which contain Chat. i just transfromed tableview by using

chatTable.transform = CGAffineTransform(scaleX: 1, y: -1)

I need to Make these cards(in screenshot below) to show on top when user open a chat for first time. enter image description here

i tried this peice of code

chatTable.setContentOffset(CGPoint(x: 0.0, y: -chatTable.contentInset.top), animated: true)

it doesn't worked!

How to acheive that layout? need suggestions.

Suresh Mopidevi
  • 919
  • 3
  • 9
  • 24

1 Answers1

0

I have solved this issue by adding condition if messages count is more than zero, transform table. if not, Table remains normal.

    if messages.count == 0 {
      //show some views
    } else {
      //Transform table along with cells.
      //show Messages
    }
Suresh Mopidevi
  • 919
  • 3
  • 9
  • 24