RPScreenRecorder stopRecording block not getting called

岁酱吖の 提交于 2019-12-06 01:24:54

问题


I have searched enough but failed to get a solution.

I am using ReplayKit to record the screen of my app. I have started recording the screen by calling

let sharedRecorder = RPScreenRecorder.shared()
sharedRecorder.startRecording() { error in 
    if let error = error {
        self.showScreenRecordingAlert(message: error.localizedDescription)
    }
}

When I am pressing the stopRecord button I am calling

let sharedRecorder = RPScreenRecorder.shared()
sharedRecorder.stopRecording { previewViewController, error in 
    if let error = error {
        self.showScreenRecordingAlert(message : error.localizedDescription)
        return
    }
}

But the issue that I am facing is, the program control does not enter inside the stopRecording block. When I am doing po sharedRecorder.isRecording, it always returns false. I have done everything I know but failed to get a solution.


回答1:


Just had this issue running XCode 9.4.1 and building onto iOS 11.4.0. Upgrading the phone to iOS 11.4.1 fixed the bug. I'm not sure if the difference in XCode versions is the root cause or if 11.4.0 was just broken.



来源:https://stackoverflow.com/questions/46199571/rpscreenrecorder-stoprecording-block-not-getting-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!