Replay kit Not working IPAD IOS11 BUG

前端 未结 1 528
暗喜
暗喜 2021-01-15 02:39

I am using following code to record screen. It is working fine for ios10 and ios9

 @IBAction func btnRecordTapped(_ sender:         


        
相关标签:
1条回答
  • 2021-01-15 03:23

    I had the same problem as you, so I thinked in updating to iOS 11.0.2 and it worked for me! Hope it help you too.

    Just in case, here are my methods:

    let recorder = RPScreenRecorder.shared()
    
    @IBAction func recordingAction(_ sender: Any) {
            if recorder.isRecording {
                stopRecordAction()
            } else {
                startRecordAction()
            }
    }
    
    func startRecordAction() {
         recorder.startRecording{ (error) in
                if let error = error {
                   print("❗️",error)
                 }
          }
    }
    
    func stopRecordAction() {
                recorder.stopRecording{ (previewVC, error) in
                    if let previewVC = previewVC {
                        previewVC.previewControllerDelegate = self
                        self.present(previewVC, animated: true, completion: nil)
                        if let error = error {
                            print("❗️",error)
                        }
                    }
                }
        }
    

    Methods of RPPreviewViewControllerDelegate:

    func previewControllerDidFinish(_ previewController: RPPreviewViewController) {
            dismiss(animated: true, completion: nil)
        }
    
        func previewController(_ previewController: RPPreviewViewController, didFinishWithActivityTypes activityTypes: Set<String>) {
            /// This path was obtained by printing the actiong captured in "activityTypes"
            if activityTypes.contains("com.apple.UIKit.activity.SaveToCameraRoll") {
                recordFinshedMessage()
            }
        }
    
    0 讨论(0)
提交回复
热议问题