【发布时间】:2018-04-14 00:14:19
【问题描述】:
我想使用didSelectItemAtIndexPath,但它不起作用。
collection_contactus.allowsSelection = true
collection_options.allowsSelection = true
collection_options!.dataSource = self
collection_options!.delegate = self
collection_contactus!.dataSource = self
collection_contactus!.delegate = self
func collectionView(_ collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("test")
// if(collectionView == collection_options)
// {
//
// }else{
// print("test: \(indexPath)")
// }
}
我看不到任何输出。
【问题讨论】:
-
使用正确的方法签名会有很大帮助。
标签: ios swift uicollectionview