Просмотр исходного кода

Merge branch 'master' of https://git.yishihui.com/iOS/BFCommonKit

wenweiwei 3 лет назад
Родитель
Сommit
743f0807ac
39 измененных файлов с 73 добавлено и 265 удалено
  1. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_h.imageset/Contents.json
  2. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_h.imageset/jumpPoint_h@2x.png
  3. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_h.imageset/jumpPoint_h@3x.png
  4. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_n.imageset/Contents.json
  5. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_n.imageset/jumpPoint_n@2x.png
  6. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_n.imageset/jumpPoint_n@3x.png
  7. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_h.imageset/Contents.json
  8. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_h.imageset/musicEditerBtn_h@2x.png
  9. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_h.imageset/musicEditerBtn_h@3x.png
  10. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_n.imageset/Contents.json
  11. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_n.imageset/musicEditerBtn_n@2x.png
  12. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_n.imageset/musicEditerBtn_n@3x.png
  13. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_h.imageset/Contents.json
  14. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_h.imageset/onlyMusic_h@2x.png
  15. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_h.imageset/onlyMusic_h@3x.png
  16. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_n.imageset/Contents.json
  17. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_n.imageset/onlyMusic_n@2x.png
  18. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_n.imageset/onlyMusic_n@3x.png
  19. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_h.imageset/Contents.json
  20. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_h.imageset/pointEditerBtn_h@2x.png
  21. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_h.imageset/pointEditerBtn_h@3x.png
  22. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_n.imageset/Contents.json
  23. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_n.imageset/pointEditerBtn_n@2x.png
  24. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_n.imageset/pointEditerBtn_n@3x.png
  25. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/sliderTHBPin.imageset/Contents.json
  26. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/sliderTHBPin.imageset/sliderTHBPin@2x.png
  27. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/sliderTHBPin.imageset/sliderTHBPin@3x.png
  28. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_h.imageset/Contents.json
  29. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_h.imageset/speedstuck_h@2x.png
  30. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_h.imageset/speedstuck_h@3x.png
  31. 0 22
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_n.imageset/Contents.json
  32. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_n.imageset/speedstuck_n@2x.png
  33. BIN
      BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_n.imageset/speedstuck_n@3x.png
  34. 1 1
      BFCommonKit/Classes/BFBase/Controller/PQBaseWebViewController.swift
  35. 1 1
      BFCommonKit/Classes/BFBase/Model/PQBaseModel.swift
  36. 2 2
      BFCommonKit/Classes/BFBase/View/PQRemindView.swift
  37. 9 0
      BFCommonKit/Classes/BFCategorys/BFColor+Ext.swift
  38. 16 0
      BFCommonKit/Classes/BFConfig/PQBFConfig.swift
  39. 44 19
      BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_h.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "jumpPoint_h@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "jumpPoint_h@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_h.imageset/jumpPoint_h@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_h.imageset/jumpPoint_h@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_n.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "jumpPoint_n@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "jumpPoint_n@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_n.imageset/jumpPoint_n@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/jumpPoint_n.imageset/jumpPoint_n@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_h.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "musicEditerBtn_h@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "musicEditerBtn_h@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_h.imageset/musicEditerBtn_h@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_h.imageset/musicEditerBtn_h@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_n.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "musicEditerBtn_n@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "musicEditerBtn_n@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_n.imageset/musicEditerBtn_n@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/musicEditerBtn_n.imageset/musicEditerBtn_n@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_h.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "onlyMusic_h@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "onlyMusic_h@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_h.imageset/onlyMusic_h@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_h.imageset/onlyMusic_h@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_n.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "onlyMusic_n@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "onlyMusic_n@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_n.imageset/onlyMusic_n@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/onlyMusic_n.imageset/onlyMusic_n@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_h.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "pointEditerBtn_h@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "pointEditerBtn_h@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_h.imageset/pointEditerBtn_h@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_h.imageset/pointEditerBtn_h@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_n.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "pointEditerBtn_n@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "pointEditerBtn_n@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_n.imageset/pointEditerBtn_n@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/pointEditerBtn_n.imageset/pointEditerBtn_n@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/sliderTHBPin.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "sliderTHBPin@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "sliderTHBPin@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/sliderTHBPin.imageset/sliderTHBPin@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/sliderTHBPin.imageset/sliderTHBPin@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_h.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "speedstuck_h@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "speedstuck_h@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_h.imageset/speedstuck_h@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_h.imageset/speedstuck_h@3x.png


