ios - Get image name UIImagePickerController in Swift -
i use uiimagepickercontroller image phone library (ios). after edit mode put image uiimageview. want save image in core data use in view controllers how can in swift. if not possible options have save image ? another option can save image document directory of app , can retrieve image anywhere shown in below code: func imagepickercontroller(picker: uiimagepickercontroller, didfinishpickingmediawithinfo info: [nsobject : anyobject]) { self.dismissviewcontrolleranimated(true, completion: nil) let tempimage = info[uiimagepickercontrolleroriginalimage] as! uiimage // save image here document directory saveimage(tempimage, path: fileindocumentsdirectory("tempimage")) } here helper functions: func saveimage (image: uiimage, path: string ) -> bool{ let pngimagedata = uiimagepngrepresentation(image) //let jpgimagedata = uiimagejpegrepresentation(image, 1.0) // if want save jpeg let result = pngimagedata.writetofile(path, atomic...