I just asked this question on StackOverflow with images and code, so it might be easier to view there for more details: https://stackoverflow.com/questions/66924712/uitableview-duplicating-row-on-insert
But basically I have a scroll view with a vertical stack view inside it. This stack view will eventually contain UIContainerViews that reference different view controllers for different sections of the user interface. I am splitting this into separate view controllers so each section will be reusable if necessary and, more importantly, so each view controller is then just responsible for its own data and views, rather than having one large view controller that manages all the data views for the entire user interface.
I am running into issues though when I go to resize the parent UIContainerView after the child view controller changes size. For example, in the question linked previously, I have a table view controller that is loaded in one of the sections of the stack view. I then go about inserting a row in the middle of the table and animating it in, and this all works fine, except that at the bottom of the table view the bottom row seems to be temporarily duplicated while the animation is taking place. There is a GIF showing this in the StackOverflow question. I would have posted that here too, but I could not find a way to post images here.
Does anyone know what might be causing that or how to fix it?
And also, having a UI composed of all these different dynamically sized (vertically only) view controllers each loaded with a UIContainerView, is it more recommended to display these in a stack view or a table view, or is there a better way to handle this? Again, what I am trying to achieve is to have a user interface that is composed of different sections of content (some of them will be tables, some will be collection views, and some of them are just ad-hoc text, graphics, buttons, ... and I would like to not have one huge view controller that manages all of this, but to instead break it up into smaller, self-contained, view controllers. And I also need them to be able to resize their height (for example, some of the tables will have expandable rows or sections, so they need to be able to resize).
Thank you for your help.
But basically I have a scroll view with a vertical stack view inside it. This stack view will eventually contain UIContainerViews that reference different view controllers for different sections of the user interface. I am splitting this into separate view controllers so each section will be reusable if necessary and, more importantly, so each view controller is then just responsible for its own data and views, rather than having one large view controller that manages all the data views for the entire user interface.
I am running into issues though when I go to resize the parent UIContainerView after the child view controller changes size. For example, in the question linked previously, I have a table view controller that is loaded in one of the sections of the stack view. I then go about inserting a row in the middle of the table and animating it in, and this all works fine, except that at the bottom of the table view the bottom row seems to be temporarily duplicated while the animation is taking place. There is a GIF showing this in the StackOverflow question. I would have posted that here too, but I could not find a way to post images here.
Does anyone know what might be causing that or how to fix it?
And also, having a UI composed of all these different dynamically sized (vertically only) view controllers each loaded with a UIContainerView, is it more recommended to display these in a stack view or a table view, or is there a better way to handle this? Again, what I am trying to achieve is to have a user interface that is composed of different sections of content (some of them will be tables, some will be collection views, and some of them are just ad-hoc text, graphics, buttons, ... and I would like to not have one huge view controller that manages all of this, but to instead break it up into smaller, self-contained, view controllers. And I also need them to be able to resize their height (for example, some of the tables will have expandable rows or sections, so they need to be able to resize).
Thank you for your help.