我真的需要,真的很有帮助
我将Image保存到DocumentDirectory中如何拍摄此图像并放入UIImageView?
照片网址:
文件:///Users/zoop/Library/Developer/CoreSimulator/Devices/3E9FA5C0-3III-41D3-A6D7-A25FF3424351/data/Containers/Data/Application/7C4D9316-5EB7-4A70-82DC-E76C654EA201/Documents/profileImage.png
3 回答
尝试类似的东西:
然后你可以把
image
放到UIImageView
.Other option (正如Leo Dabus在评论中提到的那样):
您可以使用NSFileManager的方法URLForDirectory来获取文档目录url和URLByAppendingPathComponent以将文件名附加到原始URL:
在Swift 4.2中: