RPScreenRecorder stopRecording块未调用 [英] RPScreenRecorder stopRecording block not getting called
问题描述
我进行了足够的搜索,但没有找到解决方法.
I have searched enough but failed to get a solution.
我正在使用ReplayKit记录我的应用程序的屏幕.我已经通过调用
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)
}
}
当我按下stopRecord
按钮时,我正在呼叫
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
}
}
但是我面临的问题是,程序控件没有进入stopRecording
块内部.
当我在做po sharedRecorder.isRecording
时,它总是返回false.
我已经做了所有我知道的事情,但是没有找到解决方案.
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.
推荐答案
运行XCode 9.4.1并在iOS 11.4.0上构建时遇到了这个问题.将手机升级到iOS 11.4.1修复了该错误.我不确定XCode版本之间的差异是否是根本原因,或者11.4.0是否已被破坏.
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.
这篇关于RPScreenRecorder stopRecording块未调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!