iOS 7 TextKit - How to insert images inline with text?
iOS 7 TextKit - How to insert images inline with text? I am trying to get the following effect using a UITextView: Basically I want to insert an image between text. The image can simply just take up 1 row of space so there is no wrapping necessary. I tried just adding a UIView to the subview: UIView *pictureView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 25, 25)]; [pictureView setBackgroundColor:[UIColor redColor]]; [self.textView addSubview:pictureView]; But it seems to float over the text and cover it. I did a bit of reading on exclusion paths which appears to be one way of implementing this. However, I don't want to absolutely position the image - instead, it should flow with the text (similar to how <span> behaves in HTML). <span> A few of the answers mention using the image properties on NSTextAttachment and NSTextField but I want to mention that I need a solution which allows me to append a UIView. – Andy Hin...
