I am building a tvos
application. i have a strange bug where UICollectionView
lose focus of the previously selected cell when i navigate back to that particular view. The scenario is some thing this like this.
I have two UIViewControllers
A
and B
. A
has a UITableView
and it has three prototype cells in it. Each cell has a horizontal scrolling UICollectionView
inside it. When i click on any of UICollectionViewCell
it navigates to the B
(detail page). I am presenting B
modally.
Now when i press Menu button on Siri remote view A
appears again (in other words view B
is removed from View hierarchy) but the current selected cell is different then the previously selected. I have tried to use remembersLastFocusedIndexPath
with both true
and false
values and also tried by implementing
func indexPathForPreferredFocusedViewInCollectionView(collectionView: UICollectionView) -> NSIndexPath?
but the control neves comes to this function when i navigate back to view A. I am also reloading every thing in viewWillAppear
function.
Can any one help me in this. Thanks