Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个照片编辑应用程序,我想为用户提供一种从粘贴板编辑照片的方法。例如,用户可能会在 Safari 中从他的网站复制一张照片,然后转到我的应用程序并选择“从粘贴板打开”。有点像 Photoshop 做的。
如何获得通知或检查粘贴板中是否有图片或图形(可能是 UIImage)?我怎样才能获得该图像?
我需要一个 UIImage 并且这个片段帮助了我。
您始终可以使用以下方法提取图像:
UIImage *image = [UIPasteboard generalPasteboard].image;