//项目所需要的数据结构
struct ImageSource {
var img: UIImage
var title: String
init(img: UIImage, title: String) {
self.img = img
self.title = title
}
}
//Set方法
var familyImgsSource:[ImageSource] = [] {
didSet{
collectionView.reloadData()
}
}
//相册或者拍照的代理方法
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
var selectedImage:UIImage? = info[UIImagePickerController
Swift -- 将本地生成的UIImage进行持久化保存(存到文件中fileManager.createFile)
最新推荐文章于 2020-12-20 17:17:03 发布