南鑫林 лет назад: 5
Родитель
Сommit
fa7f978629

+ 5 - 7
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditContent/View/PublishEditVideoCoverImageView/PublishEditVideoCoverImageTableViewCell.swift

@@ -98,9 +98,8 @@ class PublishEditVideoCoverImageTableViewCell: UITableViewCell {
     }
     var coverImage : UIImage? {
         didSet {
-            coverImageButton.setImage(coverImage, for: UIControl.State.normal)
-            let imgData: Data? = UIImage.pngData(coverImage!)()
-            do {                
+            do {
+                
                 // 清除图片路径
                 PathURLManager.clearPath(pathURL:
                     PathURLManager.projectPicturesPath(parentURL:
@@ -118,15 +117,14 @@ class PublishEditVideoCoverImageTableViewCell: UITableViewCell {
                                         PathURLManager.projectResourcesPath(parentURL:
                                             PathURLManager.projectRecordssPath(parentURL:
                                                 PathURLManager.projectDocumentPath()))))))!
-                
+                let imgData: Data? = UIImage.pngData(coverImage!)()
                 try imgData?.write(to: outCoverImagePathURL)
                 publishManagerVideoModel?.outCoverImagePath = outCoverImagePathURL.path
                 publishManagerVideoModel?.outCoverImagePathURL = outCoverImagePathURL
-            }
-            catch {
+                coverImageButton.setImage(coverImage, for: UIControl.State.normal)
+            } catch {
                 SwiftProgressHUD.shared().showText("封面写入失败")
                 NXLLog("存入失败")
-                return
             }
         }
     }