Reputation: 425
i have added a TableView inside Collection View Cell, but the Collection View Cell height should depend on TableView data.
Thanks.
Upvotes: 1
Views: 425
Reputation: 639
Maybe this can be achieved by reloading the tableview first, waiting for it complete, fetch the tableview Content height then load the collectionview giving the cell the right values
tableView.reloadData()
dispatch_async(dispatch_get_main_queue(), { () -> Void in
requiredCellHeight = self.tableView.contentSize.height
})
This waits on the main thread for the tableview to load. Though not an ideal solution as we are blocking the main thread, might work for this complex setup
Upvotes: 2