Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift

Solution:

If you saved the entire path like file://....png then it is not possible to get the image because document directory path will be dynamic.So better you can save the imagename in your coredata after that below code to get the image.

Code:
let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
      let urls = documentsDirectory.appendingPathComponent(filename)


it will return the url of the image.You can get the image and enjoyyy....

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift