2016-08-02 7 views
8

Xcode 8에서 Swift3에 대한 프로젝트를 업데이트했으며이 오류가 발생하지만 내가 무엇을 할 수 있는지 잘 모릅니다. 이미 Google에서 검색했지만 아무것도 설립했습니다. 누구나 내가 할 수있는 아이디어가 있습니까? 여기func collectionViewContentSize in Swift3

오류 :

동일한 오브젝티브 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! 
    } 
와 수퍼 클래스 UICollectionViewLayout '에서'collectionViewContentSize '용 게터와'collectionViewContentSize '충돌 오브젝티브 C 셀렉터 방법'collectionViewContentSize()

답변

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를 다운로드 오늘 Code 8 베타 4를 변경해야합니다.

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

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