+ 0 - 22
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_n.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "speedstuck_n@2x.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "speedstuck_n@3x.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_n.imageset/speedstuck_n@2x.png


BIN
BFCommonKit/Assets/Resources/BFCommonKit.xcassets/speedstuck_n.imageset/speedstuck_n@3x.png


+ 1 - 1
BFCommonKit/Classes/BFBase/Controller/PQBaseWebViewController.swift

@@ -14,7 +14,7 @@ open class PQBaseWebViewController: PQBaseViewController {
     public var emptyData: PQEmptyModel? = {
         let emptyData = PQEmptyModel()
         emptyData.title = "网页加载失败,请重试~"
-        emptyData.emptyImage = "pic_network"
+        emptyData.emptyImageName = "pic_network"
         emptyData.netDisRefreshBgColor = UIColor.hexColor(hexadecimal: "#FA6400")
         emptyData.netDisTitle = "内容加载失败"
         emptyData.netDisTitleColor = UIColor.hexColor(hexadecimal: "#333333")

+ 1 - 1
BFCommonKit/Classes/BFBase/Model/PQBaseModel.swift

@@ -184,7 +184,7 @@ public class PQEmptyModel: NSObject {
     public var titleColor: UIColor? // 标题颜色
     public var summary: String? // 描述
     public var summaryColor: UIColor? // 描述颜色
-    public var emptyImage: String? // 空白提示图
+    public var emptyImageName: String? // 空白提示图
     public var emptySoureImage: UIImage? // 空白提示图
     public var isRefreshHidden: Bool = true // 是否隐藏刷新按钮
     public var refreshImage: String? // 刷新按钮图片

+ 2 - 2
BFCommonKit/Classes/BFBase/View/PQRemindView.swift

@@ -323,7 +323,7 @@ extension PQEmptyRemindView {
 //            }
             remindSubLab.isHidden = !(emptyData?.title != nil && emptyData?.title?.count ?? 0 > 0)
             remindSubLab.isHidden = !(emptyData?.summary != nil && emptyData?.summary?.count ?? 0 > 0)
-            imageView.image = emptyData?.emptySoureImage ?? UIImage.moduleImage(named: emptyData?.emptyImage ?? "", moduleName: "BFCommonKit")
+            imageView.image = emptyData?.emptySoureImage ?? UIImage.moduleImage(named: emptyData?.emptyImageName ?? "", moduleName: "BFCommonKit")
             remindLab.text = emptyData?.title
             remindSubLab.text = emptyData?.summary
             refreshBtn.isHidden = emptyData?.isRefreshHidden ?? true
@@ -352,7 +352,7 @@ extension PQEmptyRemindView {
         var contentH: CGFloat = 0
         let normalH : CGFloat = margin * 2
         
-        if (emptyData?.emptySoureImage != nil) || (emptyData?.emptyImage != nil &&  emptyData?.emptyImage?.count ?? 0 > 0) || isNetLost {
+        if (emptyData?.emptySoureImage != nil) || (emptyData?.emptyImageName != nil &&  emptyData?.emptyImageName?.count ?? 0 > 0) || isNetLost {
             contentH = contentH + imageH
         } else {
             imageH = 0

+ 9 - 0
BFCommonKit/Classes/BFCategorys/BFColor+Ext.swift

@@ -101,6 +101,15 @@ public extension UIColor {
         getRed(&red, green: &green, blue: &blue, alpha: &alpha)
         return [Int(red * 255.0), Int(green * 255.0), Int(blue * 255.0), Int(alpha)]
     }
+    
+    var rgbaf: [CGFloat] {
+        var red: CGFloat = 0
+        var green: CGFloat = 0
+        var blue: CGFloat = 0
+        var alpha: CGFloat = 0
+        getRed(&red, green: &green, blue: &blue, alpha: &alpha)
+        return [ red, green, blue,alpha]
+    }
 
     class func randomColor() -> UIColor {
         let red = CGFloat(arc4random() % 255)

+ 16 - 0
BFCommonKit/Classes/BFConfig/PQBFConfig.swift

@@ -52,6 +52,22 @@ public class PQBFConfig: NSObject {
     // 裁剪主题色
     public var hiddenMusicMask: Bool = true
     public var otherTintColor: UIColor = UIColor(red: 242.0 / 255.0, green: 242.0 / 255.0, blue: 242.0 / 255.0, alpha: 1)
+    
+    //划块使用的图片名 add by ak
+    public var silderPinUsedImageName = "sliderTHBPin"
+    //闪音卡点编辑区未选择中状态颜色 add by ak
+    public var pointEditNamalBackgroundColor = UIColor.hexColor(hexadecimal: "#F9F9F9")
+    
+    //三个模式 btn 高亮和默认图的文件名
+    public var onlyMusicBtnImage_N = "onlyMusic_n"
+    public var onlyMusicBtnImage_H = "onlyMusic_h"
+    public var jumpPointBtnImage_N = "jumpPoint_n"
+    public var jumpPointBtnImage_H = "jumpPoint_h"
+    public var speedStuckBtnImage_N = "speedstuck_n"
+    public var speedStuckBtnImage_H = "speedstuck_h"
+    
+    //闪音卡点发布分享朋友圈使用图片名
+    public var shareFriendBtnImage = "reCreate_opration_friend"
 
     // 微信登陆信息
 //    public var appInfo: WXApiInfo?

+ 44 - 19
BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

@@ -132,26 +132,33 @@ public func kf_imageCacheImage(originUrl: String, completeHandle: @escaping (_ i
     }
 }
 
-/** 打印 */
-public func BFLog<T>(message: T) {
-//    if PQBFConfig.shared.enableBFLog {
 
-//    let logger = NXLogger.shared
-//
-//    logger.level = .info
-//    logger.ouput = .debuggerConsole
-//
-//    logger.d(message as? String ?? "")
-//    } else {
-//        BuglyLog.level(.warn, logs: message as? String)
-//    }
-}
-
-public func HHZPrint<T>(_ message:T,file:String = #file,funcName:String = #function,lineNum:Int = #line){
-    #if DEBUG
-        let file = (file as NSString).lastPathComponent;
-        print("hhz-\(file):(\(lineNum))--\(message)");
-    #endif
+/** 打印
+   type = 1 : 胡志强
+   type = 2 :王成
+   type = 3 : 文伟伟
+ 
+ */
+public func BFLog<T>( _ type : Int = 0, _ file:String = #file, _ line:Int = #line, message: T) {
+    let dateFmt = DateFormatter()
+    dateFmt.dateFormat = "HH:mm:ss:SSSS"
+    let file = (file as NSString).lastPathComponent;
+    let msg = "\(file) (L:\(line)) \(message)"
+    if type == 0{
+//        BuglyLog.level(.warn, logs: msg)
+        print("\(dateFmt.string(from: Date())) \(msg)")
+    }
+#if DEBUG
+     if type == 1 {
+        print("hhz-\(dateFmt.string(from: Date())) \(msg)");
+     }else if type == 2 {
+        print("ak-\(dateFmt.string(from: Date())) \(msg)");
+     }else if type == 3 {
+        print("ww-\(dateFmt.string(from: Date())) \(msg)");
+     }
+ 
+#endif
+ 
 }
 
 // MARK: 获取公共参数
@@ -945,3 +952,21 @@ public func getLaunchImage() -> UIImage {
     }
     return lauchImg
 }
+
+public func currentBundlePath() -> Bundle?{
+//    var associateBundleURL = Bundle.main.url(forResource: "Frameworks", withExtension: nil)
+//    associateBundleURL = associateBundleURL?.appendingPathComponent("BFFramework")
+//    associateBundleURL = associateBundleURL?.appendingPathExtension("framework")
+//
+//    if associateBundleURL == nil {
+//        print("获取bundle失败")
+//        return nil
+//    }
+//    let associateBunle = Bundle(url: associateBundleURL!)
+    let associateBundleURL = Bundle.main.url(forResource: "BFFramework_Resources", withExtension: "bundle")
+    if associateBundleURL == nil {
+        return nil
+    }
+    return Bundle(url: associateBundleURL!)
+}
+