Skip to content

Instantly share code, notes, and snippets.

@aheze
Last active February 10, 2020 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aheze/25881416d23955cbdfddfdeef28ebfb9 to your computer and use it in GitHub Desktop.
Save aheze/25881416d23955cbdfddfdeef28ebfb9 to your computer and use it in GitHub Desktop.
let item = provider.items[indexPath.row] as! MyViewModel
let textHeight = item.title.heightWithConstrainedWidth(width: width-24, font: UIFont.systemFont(ofSize: 10))
//Minus 24 points because that is the padding of the edges of the label
let extensionHeight = Double(textHeight) * 0.70
return AdaptiveCollectionConfig.cellBaseHeight + CGFloat(textHeight) + CGFloat(extensionHeight)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment