I have created an iPhone application using UICollectionView. I am using nsmutable array to count multi-selected Items in our collection view. I am using a lot of code only for counting.
Can anyone tell me how can I get the total number of Items selected in shortest and easiest way.
Tarun Kumar
30-Dec-2015Collection view provides a method indexPathsForSelectedItems: , this method helps in counting the total number of Items selected in current collection view controller.
but for doing it, it is necessary to allow collection view as multiple selection to true in the collection view method cellForItemAtIndexPath: , like this:
now, to count no of selected Items in collection view use code like this (here I am using it in NSLog()) :