How do I wrap text around an image in a tableview. Below is a sample of a tableview with image and text, I would like to have the text wrap to the side and below the image.
Asked
Active
Viewed 3,065 times
1 Answers
9
Use UITextView for this,
cell.layoutIfNeeded()
let imageFrame = UIBezierPath(rect: cell.imageView.frame)
cell.textView.textContainer.exclusionPaths = [imageFrame]

Aju Antony
- 639
- 6
- 13
-
2This is correct, however it should be noted that you may first need to convert the frames because their coordinate spaces could be different. How to do so is demonstrated in this answer: https://stackoverflow.com/a/45280820/4442731 – TomQDRS Sep 23 '20 at 09:38