소스 검색

接入BFAnalyzeKit

wenweiwei 3 년 전
부모
커밋
7f22e7b26a

+ 7 - 0
BFCommonKit.podspec

@@ -66,6 +66,13 @@ TODO: Add long description of the pod here.
     vv.source_files = 'BFCommonKit/Classes/BFVendors/**/*'
     vv.frameworks = 'Foundation','UIKit'
   end
+  s.subspec 'BFVendorsUtils' do |vv|
+    vv.source_files = 'BFCommonKit/Classes/BFVendorsUtils/*'
+    vv.dependency 'BFCommonKit/BFProtocols'
+    vv.dependency 'BFCommonKit/BFEnums'
+    vv.dependency 'BFCommonKit/BFUtility'
+    vv.dependency 'RealmSwift'               ,'10.7.6'
+  end
   s.pod_target_xcconfig = { 'skip_validation' => true }
   s.resource_bundles = {
       'BFCommonKit_Resources' => ['BFCommonKit/Assets/*']

+ 0 - 1
BFCommonKit/Classes/BFCategorys/BFUIImage+Ext.swift

@@ -7,7 +7,6 @@
 //
 
 import Foundation
-import BFCommonKit
 
 /// 滑动方向
 public  enum  moveDirection {

+ 1 - 1
BFCommonKit/Classes/BFModels/PQReCreateModel.swift

@@ -28,7 +28,7 @@ public class PQReCreateModel: Object {
     
     // add by ak 卡点模式(1:跳跃卡点,2:快慢速,3:仅配乐)
     @objc dynamic public var rhythmMode:Int = 0
-    override required init() {
+    override public required init() {
         super.init()
     }
 

+ 2 - 1
BFCommonKit/Classes/BFProtocols/BFProtocols.swift

@@ -105,7 +105,8 @@ public protocol BFVideoItemProtocol {
     var isShareList: Bool { get set } // 是否是分享列表
     var uplpadBucketKey: String? { get set } // 上传视频地址
     var uplpadStatus: Int { get set } // 上传视频状态  1-上传中 2-上传完成 3-上传失败 4-发布中 4-发布完成
-    var uplpadRequest: Any? { get set }
+    // MARK: SanW--待修改-2021.12.09
+//    var uplpadRequest: Any? { get set }
     var stsToken: [String: Any]? { get set } // 上传信息
     var localPath: String? { get set } // 地址
     var progress: Float { get set }

+ 1 - 1
BFCommonKit/Classes/BFUtility/PQCommonMethodUtil.swift

@@ -931,7 +931,7 @@ public func currentBundlePath() -> Bundle?{
 //        return nil
 //    }
 //    let associateBunle = Bundle(url: associateBundleURL!)
-    let associateBundleURL = Bundle.main.url(forResource: "BFFramework_Resources", withExtension: "bundle")
+    let associateBundleURL = Bundle.main.url(forResource: "BFCommonKit_Resources", withExtension: "bundle")
     if associateBundleURL == nil {
         return nil
     }

+ 143 - 0
BFCommonKit/Classes/BFVendorsUtils/PQSingletoMemoryUtil.swift

@@ -0,0 +1,143 @@
+//
+//  PQSingletoMemoryUtil.swift
+//  PQSpeed
+//
+//  Created by SanW on 2020/6/9.
+//  Copyright © 2020 BytesFlow. All rights reserved.
+//
+
+import UIKit
+import Photos
+
+// MARK: - 内存缓存数据
+
+/// 内存缓存数据r
+public class PQSingletoMemoryUtil: NSObject {
+    public static let shared = PQSingletoMemoryUtil()
+    public var isShowAttendPoint: Bool = false // 是否有关注更新
+    public var attendIdosUpdateCount: Int = 0 // 关注更新条数
+    public var isLeftSlipRemind: Bool = false
+    public var needLogin: Bool = false // 是否需要显示手机登录
+    public var isFinishedCoging: Bool = false // 是否已完成配置请求
+    public var isFinishedAlias: Bool = false // 是否完成绑定别名
+    public var selectedTabIndex: String?
+    public var commandVideoItem: BFVideoItemProtocol? // 口令内容
+    public var commandLaunchParams: String = "" // 口令启动时的值
+    public var commandReportParams: [String: Any]? // 口令启动时解析的其他值
+    public var h5MsgVid: String? // 剪切板id
+    public var isShowNoWiFiRemind: Bool = false // 是否提示过非WiFi提示
+    public var isNeedRefreshAttend: Bool = false // 是否需要刷新关注
+    public var isNeedRefreshJoinTopic: Bool = false // 是否需要刷新加入的话题
+    
+    // 剪切板content是否为空,如果为空走承接逻辑,冷启动不再加载缓存
+    public var isEmptyPasteContent: Bool = false {
+        didSet {
+            BFLog(message: "isEmptyPasteContent = \(isEmptyPasteContent)")
+        }
+    }
+
+    // 展示无服务提示视图(剪切板 data.reportData.downloadButtonType为 weapp_share_noServiceDownloadApp/weapp_categoryTab_noServiceDownloadApp
+    public var isShowPasteNoServeView: Bool = false {
+        didSet {
+            BFLog(message: "isShowPasteNoServeView = \(isShowPasteNoServeView)")
+        }
+    }
+    /// 是否正在展示广告view
+    public var isLoadingSplashAdView: Bool = false {
+        didSet {
+            BFLog(message: "isLoadingSplashAdView = \(isLoadingSplashAdView)")
+        }
+    }
+    public var cutBoardInfo: String? // 剪切板信息
+    public var cutBoard: String? // 剪切板来源cutBoardInfo
+    public var isPushLoading: Bool = false // 是否正在加载推送数据
+
+    public var coldLaunchType: coldLaunchType?
+    public var isColdLaunch: Bool = false // 冷启动
+    public var coldLaunchStatus: Int = 0 // 1-请求中 2-请求成功 3-请求失败
+    public var deviceToken: String = "" // 推送deviceToken
+    public var activityData: Dictionary<String,Any>? // 活动数据信息
+    public var isShowTodaySuccess: Bool = false // 是否已经展示过今日已完成
+    public var sessionId: String = getUniqueId(desc: "sessionId")
+    public var subSessionid: String?
+    public var isDefaultAtten: Bool = false // 是否默认进入关注
+    public var isDefaultMineSingleVideoDetail: Bool = false // 是否默认进入我的单个视频详情
+    public var playCount: Int = 0 // 播放次数
+    public var uploadDatas: [BFVideoItemProtocol] = Array<BFVideoItemProtocol>.init() // 正在上传的视频集合
+    public var isShowUpSlideGuide: Bool = false // 是否展示了滑动向上的提示
+    public var showUpSlideData: BFVideoItemProtocol? // 是否展示了滑动向上的提示
+    public var makeVideoProjectId: String? // 制作视频项目Id
+    public var draftboxId: String? // 草稿箱ID
+    // add by ak 结构化数据 saveDraft api 要 用到的参数
+    public var sdata: String?
+    // add by ak 结构化数据 saveDraft api 要 用到的参数
+    public var title: String?
+    // add by ak 结构化数据 saveDraft api 要 用到的参数
+    public var coverUrl: String?
+
+    // 未读数字
+    public var unReadInfo: Dictionary<String,Any>?
+    public var abInfoData: [String: Any] = Dictionary<String, Any>.init() // 实验数据
+    public var allExportSession: [PHAsset:AVAssetExportSession] = [PHAsset:AVAssetExportSession].init()
+    public func updateTabPoint() {
+//        let tabBar =
+//            rootViewController()?.tabBar
+//        if isShowAttendPoint {
+//            tabBar?.showPoint(index: 1)
+//        } else {
+////          tabBar.removePoint(index: 1)
+//        }
+    }
+
+    /// 创建sessionId
+    /// - Returns: <#description#>
+   public func createSesstionId() {
+        sessionId = getUniqueId(desc: "sessionId")
+        subSessionid = sessionId
+        BFLog(message: "生成的sessionId = \(sessionId)")
+    }
+
+    /// 创建subSessionid
+    /// - Returns: <#description#>
+    public func createSubSesstionId() {
+        subSessionid = getUniqueId(desc: "subSessionid")
+        BFLog(message: "生成的subSessionid = \(String(describing: subSessionid))")
+    }
+
+    /// 制作视频项目Id
+    /// - Returns: <#description#>
+    public func createMakeVideoProjectId() {
+        makeVideoProjectId = cProjectIdPrefix + getUniqueId(desc: "makeVideoProjectId")
+        BFLog(message: "生成的projectId = \(String(describing: makeVideoProjectId))")
+    }
+
+    /// 解析abInfoData
+    /// - Parameter abInfo: <#abInfo description#>
+    /// - Returns: description
+    public func parasABinfoData(abInfo: String?) {
+        if abInfo != nil, (abInfo?.count ?? 0) > 0, abInfo != "{}" {
+            guard let infoDic = jsonStringToDictionary(abInfo!) else { return }
+            abInfoData.merge(infoDic, uniquingKeysWith: { (key, _) -> Any in
+                key
+            })
+            BFLog(message: "=====abInfoData = \(abInfoData)")
+        }
+    }
+
+    override private init() {
+        super.init()
+        selectedTabIndex = getUserDefaults(key: cSelectedTabIndex) as? String
+        if selectedTabIndex == nil {
+            saveUserDefaults(key: cSelectedTabIndex, value: "categoryTab")
+            selectedTabIndex = "categoryTab"
+        }
+    }
+
+    public override func copy() -> Any {
+        return self
+    }
+
+    public override func mutableCopy() -> Any {
+        return self
+    }
+}

+ 6 - 0
Example/BFCommonKit.xcodeproj/project.pbxproj

@@ -271,7 +271,10 @@
 			inputPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-BFCommonKit_Example/Pods-BFCommonKit_Example-frameworks.sh",
 				"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
+				"${BUILT_PRODUCTS_DIR}/AliyunOSSiOS/AliyunOSSiOS.framework",
+				"${BUILT_PRODUCTS_DIR}/BFAnalyzeKit/BFAnalyzeKit.framework",
 				"${BUILT_PRODUCTS_DIR}/BFCommonKit/BFCommonKit.framework",
+				"${BUILT_PRODUCTS_DIR}/BFNetRequestKit/BFNetRequestKit.framework",
 				"${BUILT_PRODUCTS_DIR}/KeychainAccess/KeychainAccess.framework",
 				"${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework",
 				"${BUILT_PRODUCTS_DIR}/KingfisherWebP/KingfisherWebP.framework",
@@ -284,7 +287,10 @@
 			name = "[CP] Embed Pods Frameworks";
 			outputPaths = (
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AliyunOSSiOS.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BFAnalyzeKit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BFCommonKit.framework",
+				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BFNetRequestKit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainAccess.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KingfisherWebP.framework",

+ 2 - 3
Example/Podfile

@@ -3,9 +3,8 @@ use_frameworks!
 platform :ios, '10.0'
 
 target 'BFCommonKit_Example' do
-  pod 'BFCommonKit', :path => '../'
-# pod "BFCommonKit",      :git => 'https://git.yishihui.com/iOS/BFCommonKit.git'
-
+  pod 'BFCommonKit',            :path => '../'
+  
   target 'BFCommonKit_Tests' do
     inherit! :search_paths
   end

+ 29 - 4
Example/Podfile.lock

@@ -1,5 +1,11 @@
 PODS:
   - Alamofire (5.4.4)
+  - AliyunOSSiOS (2.10.10)
+  - BFAnalyzeKit (0.1.0):
+    - BFCommonKit/BFEnums
+    - BFCommonKit/BFEnv
+    - BFCommonKit/BFProtocols
+    - BFNetRequestKit
   - BFCommonKit (1.5.2):
     - BFCommonKit/BFCategorys (= 1.5.2)
     - BFCommonKit/BFConfig (= 1.5.2)
@@ -9,13 +15,13 @@ PODS:
     - BFCommonKit/BFProtocols (= 1.5.2)
     - BFCommonKit/BFUtility (= 1.5.2)
     - BFCommonKit/BFVendors (= 1.5.2)
+    - BFCommonKit/BFVendorsUtils (= 1.5.2)
   - BFCommonKit/BFCategorys (1.5.2):
     - KingfisherWebP (= 1.3.0)
   - BFCommonKit/BFConfig (1.5.2):
     - BFCommonKit/BFEnums
   - BFCommonKit/BFEnums (1.5.2)
-  - BFCommonKit/BFEnv (1.5.2):
-    - BFCommonKit/BFConfig
+  - BFCommonKit/BFEnv (1.5.2)
   - BFCommonKit/BFModels (1.5.2):
     - BFCommonKit/BFEnums
     - ObjectMapper (= 4.2.0)
@@ -31,6 +37,15 @@ PODS:
     - KingfisherWebP (= 1.3.0)
     - Toast-Swift (= 5.0.1)
   - BFCommonKit/BFVendors (1.5.2)
+  - BFCommonKit/BFVendorsUtils (1.5.2):
+    - AliyunOSSiOS (= 2.10.10)
+    - BFAnalyzeKit
+    - BFCommonKit/BFEnums
+    - BFCommonKit/BFProtocols
+    - BFCommonKit/BFUtility
+    - RealmSwift (= 10.7.6)
+  - BFNetRequestKit (1.0.1):
+    - Alamofire (= 5.4.4)
   - KeychainAccess (4.2.2)
   - Kingfisher (6.3.1)
   - KingfisherWebP (1.3.0):
@@ -54,11 +69,14 @@ PODS:
   - Toast-Swift (5.0.1)
 
 DEPENDENCIES:
+  - BFAnalyzeKit (from `../../../BFAnalyzeKit/Trunk`)
   - BFCommonKit (from `../`)
+  - BFNetRequestKit (from `../../../BFNetRequestKit/Trunk`)
 
 SPEC REPOS:
   trunk:
     - Alamofire
+    - AliyunOSSiOS
     - KeychainAccess
     - Kingfisher
     - KingfisherWebP
@@ -69,12 +87,19 @@ SPEC REPOS:
     - Toast-Swift
 
 EXTERNAL SOURCES:
+  BFAnalyzeKit:
+    :path: "../../../BFAnalyzeKit/Trunk"
   BFCommonKit:
     :path: "../"
+  BFNetRequestKit:
+    :path: "../../../BFNetRequestKit/Trunk"
 
 SPEC CHECKSUMS:
   Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9
-  BFCommonKit: ea8b893eb9cd74249d9d55e00b46df7784eb9490
+  AliyunOSSiOS: b8f1dfc229cd9abf68c8ee0cb245c2d66e00dd96
+  BFAnalyzeKit: 457ecf2fcb09cb83417e2adea50f98c60a50ddec
+  BFCommonKit: 564eefcf3bc7baca3b803ad6abf9f589e5a4bbf8
+  BFNetRequestKit: 1d074023eafe7c272fab4ed3a608e685902235d0
   KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
   Kingfisher: 016c8b653a35add51dd34a3aba36b580041acc74
   KingfisherWebP: dec17a5eb1af2658791bde1f93ae9a853678f826
@@ -84,6 +109,6 @@ SPEC CHECKSUMS:
   RealmSwift: e31c4ddbcc42ac879313d656b86f9ca539f6f4f4
   Toast-Swift: 9b6a70f28b3bf0b96c40d46c0c4b9d6639846711
 
-PODFILE CHECKSUM: 46a6541d329ac57725f417e3184d8a4670ea443f
+PODFILE CHECKSUM: b69df9a7366c6db16be3bae28aac930ce675a035
 
 COCOAPODS: 1.11.2