viewForSupplementaryElementOfKind
içinde bir seçim nasıl tanınır? header
içindeki düğmeye bir hedef eklemeyi denedim, ancak çalışmaz. Seçim eylemi didSelectItemAtIndexPath
'a mı gönderildi yoksa başka bir şey var mı? başlık bütün elemanlar bir 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()
}
}