Embed UITableView in a UICollectionViewCell - ios

I have a vertical UICollection view. One of it cells has a table view.
The table view size has it content size, this means there is no scrolling for table view.
The problem is once the collection view cell that has the table view being displayed, all the table view cells loaded. Which means no reusing for the table view cells. since they all loaded.
I had a 52 cells for the table view, All of them loads at the same time on the memory. this makes the app freezing.
I did a debug for the table view datasource call back, the cellForRowAtIndex method is called once for each table view cell at first time. And it doesn't called when scrolling down to see table view cells; This leads me to recognize that there is no reusing for TableViewCells.
Any help?

Related

Xcode UI Test cannot access multiple collection views inside a table view

I have a problem with accessing collection view cells inside a table view cell when using app.debugDescription during XCode UI Test runs.
First of all, XCUIApplication proxy do not see any collection views, but there are 4 of them, 2nd it does not see any cells other than the 4 cells of UITableView.
I have tried setting isAccessibilityIdentifier to false on these table view cells, but no use. If I set isAccessibilityIdentifier to true for each collection view, then I can see 4 collection views, but still no cells. I have put accessibilityIdentifier values to each cell in collection view and on elements inside a collection view, like UILabel and UIImageView.
If I set isAccessibilityIdentifier to true for collection view cells, then I can see accessibilityIdentifiers for each cell when printing out app.debugDescription, but as other element, not as of cell type.
Can anyone assist me here, here is my screenshot of view hierarchy in the storyboard.

nested horizontal collectionview in auto size tableview cell exanding height make collection view scroll reset when reload cell for row accured

i have table view for showing product detail and each part is tableview cell,
in one of my tableview cell that is showing sizes and stores that has that size like this
and
when the user click on one of collection view items tableview expand to show stores.
if i update root tableviewcell constraints i need to reload that cell
after reloading collection scroll will rest
i tried beginUpdates and endUpdates for root tableview after changing constraint it will work but in some situation it will show a blank cell
what's wrong in my idea
in summary :
how to expand tableview cell without reloading and refresh cell view .i think both questions are equal
Change the constraints in the tableView and add to model the currently selected collectionViewCell and scroll to it with no animation in collectionViewCell awakeFromNib method the default value is 0 which means no animation will happen [the model I mean here is the model of the tableView from which you display every tableViewCell]

index out of bounds with UICollectionViews with different amount of items embedded in UITableView

I have a UITableView (vertically scrollable), where each row (Custom TableViewCell) contains a UICollectionView with some CollectionView cells (horizontally scrollable)
However, the collection views have different amount of collection view cells: some have just two or three, others have more than ten.
The problem is: when I am on a row with a collection view that has very many cells and horizontally scroll all the way over to the last cell, and THEN scroll down vertically to a collection view that has only a few collection view cells, I get index out of bounds, because the row is reused and scrolled to further to the right than there are collection view items.
Do you have an idea how I can prevent this? Maybe by preparing for reuse?
1.reload collection in UITableview cell row at indexpath
2.before reload collectionView remove all array belong to collection view

Passing data in Collection View Cell

I have 1 colleection view with 4 cells which scrolls horizontal just like old youtube ios app. Under these 4 cells, each cell has custom collection view cell with 4 rows scrolls vertically. Under these rows there are customized collection view which scroll horizontally like netflix app with customized collection view cell. How do i pass data from these inner cells to a view controller with naviagation controller. No storyboard are been used. I can not push view controller from collection view cell. Also protocols are not working from inner cells. Any alternative?

Passing scroll of uitableview in tableview inside uitableviewcell

I've got a UITableView ( let it be big table view ) with two cells. The second cell has UITableView inside. I want to scroll down first cell, than, when it hides from screen on top, i want to disable scroll on the big table view and enable scrolling on the second cell with table view. And when the second table view scrolls to top - enable scrolling on big table view. Here is the link to video :
Video
I've implemented it, but with lag - when scrolling of big table finishes, the transition to scrolling of second cell's table isn't smooth. Did anyone implement this before ? Or can you suggest any github help?) Thanks

Resources