Browse Source

fix warning

huzhiqiang 3 years ago
parent
commit
8017f10646

+ 5 - 1
MusicVideoPlus/Classes/Modules/Base/Controllers/MVBaseController.swift

@@ -42,7 +42,11 @@ public class MVBaseController: UIViewController, UIGestureRecognizerDelegate {
         view.addSubview(navHeadImageView!)
 
         UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
-        automaticallyAdjustsScrollViewInsets = false
+        if #available(iOS 11.0, *) {
+//            self..contentInsetAdjustmentBehavior = .never
+        } else {
+            automaticallyAdjustsScrollViewInsets = false
+        }
         navigationController?.interactivePopGestureRecognizer?.delegate = self
         fd_prefersNavigationBarHidden = true
     }

+ 4 - 3
MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -116,7 +116,7 @@ class MVHomeController: MVBaseController {
         if rootViewController is UINavigationController {
             rootViewController = (rootViewController as? UINavigationController)?.visibleViewController
         }
-        BFLog(message: "rootViewController is \(rootViewController)")
+        BFLog(message: "rootViewController is \(String(describing: rootViewController))")
         if rootViewController is MVHomeController {
             controlPlayrPasueOrResume(isPause: true)
         }
@@ -128,7 +128,7 @@ class MVHomeController: MVBaseController {
         if rootViewController is UINavigationController {
             rootViewController = (rootViewController as? UINavigationController)?.visibleViewController
         }
-        BFLog(message: "rootViewController is \(rootViewController)")
+        BFLog(message: "rootViewController is \(String(describing: rootViewController))")
         if rootViewController is MVHomeController {
             controlPlayrPasueOrResume(isPause: false)
         }
@@ -273,6 +273,7 @@ class MVHomeController: MVBaseController {
             }
             UIApplication.shared.keyWindow?.addSubview(protocalView)
         }
+        try? AVAudioSession.sharedInstance().setCategory(.playback)
     }
 
     func addLayout() {
@@ -340,7 +341,7 @@ class MVHomeController: MVBaseController {
             let remindView = PQRemindView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
             UIApplication.shared.keyWindow?.addSubview(remindView)
             remindView.remindData = remindData
-            remindView.remindBlock = { [weak self] sender, _ in
+            remindView.remindBlock = { sender, _ in
                 if sender.tag == 2 {
                     openAppSetting()
                 }

+ 1 - 1
MusicVideoPlus/Classes/Modules/Mine/Controllers/MVMineProductController.swift

@@ -98,7 +98,7 @@ class MVMineProductController: PQBaseViewController {
                     } else {
                         self?.itemsList = self!.itemsList + videoList!
                     }
-                    self?.flowLayout.findList = self?.itemsList as! [PQVideoListModel]
+                    self?.flowLayout.findList = self?.itemsList as! [Any]
                     self?.collectionView.reloadData()
                     self?.emptyView.isHidden = true
                 } else {

+ 1 - 1
MusicVideoPlus/Classes/Modules/Mine/Controllers/PQCollectionViewFlowlayout.swift

@@ -77,7 +77,7 @@ class PQCollectionViewFlowlayout: UICollectionViewFlowLayout {
 
         // 找出最高列列号
         let maxHeight: Int = columnHeight.sorted().last!
-        let column = columnHeight.index(of: maxHeight)
+        let column = columnHeight.firstIndex(of: maxHeight)
         // 根据最高列设置itemSize 使用总高度的平均值
         var itemH = 0