user3551029 user3551029 - 1 year ago 94
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download