Explorar o código

定制actionsheet

harry %!s(int64=3) %!d(string=hai) anos
pai
achega
5774619ab5
Modificáronse 1 ficheiros con 47 adicións e 12 borrados
  1. 47 12
      Introduce/Record/INIntroduceController.swift

+ 47 - 12
Introduce/Record/INIntroduceController.swift

@@ -7,11 +7,12 @@
 
 import BFCommonKit
 import BFRecordScreenKit
-import BFUIKit
 import Foundation
 import Photos
 import UIKit
 import BFAnalyzeKit
+import BFUIKit
+
 
 class INIntroduceController: BFBaseViewController {
     lazy var stripSwithView : BFStripSwithView = {
@@ -164,22 +165,24 @@ class INIntroduceController: BFBaseViewController {
         }
         if recordScreenVC.isNormalPlaying {
             recordScreenVC.pause()
-//            recordScreenVC.playVideo(btn: recordScreenVC.playBtn)
         }
-        let alertv = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
+        
+        
+        let alee = BFActionSheetView()
+        
         if recordScreenVC.itemModels.count > 0 && recordScreenVC.itemModels.last!.mediaType != .Camera {
-            let action = UIAlertAction(title: "拍摄录制", style: .default) {[weak self]  action in
+            alee.addAction(title: "拍摄录制", sheetStyle: .defalt) {[weak self] in
                 guard let wself = self else { return }
-
+                
                 let phAsset = PHAsset()
                 phAsset.title = "record.camera"
                 wself.updateAsset([phAsset])
             }
-            alertv.addAction(action)
         }
         
-        let action1 = UIAlertAction(title: "从相册选择", style: .destructive) {[weak self] action in
+        alee.addAction(title: "从相册选择", sheetStyle: .defalt) {[weak self] in
             guard let wself = self else { return }
+            
             let vc = INPhotoVideosController()
             vc.maxMaterialNum = 20 - wself.recordScreenVC.itemModels.count
             vc.modalPresentationStyle = .fullScreen
@@ -191,12 +194,44 @@ class INIntroduceController: BFBaseViewController {
             
             wself.navigationController?.present(vc, animated: true, completion: nil)
         }
-        alertv.addAction(action1)
+        alee.addAction(title: "取消", sheetStyle: .cancle, handler: nil)
+        alee.show()
         
-        let action2 = UIAlertAction(title: "取消", style: .cancel, handler: nil)
-        alertv.addAction(action2)
-        
-        self.present(alertv, animated: true, completion: nil)
+//        let alertv = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
+//        if let subview = alertv.view.subviews.first?.subviews.first?.subviews.first {
+//            subview.backgroundColor = .black
+//        }
+//
+//        if recordScreenVC.itemModels.count > 0 && recordScreenVC.itemModels.last!.mediaType != .Camera {
+//            let action = UIAlertAction(title: "拍摄录制", style: .default) {[weak self]  action in
+//                guard let wself = self else { return }
+//
+//                let phAsset = PHAsset()
+//                phAsset.title = "record.camera"
+//                wself.updateAsset([phAsset])
+//            }
+//            alertv.addAction(action)
+//        }
+//
+//        let action1 = UIAlertAction(title: "从相册选择", style: .destructive) {[weak self] action in
+//            guard let wself = self else { return }
+//            let vc = INPhotoVideosController()
+//            vc.maxMaterialNum = 20 - wself.recordScreenVC.itemModels.count
+//            vc.modalPresentationStyle = .fullScreen
+//            vc.nextBtnCallBack = {[weak self] phAssets in
+//                guard let wself = self else { return }
+//
+//                wself.updateAsset(phAssets)
+//            }
+//
+//            wself.navigationController?.present(vc, animated: true, completion: nil)
+//        }
+//        alertv.addAction(action1)
+//
+//        let action2 = UIAlertAction(title: "取消", style: .cancel, handler: nil)
+//        alertv.addAction(action2)
+//
+//        self.present(alertv, animated: true, completion: nil)
     }
 
     override func backBtnClick() {