美文网首页
Swift中UIImageWriteToSavedPhotosA

Swift中UIImageWriteToSavedPhotosA

作者: 漩涡长门 | 来源:发表于2017-10-31 16:33 被阅读14次
    • 方法调用 此处的save和方法实现中要保持一致
    UIImageWriteToSavedPhotosAlbum(img, self, #selector(save(image:didFinishSavingWithError:contextInfo:)), nil)
    
    • 方法实现
       func save(image:UIImage, didFinishSavingWithError:NSError?,contextInfo:AnyObject) {
            
            if didFinishSavingWithError != nil {
                SVProgressHUD.showError(withStatus: "保存失败")
                SVProgressHUD.setDefaultMaskType(SVProgressHUDMaskType.black)
            } else {
                SVProgressHUD.showSuccess(withStatus: "保存成功")
                SVProgressHUD.setDefaultMaskType(SVProgressHUDMaskType.black)
            }
        }
    

    相关文章

      网友评论

          本文标题:Swift中UIImageWriteToSavedPhotosA

          本文链接:https://www.haomeiwen.com/subject/pfibpxtx.html