1

i have added a TableView inside Collection View Cell, but the Collection View Cell height should depend on TableView data.

Thanks.

2
  • Sounds awfully complicated. What about using a vertical UIStackView instead of that tableview? Commented Apr 6, 2017 at 8:24
  • @BartvanKuik can you give me an example in Swift 3 for that? Commented Apr 6, 2017 at 8:29

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.