This seems to do the trick:
UIBezierPath * imgRect = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 100, 100)];
self.textView.textContainer.exclusionPaths = @[imgRect];
Works only from iOS 7 and up.
More Related Contents:
- How can I make a clickable link in an NSAttributedString?
- Is it possible to change color of single word in UITextView and UITextField
- UITextView: Disable selection, allow links
- Bold & Non-Bold Text In A Single UILabel?
- Detecting taps on attributed text in a UITextView in iOS
- Difference between UIViewContentModeScaleAspectFit and UIViewContentModeScaleToFill?
- How to compare UIColors?
- Add “…Read More” to the end of UILabel
- Add placeholder text inside UITextView in Swift?
- How to assign an action for UIImageView object in Swift
- How can I use IBOutletCollection to connect multiple UIImageViews to the same outlet?
- How can I detect the touch event of an UIImageView?
- Loading an image into UIImage asynchronously
- With Auto Layout, how do I make a UIImageView’s size dynamic depending on the image?
- UIGestureRecognizer on UIImageView
- How do you make a vertical text UILabel and UITextView for iOS in Swift?
- Tap on a part of text of UILabel
- UILabel: wrap and/or break inside word(s) with hyphen(s)
- Keyboard and cursor show, but I can’t type inside UITextFields and UITextViews
- How to animate the change of image in an UIImageView?
- iOS – UIImageView – how to handle UIImage image orientation
- how to make UITextView height dynamic according to text length?
- Storing images locally on an iOS device
- add UIImage in CALayer
- How to know that if the only visible area of a .png is touched in Xcode
- How to asynchronously load an image in an UIImageView?
- How do you create a UIImage View Programmatically – Swift
- Change UIImageView size to match image with AutoLayout
- iOS: Update launch screen dynamically
- Two colors for UILabel TEXT