Parcourir la source

修复了分享保存图片闪退的问题

南鑫林 il y a 5 ans
Parent
commit
adb7a36fab

+ 18 - 5
RainbowPlanet/Podfile.lock

@@ -26,6 +26,14 @@ PODS:
   - Cache (5.2.0)
   - DeviceKit (2.3.0)
   - DPScrollNumberLabel (0.0.2)
+  - EFFoundation (1.1.1):
+    - EFFoundation/Core (= 1.1.1)
+  - EFFoundation/Core (1.1.1)
+  - EFQRCode (5.1.3):
+    - EFFoundation (>= 1.1.1)
+    - EFQRCode/Core (= 5.1.3)
+  - EFQRCode/Core (5.1.3):
+    - EFFoundation (>= 1.1.1)
   - ESTabBarController-swift (2.7)
   - FBRetainCycleDetector (0.1.4)
   - FMDB (2.7.5):
@@ -42,9 +50,9 @@ PODS:
   - JXPagingView/Paging (1.1.18)
   - JXSegmentedView (1.0.0)
   - KeychainAccess (3.2.0)
-  - Kingfisher (5.8.2):
-    - Kingfisher/Core (= 5.8.2)
-  - Kingfisher/Core (5.8.2)
+  - Kingfisher (5.8.3):
+    - Kingfisher/Core (= 5.8.3)
+  - Kingfisher/Core (5.8.3)
   - lottie-ios (3.1.3)
   - LYEmptyView (1.3.1)
   - Masonry (1.1.0)
@@ -115,6 +123,7 @@ DEPENDENCIES:
   - Cache
   - DeviceKit
   - DPScrollNumberLabel
+  - EFQRCode
   - ESTabBarController-swift
   - FMDB
   - FSPagerView
@@ -171,6 +180,8 @@ SPEC REPOS:
     - Cache
     - DeviceKit
     - DPScrollNumberLabel
+    - EFFoundation
+    - EFQRCode
     - ESTabBarController-swift
     - FBRetainCycleDetector
     - FMDB
@@ -225,6 +236,8 @@ SPEC CHECKSUMS:
   Cache: 807c5d86d01a177f06ede9865add3aea269bbfd4
   DeviceKit: da103891aa928d89f64ea8dd8aca738c5f3d8ac0
   DPScrollNumberLabel: 5124eaccf3029bb84116de391e1273cba676f4f5
+  EFFoundation: 26a2731ace3e22cf5f7bb45d28c6afbc945959dd
+  EFQRCode: 0979a5c181864085ca7f317b5b5c7b5bf496ad0e
   ESTabBarController-swift: 4fb52ad03d94d0717ef97bc9eb09a5abfdded0a2
   FBRetainCycleDetector: 46f8179bbb1c587deee3ea838a1a3ee02acf5015
   FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
@@ -236,7 +249,7 @@ SPEC CHECKSUMS:
   JXPagingView: 34bc70f962404e1a0b092ef643e5ccf6882119b2
   JXSegmentedView: 257773dde0c65f86c9d873c5cf93d15c76e170cc
   KeychainAccess: 3b1bf8a77eb4c6ea1ce9404c292e48f948954c6b
-  Kingfisher: 3adc15096595f5aed800bb0d5cb757fc58b2d2dd
+  Kingfisher: b7e4cb65ff24c264bd2a1284b75b974d907afd94
   lottie-ios: 496ac5cea1bbf1a7bd1f1f472f3232eb1b8d744b
   LYEmptyView: b6d418cfa38b78df0cf243f9a9c25ccbdc399922
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
@@ -267,6 +280,6 @@ SPEC CHECKSUMS:
   YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
   ZipArchive: e25a4373192673e3229ac8d6e9f64a3e5713c966
 
-PODFILE CHECKSUM: 936090887b8a98ea9318ed9a5a733e4067b0267f
+PODFILE CHECKSUM: fa8985395108aa20bb347e27985833a61a1cf96b
 
 COCOAPODS: 1.8.3

+ 4 - 2
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityShareContent/CommunityShareContentViewController.swift

@@ -7,7 +7,7 @@
 //
 
 import UIKit
-//import EFQRCode
+import EFQRCode
 import Kingfisher
 
 class CommunityShareContentViewController: BaseViewController {
@@ -129,7 +129,9 @@ class CommunityShareContentViewController: BaseViewController {
         topicLabel.text = "#\(topicStr)#"
         titleLabel.text = titleStr
         nameLable.text = nameStr ?? ""
-        QRCodeImageView.image = QRCode.createQRForString(qrString: H5UrlStr, qrImageName: "")
+        if let cgImage = EFQRCode.generate(content: H5UrlStr ?? "") {
+            QRCodeImageView.image = UIImage(cgImage: cgImage)
+        }
         scanLabel.text = "扫码查看内容  开启国风之旅"
         
         avatarImageView.kf.setImage(with: kURLImage(name: avatarStr ?? ""), placeholder:  kImage(name: "default_pic"), completionHandler: { [weak self] (result) in