I am trying to make a line break to my icon description, and I tried with /n and checking the multiple lines option in the interface builder.
Aqui es donde saco los datos de mi Icon
It should be noted that my icon is a CollectionViewCell that is generated inside a tableViewCell:
extension MiniAppsShorcuts : UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return self.listAr.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "AccesosRapidos", for: indexPath) as? AccesosRapidos else {return UICollectionViewCell()}
cell.labelAR.text = listAr[indexPath.row].name
cell.fetchImage(urlString: listAr[indexPath.row].urlImage)
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
delegate?.alert()
}
}
CodePudding user response:
Make sure to set your cell.labelAR numberOfLines to zero and lineBreakMode to byWordWrapping. The default value is byTruncatingTail. That’s why it is truncating your label. Make sure your label and your cell heights are large enough to have multiple lines.



