Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func collectionView(_ collectionView: UICollectionView,
- layout collectionViewLayout: UICollectionViewLayout,
- sizeForItemAt indexPath: IndexPath) -> CGSize {
- var str: String = data[indexPath.row]
- let font: UIFont = /*Your Font*/
- let size: CGSize = str.size(withAttributes: [NSAttributedString.Key.font: font])
- return CGSize(width: size.width + 39, height: 45)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement