I save the photo in the photo gallery on the iPhone / iPad, so I call the WriteToSavedPhotosAlbum method.

The message " Saved! " Appears. The photo on the device does not appear

  @IBAction func buttonSavePressed(sender: UIBarButtonItem) { UIImageWriteToSavedPhotosAlbum(imageViewFinal.image!, self, #selector(SaveAfterFilterScreen.image(_:didFinishSavingWithError:contextInfo:)), nil) } func image(image: UIImage, didFinishSavingWithError error: NSError?, contextInfo: UnsafePointer<Void>) { if error == nil { let ac = UIAlertController(title: "Saved!", message: "Фото сохранилось", preferredStyle: .Alert) ac.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) presentViewController(ac, animated: true, completion: nil) } else { let ac = UIAlertController(title: "**Save error**", message: error?.localizedDescription, preferredStyle: .Alert) ac.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) presentViewController(ac, animated: true, completion: nil) } } 
  • What is the error number and what description? - Max Mikheyenko
  • the save code works, error = nil, and the photo does not appear in the collection. Update: corrected the code, the error and the normal operation were interchanged in some places. - Anatoly
  • What do you have in error.localizedDescription? - Max Mikheyenko
  • error.localizedDescription does not appear, error = nil. - Anatoly
  • one
    try to save without processing UIImageWriteToSavedPhotosAlbum(imageViewFinal.image!,nil,nil,nil) - Max Mikheyenko

0