I've successfully been using NSTextAttachment
s in a UITextView
for some time, however only ever using the image
property, like so:
NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithData:nil ofType:nil];
attachment.image = [UIImage imageNamed:@"someImage"];
I'm interested to try using the initWithData:ofType:
, however I can't seem to find any documentation that describes what kind of NSData
the NSTextAttachment
class supports that can be rendered in a UITextView
.
For instance, can I pass data of an NSString
or some kind of UIView
? Or even a PDF? Or is it limited to actually be UIImage
data?