I have a UICollectionView
build like in the picture. For example, I choose the 5th button and closed and opened the application. I want the 5th button to appear on the screen when the application is opened again. In other words, the UICollectionView
should not return to the first position when the application is opened again.
Asked
Active
Viewed 189 times
-1

James Bucanek
- 3,299
- 3
- 14
- 30

yunus uzun
- 1
- 2
-
can you post the image here, instead of giving links? what do you mean by closed and opened the application.? – Harish Mar 05 '20 at 18:51
-
Please show us some code of what you've tried. – Rudedog Mar 05 '20 at 18:52
-
2possible duplicate: https://stackoverflow.com/a/15986085/4757272 use `scrollToIndex(at: IndexPath)` or something like that – Vollan Mar 05 '20 at 18:54
-
You need to save the selected index like 5th and scroll to that cell when you return back to collection view. – RJ168 Mar 05 '20 at 18:57