     }
     /// save
     func save(){
+        // 判断是否需要进行保存
         // 根据索引计算当前浏览的图片
-        let index = calculateIndex()
+        var index = calculateIndex()
         let photo = self.photoes![index]
         // 获取具体图片，因为能点击肯定已经得到大图
         let image = SDWebImageManager.sharedManager().imageCache.imageFromDiskCacheForKey(photo.largeURL.absoluteString)

        let index = calculateIndex()
        let photo = self.photoes![index]
        saveBtn.enabled = SDWebImageManager.sharedManager().cachedImageExistsForURL(photo.largeURL)
    }
    
}

    /// 开始缩放的通知方法
    func didScale(noti : NSNotification){
        let scale = noti.userInfo!["scale"] as! CGFloat
        let index = noti.userInfo!["index"] as! Int
        let photo = photoes![index]
        // 隐藏关闭按钮
        closeBtn.hidden = scale < dismissScale
        // 如果不需要保存按钮，会一直隐藏
        saveBtn.hidden = scale < dismissScale || !needSaveButton || photo.isSaved
        collectionView.backgroundView?.alpha = scale
    }
    /// 检查按钮
