It is my first time that I want to create a UICollectionView. This is how I want it to look like:

I read some tutorials and I know how it works exactly. The thing is as you see in the image, The UICollection cells have border from up, bottom, left and right. Do you know how can set these kind of border in Collection View?
As you see two of the items are selected by red color. is it possible in UICollectionView to have multiple selected items? if yes, could you please give send me some tutorials.
Small example project here: https://github.com/erikt/ETMultiSelect
First you have to make it possible to select more than one cell in the
UICollectionView. This is done by setting theallowsMultipleSelectionproperty toYESon the collection view.The view controller would look something like this:
The
UICollectionViewCellis made up of several views. It has a content view, a background view and a selected background view.There are many ways to achieve something similar to your picture, but I set the border on the selected background layer and add a subview to the content view that’s inset so the background border is visible:
The result is something like this:
Clone and play with the sample project.
In a real project you would want to keep track of what the user has selected in the view controller, by adding the selected data model entities to some structure (like a
NSMutableArray) in the– collectionView:didSelectItemAtIndexPath:method on theUICollectionViewDelegateprotocol.