开发者

How to obtain a copied image from the pasteboard?

开发者 https://www.devze.com 2023-04-06 04:01 出处:网络
I have a photo editing app where I want to provide a way for the user to edit photos from the pasteboard. For example the user might copy a photo from his websit开发者_开发问答e in Safari and then hea

I have a photo editing app where I want to provide a way for the user to edit photos from the pasteboard. For example the user might copy a photo from his websit开发者_开发问答e in Safari and then head over to my app and choose "Open from pasteboard". Kind of like Photoshop does it.

How can I get notified or check if there is a picture or graphic (probably a UIImage) in the pasteboard? And how could I obtain that image?


I needed one for a UIImage and this snippet helped me out.

You can always extract the image out using:

UIImage *image = [UIPasteboard generalPasteboard].image;
0

精彩评论

暂无评论...
验证码 换一张
取 消