justdan0227
justdan0227

Reputation: 1362

UICollectionView deselect all

When handling selections with didSelectItemAtIndexPath, do you have to ensure that you use

cell.select = true

in order to get indexPathsForSelectedItems to work?

I have a collectionview that I create a red box around each thumbnail image when selected in an "edit mode".

cell?.backgroundColor = UIColor.redColor()

I want to CLEAR those boxes when "DONE" is pressed.

Calling indexPathsForSelectedItems only returns a single value and I'm not sure why? (I've tried setting cell=selected and still only get one return).

Upvotes: 1

Views: 2451

Answers (1)

rob mayoff
rob mayoff

Reputation: 385510

Set allowsMultipleSelection to true on your collection view.

Upvotes: 2

Related Questions