user3551029 user3551029 - 4 months ago 37
iOS Question

Action for header in UICollectionView IOS

I have different number of headers in a collection in my code and when I click a header each header has different actions. If I select a cell,

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
method is called. So, is there any delegate method which is called when any supplementary view is selected?


try to add a guesture to your view such as

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]

[headerView addGestureRecognizer:tap];

Place this code where you setUp your HeaderView

and then implement the -(void)handleTapGuesture; method to carry out your actions