how to use writeToFile to save image in document directory?
The problem there is that you are checking if the folder not exists but you should check if the file exists. Another issue in your code is that you need to use url.path instead of url.absoluteString. You are also saving a jpeg image using a “png” file extension. You should use “jpg”. edit/update: Swift 4.2 … Read more