George L
George L

Reputation: 1738

UIButtons in UICollectionReusableView header

I am trying to add a few UIButtons to a collectionviews header, but am having difficulties discovering which header is pressed. Any suggestions?

Upvotes: 0

Views: 245

Answers (1)

Mika
Mika

Reputation: 5845

If you are adding the UIButtons programmatically the fastest is to add a tag with the section to the button.

UIButton.tag = x //where x is the section number

Then in the action you can check the tag.

Upvotes: 2

Related Questions