In Pages documents are listed as paper size rectangles with a title and date underneath. I’ve recreated this look with a UICollectionView.
When the user taps on the title to rename the document all other documents fade out and the one you tapped on transitions from its current location to the center and expands in size a bit as the keyboard slides out.
(I found this video that show what I’m talking about)
What’s the best way to do this when using a UICollectionView?
You gotta subclass the
UICollectionViewFlowLayout. Then when the needed action (to rename) is performed, you pass theindexPathof the cell that needs to be edited to the layout.Then you can add the needed layout attributes, like this:
You also need to invalidate the layout when the
renameIndexPathvalue is changed (do that in the setter). When renaming is finished (or cancelled), you change therenameIndexPathback tonil.