2016-09-22 3 views
1

私はSWIFT 3に私のプロジェクトを変換するが、私のコードに次のエラーを取得しようとしています:はスウィフト非機能型の値を呼び出すことはできません3

コード:

super.collectionView(collectionView, willDisplayCell: cell, forItemAtIndexPath: indexPath) 

エラー:

非機能型の値を呼び出すことはできません 'uicollectionview'

誰でも迅速な3編集を知っていますか?

答えて

0

あなたがUICollectionViewControllerをサブクラス化している場合は、この使用することができるはず:あなたはおそらくこれを使用する必要がありますUICollectionViewControllerをサブクラス化されていない場合は

override func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { 
    super.collectionView(collectionView, willDisplay: cell, forItemAt: indexPath) 
} 

を:

@objc(collectionView:willDisplayCell:forItemAtIndexPath:) func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { 

} 

私は両方持っています私が更新している私のアプリのコレクションビューの種類は、それが私のために働くものです。

関連する問題