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 } }
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
Post a Comment