2016-08-02 3 views
8

Xcode 8でSwift3にプロジェクトを更新しましたが、このエラーが発生しますが、私はそこで何ができるのか分かりません。私はすでにGoogleで検索していますが、何も見つかりませんでした。 アイデアを誰にも作ってもらえますか?func collectionViewContentSize in Swift3

ここでエラー:

方法スーパークラスから 'collectionViewContentSize' のゲッターとのObjective-Cセレクタ 'collectionViewContentSize' 競合と 'collectionViewContentSize()' 'UICollectionViewLayout' は、同じObjective-Cのセレクタと

public func collectionViewContentSize() -> CGSize { 
     let numberOfSections = collectionView?.numberOfSections 
     if numberOfSections == 0 { 
      return CGSize.zero 
     } 

     var contentSize = collectionView?.bounds.size 
     contentSize?.height = CGFloat(columnHeights[0]) 

     return contentSize! 
    } 

答えて

33

私は似たようなを持っていたが、私はcollectionViewContentSize()

override func collectionViewContentSize() -> CGSize { 
    let collection = collectionView! 
    let width = collection.bounds.size.width 
    let height = max(posYColumn1, posYColumn2) 

    return CGSize(width: width, height: height) 
} 

をオーバーライドして、私はXをダウンロードコード8ベータ4を今日変更し、それを次のように変更しなければなりませんでした: