How can we set an image behalf of the text?
Following code is to display text in the input view:
[self.textDocumentProxy insertText:[key currentTitle]];
My code of paste board to display the image :
NSData *imgData = UIImagePNGRepresentation(image);
[pasteBoard setData:imgData forPasteboardType:[UIPasteboardTypeListImage objectAtIndex:0]];
NSString* newStr = [[NSString alloc] initWithData:imgData encoding:NSUTF8StringEncoding];
[self.textDocumentProxy insertText:[pasteBoard string]];
I have created a pasteboard with the images just I have to display the images in to input view.
See this picture for the concept :
Note:
I have to select image from keyboard and show in inputview not to copy paste from library.
If anyone know please reply as answer or any suggestion will also acceptable.
Thanks!