
I am using xib to display the data but if the data for labels are empty am hiding the labels but height of the cell is not decreasing based on the contents.Thanks in advance your suggestions are helpful

I am using xib to display the data but if the data for labels are empty am hiding the labels but height of the cell is not decreasing based on the contents.Thanks in advance your suggestions are helpful
 
    
     
    
    You should use auto layout constarits, not set a fixed height for labels please connect to top and bottom
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
    return UITableViewAutomaticDimension
}
