Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Replaykit stop screen record failed, recording status is false

I want to record screen ,and than when I call the method stopCaptureWithHandler:(nullable void (^)(NSError *_Nullable error))handler to stop recording and saving file. before call it,I check the value record of RPScreenRecorder sharedRecorder ,the value is false , It's weird! The screen is currently being recorded ! I wonder if the value of [RPScreenRecorder sharedRecorder].record will affect the method stopCaptureWithHandler:

-(void)startCaptureScreen { 
[[RPScreenRecorder sharedRecorder] startCaptureWithHandler:^(CMSampleBufferRef  _Nonnull sampleBuffer, RPSampleBufferType bufferType, NSError * _Nullable error) {
//code
 } completionHandler:^(NSError * _Nullable error) {
//code
}];
}
 - (void)stopRecordingHandler {

     if([[RPScreenRecorder sharedRecorder] isRecording]){
    // deal error .sometime  isRecording is false
    }else {
     [[RPScreenRecorder sharedRecorder] stopCaptureWithHandler:^(NSError * _Nullable error) {

     }];
   }
}

here are my code.

Replaykit stop screen record failed, recording status is false
 
 
Q