 import AudioToolbox
 import AssetsLibrary
 
+enum GradientSaveState {
+    case Idle
+    case Saving
+    case Saved
+}
+
 class ViewController: UIViewController, UIScrollViewDelegate, UIGestureRecognizerDelegate {
     
-    let kInfoButtonSideLength : CGFloat = 44.0;
-    let kInfoButtonMargin : CGFloat = 10.0;
+    var saveState : GradientSaveState = .Idle
     
     @IBOutlet weak var scrollView : UIScrollView!
     @IBOutlet weak var gradientView : GradientView!

    }
    
    func image(image : UIImage, didFinishSavingWithError error : NSError!, contextInfo : UnsafePointer<Void>) {
        
        if error != nil {
            
            var alertController : UIAlertController?
            
            if error.code == ALAssetsLibraryAccessUserDeniedError || error.code == ALAssetsLibraryAccessGloballyDeniedError {

            }
            
            alertController?.addAction(UIAlertAction(title: NSLocalizedString("close", comment: ""), style: .Cancel, handler: nil))
            self.presentViewController(alertController, animated: true, completion: { () -> Void in
                self.saveState = .Idle
            })
            
        } else {
            self.saveState = .Saved
            self.showSaveIndicator()
        }
    }
    
