Swift 3 and Xcode 8 : Get Image From URL Path Stored in SQLITE Database Field -


i have implemented following code add image document directory , store path in sqlite database

func imagepickercontroller(_ picker: uiimagepickercontroller, didfinishpickingimage image: uiimage, editinginfo: [string : anyobject]?) {          imagepath = imagesdirectorypath + "/\(date().description.replacingoccurrences(of: " ", with: "")).png"         print(imagepath)          let data = uiimagepngrepresentation(image)         print(data!)         let success = filemanager.default.createfile(atpath: imagepath, contents: data, attributes: nil)         print(success)         dismiss(animated: true) { () -> void in          }     } 

can me how image tableview using path shown in image.

in table view cellforrowat method or in ur case if u want display image in other case

you can by

let imageurl = url(fileurlwithpath: student.image_url) cell.imgprofiledisplay.image = uiimage(contentsoffile: imageurl.path) 

this convert image url store in our database.

for full source code of implementation kindly comment. thanks


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -