I want to create a custom cell with number of labels in it. It is easy to create custom cell if you know the number of fixed labels required. But what if you don't know how many labels are needed for a particular cell. I get values from API side which tells the number of labels needed. If there are more than 3 labels, I will have a "view more" button to expand the cell to show more labels.
Right now I can think to achieve this by creating 3 labels in custom cell. And in the cellForRowAtIndexPath, I can hide last two labels and change the cell frame according data given from API. But I still have to figure out about showing more labels after clicking "view more" button. So what is the best way to solve this challenge? Your little help will be appreciated.
Note: I am not using storyboard. I create every objects programmatically.