Q:

How can I set image in textDocumentProxy with custom keyboard extension iOS 8?

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!

A:

I have get solution for this question use clipboard copy and paste 
Code :
UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
NSData *data = [self.Videoassets objectAtIndex:btn.tag];
NSLog(@"File size is : %.2f MB",(float)data.length/1024.0f/1024.0f);
[pasteBoard setData:data forPasteboardType:@"public.mpeg-4"];

