0

I'm doing this asyncDisplayKit tutorial for a collection view of images.

http://www.tekramer.com/improving-uicollectionview-uitableview-scrolling-performance-with-asyncdisplaykit/

I can run the finished project and everything works fine. I copied all the code exactly the same into another project which I am combining multiple tutorials. For some reason I get 1 error. This is odd since it includes every file and I copied and pasted them all perfectly. This is where I get the error:

override func calculateLayoutThatFits(constrainedSize: ASSizeRange) -> ASLayout {
        return ASLayout(layoutableObject: self, size: nodeSize)
    }

The error says that the layout arguments should be layout and position, but if I change it then it can't use self as the layout. Anyone know what is going on here?

Wayne Filkins
  • 494
  • 6
  • 20

1 Answers1

1

Swift 3.0

Please try this. This function works for my project.

override func calculateLayoutThatFits(_ constrainedSize: ASSizeRange) -> ASLayout {
   return ASLayout(layoutableObject: self, constrainedSizeRange: ASSizeRangeMake(nodeSize, nodeSize), size: nodeSize)
}
Durul Dalkanat
  • 7,266
  • 4
  • 35
  • 36