Skip to content

Instantly share code, notes, and snippets.

@wingchi
Created May 5, 2018 22:08
Show Gist options
  • Select an option

  • Save wingchi/40da088b12dc976c8945cfb217c16c99 to your computer and use it in GitHub Desktop.

Select an option

Save wingchi/40da088b12dc976c8945cfb217c16c99 to your computer and use it in GitHub Desktop.
Logic for full width cell sizing
func cellSize(for frame: CGRect, at indexPath: IndexPath) -> CGSize {
let height = (frame.height / 5) - 2 * GridViewModel.itemMargin
let fullWidth = frame.width - 2 * GridViewModel.itemMargin
return CGSize(width: fullWidth, height: height)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment