//To implement multiple selection, this method must be implemented
self.collectionView.allowsMultipleSelection = YES;
#pragma mark - Returns whether this UICollectionView can be selected
-(BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
#pragma mark - click event
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
NSLog ( @"Click cell %@" ,indexPath);
FindFuWuCell * cell = (FindFuWuCell *)[collectionView cellForItemAtIndexPath:indexPath];
cell.btnLabel.textColor =BaseRedColor;
NSLog(@" id %@ ",cell.data.id);
}
- (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"取消cell %@",indexPath);
FindFuWuCell * cell = (FindFuWuCell *)[collectionView cellForItemAtIndexPath:indexPath];
cell.btnLabel.textColor =BaseBlackTextColor;
}