From dba18dd5d79e501747a81ed25ff8bb53d2efdff4 Mon Sep 17 00:00:00 2001 From: Alexander Munch-hansen Date: Tue, 1 Aug 2017 13:44:48 +0200 Subject: [PATCH] Fixed animation slightly --- dcav-uploader/ViewController.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dcav-uploader/ViewController.swift b/dcav-uploader/ViewController.swift index acff9ff..5f130ba 100644 --- a/dcav-uploader/ViewController.swift +++ b/dcav-uploader/ViewController.swift @@ -56,12 +56,16 @@ class ViewController: UIViewController, UINavigationControllerDelegate, UIImageP @IBAction func onSaveButton(_ sender: Any) { UIImageWriteToSavedPhotosAlbum(imageView.image!, nil, nil, nil); - UIView.animate(withDuration: 0.5, delay:0.0, options:UIViewAnimationOptions.transitionFlipFromTop, animations: { - self.savedPhotoImageView.isHidden = false + + self.savedPhotoImageView.alpha = 0 + self.savedPhotoImageView.isHidden = false + + UIView.animate(withDuration: 0.3, delay:0.0, options:UIViewAnimationOptions.transitionCrossDissolve, animations: { + self.savedPhotoImageView.alpha = 1 }, completion: { finished in - UIView.animate(withDuration: 0.5, delay:1, options:UIViewAnimationOptions.transitionCrossDissolve, animations: { + UIView.animate(withDuration: 0.3, delay:1, options:UIViewAnimationOptions.transitionCrossDissolve, animations: { self.savedPhotoImageView.alpha = 0 }, completion: { finished in