Explorar el Código

修改bundle路径

harry hace 3 años
padre
commit
af6f1aefaf

+ 2 - 6
BFFramework/Classes/Base/BFFrameworkConfig.swift

@@ -8,15 +8,11 @@
 import Foundation
 
 public func bfFramworkImage(by name: String) -> UIImage? {
-    
-    guard let url = currentBundle()?.url(forResource: "BFFramework_Resources", withExtension: "bundle") else {
-        return nil
-    }
-    return UIImage(named: name, in: Bundle(url: url), compatibleWith: nil)
+    return UIImage(named: name, in: currentBundle(), compatibleWith: nil)
 }
 
 func currentBundle() -> Bundle? {
-    return Bundle(for: BFFrameworkConfig.self)
+    return Bundle.current(moduleName: "BFFramework", isAssets: false)
 }
 
 class BFFrameworkConfig {

+ 4 - 2
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -309,7 +309,7 @@ class PQStuckPointEditerController: BFBaseViewController {
     lazy var pointEditerBtn: UIButton = {
         let pointEdterBtn = UIButton(type: .custom)
        
-        pointEdterBtn.setImage(UIImage.moduleImage(named: "pointEditerBtn_n", moduleName: "BFFramework", isAssets: false), for: .normal)
+        pointEdterBtn.setImage(bfFramworkImage(by: "pointEditerBtn_n"), for: .normal)
          
         pointEdterBtn.setImage(UIImage.moduleImage(named: "pointEditerBtn_h", moduleName: "BFFramework", isAssets: false)?.withRenderingMode(.alwaysTemplate), for: .selected)
         pointEdterBtn.tintColor = UIColor.hexColor(hexadecimal: BFConfig.shared.styleColor.rawValue)
@@ -1121,7 +1121,9 @@ class PQStuckPointEditerController: BFBaseViewController {
 
         let beginTime = Date()
         dealParameter(model: currentCreateStickersModel)
-        
+        if finallyStuckPoints.count < 2 {
+            return
+        }
         // 更新裁剪时间条的的ui数据
         stuckPointCuttingView.videoDuration = max(CGFloat(finallyUserAudioTime), CGFloat(finallyStuckPoints.last!))
         let counn = (stuckPointMusicData?.rhythmSdata[0].pointTimes.count)! - 2

+ 1 - 1
BFFramework/Classes/Stuckpoint/View/PQStuckPointMusicContentCell.swift

@@ -15,7 +15,7 @@ class PQStuckPointMusicContentCell: UICollectionViewCell {
     var contentType: stuckPointMusicContentType = .catagery
 
     lazy var audioImageView: UIImageView = {
-         let audioImageView = UIImageView(image:bfFramworkImage(by: "videomk_music_default")!)
+         let audioImageView = UIImageView(image:bfFramworkImage(by: "videomk_music_default"))
         audioImageView.addCorner(corner: 4)
         audioImageView.contentMode = .scaleAspectFill
         return audioImageView