I need to create a view based tableview in Popover as specified below:
- Tableview should be placed in Popover(Popover height should be same as tableview).
- Each row should contain a view.
- Each row view will contain 3 labels.
- Labels should be auto re sizable based on its text height.
- Based on 3 labels height, Cell row height should resize.
- Based on all cell rows, tableview height should resize.
- Based on tableview height, Popover should resize.
I have done this in a static format, but i need to do it in more dynamic format(in future i should be able to add more rows using same classes and methods).
Main problem i am facing is, i am unable calculate the size of cell view in tableView:heigthOfRow:
since i don't know the text of labels in this point of time.
So i just created tableview cells in loadView itself and saved in array, and fetching from array in tableview delegate methods. But i think this is wrong way of doing so.
Note: All data to tableview will be given while loading the view itself. Labels are not editable.