문자열의 사이즈에 cell의 상하좌우 inset을 더한 만큼을 cell을 그릴 때마다 width로 동적으로 할당하도록 flowLayout을 설정하였다. 코드는 아래와 같다. extension ViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let topBottomInset: CGFloat = 10 let leadingTrailingInset: CGFloat = 20 let cellH..