i have collection view standard horizontal layout. upon presenting view controller , dismissing it, collection view reset focus first cell, though last focused cell not one.
i've set
self.collectionview.rememberslastfocusedindexpath = yes;
what's weird happens when push view controller on navigation controller.
so if
[self.navigationcontroller pushviewcontroller:controller animated:yes];
and dismiss, rememberslastfocusedindexpath
not work properly.
however, if i:
[self presentviewcontroller:controller animated:yes completion:nil];
then works expected.
any idea why wouldn't work via navigation controller?
what worked me ensuring preferredfocusview on viewcontroller collection view:
override weak var preferredfocusedview: uiview? { return collectionview }
after rememberslastfocusedindexpath seems work.
Comments
Post a Comment