ios - 从 UIImage 获取图像路径
问题描述
我有动态生成的uiimage代码:
for product in self.productObject {
if product.code != nil{
self.imageView1.image = UIImage(contentsOfFile: documentsDir.appendingPathComponent("myfiles").path + "/" + product.code! + ".jpg")
}
}
我需要在按钮中获取当前显示图像的路径:
@IBAction func showImagesInPopup(_ sender: Any) {
var path = self.imageView1.image.path
self.performSegue(withIdentifier: "toProductDetail", sender: self)
}
我怎样才能得到它并保存到“路径”?
解决方案
推荐阅读
- python - 使用 Displacy 为自定义实体显示自定义颜色
- javascript - Nodejs反应无法在前端获取数据
- asp.net - 将 NGINX 映射到同一个端口
- php - 如果不需要继承,网站应该如何是 OOP
- java - MulticastChannel.join 在旧 Android 版本上等效
- r - 使用 apply 和 data.table 在 R 中自动进行 num-to-char 转换
- javascript - Wavesurfer 播放器中的小吃店方向问题是什么?
- java - Android Studio:如何将铃声/通知/闹钟音频文件写入存储并在设置中查看
- javascript - 我可以根据触发方式设置函数以使用不同的变量吗?
- python - 如何在 print() 语句中指定编码?