ios - How to paste image from pasteboard on UITextView? -
i have following code on keyboard extensión
let pasteboard = uipasteboard.generalpasteboard() var image = uiimage(named: "myimage"); pasteboard.image = image;
this doesn't work on uitextview
have on container application, paste context menu never shows up. works on other applications "messages" not on mine.
my code works if try paste text instead of image using string
property i'm quite near.
i need set text view different don't know how. i've changed "text" "plain" "attributed" still not working.
uitextview
supports pasting text out of box. can subclass , add support pasting images, can implemented using attributed string text attachments.
nshipster's writeup on uimenucontroller
, this stack overflow question explain paste logic.
Comments
Post a Comment