wibosco / ViewControllerInCell-Example

An example project looking at how to add a view controller's view as a subview in a cell
https://williamboles.com/hosting-viewcontrollers-in-cells/
MIT License
14 stars 4 forks source link

weird behaviour in CollectionView adaptation #1

Open ahmad-earnin opened 4 years ago

ahmad-earnin commented 4 years ago

Hey Will, found your article while debugging my own project using this approach in a collection view. My conclusion is to refactor this into a tableView but wondering if you ever encountered this weird behaviour before and if there's an easy fix.

Essentially calling performBatchUpdates on the collection view in order to animate some layout change causes the hostedView to disappear from the contentView.

https://github.com/ahmad-earnin/ViewControllerInCell-Example/tree/collectionView

wibosco commented 4 years ago

Hi @ahmad-earnin, I haven't come across this issue before. I checked out the collectionView and I noticed that the performBatchUpdates has an empty body - would you be able to share an example with the sort of changes that you're attempting to perform just to give me more insight into what you are attempting to achieve?