Skip to content

Instantly share code, notes, and snippets.

@factoryhr
Last active January 28, 2020 07:21
Show Gist options
  • Save factoryhr/aa0ee8d5c3e8715d046525461af08999 to your computer and use it in GitHub Desktop.
Save factoryhr/aa0ee8d5c3e8715d046525461af08999 to your computer and use it in GitHub Desktop.
override func prepare(){
//Here we calculate all the dimensions we need for our collection view
//Stuff like item height, item width and collection view size
//We create x and y offsets for our items based on their collection position
//Also we create layout attributes for each item inside our collection view
//Layout attributes are cached so we wouldn’t need to recalculate them
//every time attribute is requested
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment