Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. func collectionView(_ collectionView: UICollectionView,
  2. layout collectionViewLayout: UICollectionViewLayout,
  3. sizeForItemAt indexPath: IndexPath) -> CGSize {
  4.  
  5. var str: String = data[indexPath.row]
  6. let font: UIFont = /*Your Font*/
  7. let size: CGSize = str.size(withAttributes: [NSAttributedString.Key.font: font])
  8.  
  9. return CGSize(width: size.width + 39, height: 45)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement