简体   繁体   English

如何在本地存储中将 UIImageView 作为数据保存和检索?

[英]How to save and retrieve UIImageView in local storage as Data?

I have made app that parse SVG paths and convert them into CAShapeLayers and add them to UIImageView .我制作了解析SVG路径并将它们转换为CAShapeLayers并将它们添加到UIImageView的应用程序。 I made some changes in it and want to save it for future edit.我对其进行了一些更改,并希望将其保存以供将来编辑。 But I don't know how?但我不知道怎么做? Any way to convert UIImageView as Data?有什么方法可以将 UIImageView 转换为数据?

Try to use: Your_UIImageView.image.pngData()尝试使用:Your_UIImageView.image.pngData()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM