title: i want to save image in specific folder from UIImageView swift 3
body: <p>i want to save image from imageview to specific folder Image is coming from Sqlserver. and i want to save link of it in sqlite for further processing i have written this code which is saving image in document directory but every time path is different. Please tell me what to do ?</p>
  
  <pre><code> let imageData = UIImagePNGRepresentation(imageee.image!)!
          let docDir = try! FileManager.default.url(for: .picturesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
          let imageURL = docDir.appendingPathComponent("tmp.png")
          try! imageData.write(to: imageURL)
  
          print(imageURL.path)
          let newImage = UIImage(contentsOfFile: imageURL.path)!
         //aftersave.image = newImage
          aftersave.image = newImage
  </code></pre>