I want to create a UITableView header with dynamic height. I have four labels in the view and the height of the header must be adjusted according to the content in each of the UILabels. I want to achieve something similar to this image. Sample image.
Here the width of the labels would be dynamic according to the screen size. The "type" label would cover around 2/3 of the screen and the rest will be divided equally between the three labels. Here the according to the screen size the labels could be multiline and I want to manage the height of the main view according to the contents of the label.
When I give fixed width constraint to the labels, I am successfully able to manage the height, but I want to keep the width of labels dynamic. This is a UITableView header. Any help would be much appreciated.