'Programatically scroll not working for TableView inside collection view

I have a ViewController that has a CollectionView. Every cell of this collection has a TableView.

I want to be able to do scroll to IndexPath in the table view. To do this I use the next function:

self.tableView.scrollToRow(at: indexPath, at: .top, animated: true)

Doing debugging I see that this is executed with the correct indexpath but it doesn't works, the TableView doesn't do anything.

I'm doing the same in other parts of my application and it works, but I think the problem is the TableView is inside a Collection but I need this structure.

Screenshot of design:

enter image description here

Collection view starts below "Resultados" to the bottom of the screen. Inside I have a collection that starts below "Eosinofilos"

Thanks



Solution 1:[1]

try this it will scroll to the 0 row.

wbTableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: true)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sahil Omer