I have the following code on a keyboard extensión
let pasteboard = UIPasteboard.generalPasteboard()
var image = UIImage(named: "myimage");
pasteboard.image = image;
This doesn't work on a UITextView
I have on my container application, paste context menu never shows up. It works on other applications like "messages" but not on mine.
My code works if I try to paste text instead of an image using string
property so I'm quite near.
I could need to set up my text view different but I don't know how. I've changed "Text" from "Plain" to "Attributed" but still not working.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…