Wie wird eine Auswahl innerhalb einer viewForSupplementaryElementOfKind
erkannt? Ich habe versucht, ein Ziel der Schaltfläche innerhalb der header
hinzufügen, aber das funktioniert nicht. Wird die Auswahlaktion an didSelectItemAtIndexPath
gesendet oder gibt es noch etwas anderes? Alle Elemente, die Header sind innerhalb eines UIStackView
UICollectionView viewForSupplementaryElementOfKind didSelect
override func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
if kind == UICollectionElementKindSectionHeader {
let cell = collectionView.dequeueReusableSupplementaryViewOfKind(UICollectionElementKindSectionHeader, withReuseIdentifier: "header", forIndexPath: indexPath) as! mainCell
let index = indexPath.section
cell.btnImg.af_setBackgroundImageForState(.Normal, URL: NSURL(string: "urrl")!)
cell.userImg.addTarget(self, action: #selector(MainController.showNextView(_:)), forControlEvents: .TouchUpInside)
let tap = UIGestureRecognizer(target: self, action: #selector(self.test))
cell.addGestureRecognizer(tap)
return cell
} else {
return UICollectionReusableView()
}
}