<!--
{
  "availability" : [
    "iOS: 9.0.0 - 27.0.0",
    "iPadOS: 9.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 11.0.0 - 27.0.0",
    "tvOS: 10.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ReplayKit",
  "identifier" : "/documentation/ReplayKit/RPScreenRecorder/discardRecording(handler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ReplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)RPScreenRecorder(im)discardRecordingWithHandler:"
  },
  "title" : "discardRecording(handler:)"
}
-->

# discardRecording(handler:)

Discards the current recording.

```
func discardRecording(handler: @escaping () -> Void)
```

## Parameters

`handler`

A block that is called when the request is completed.

## Discussion

[`discardRecording(handler:)`](/documentation/ReplayKit/RPScreenRecorder/discardRecording(handler:)) can only be called after the handler block in [`stopRecording(handler:)`](/documentation/ReplayKit/RPScreenRecorder/stopRecording(handler:)) has been called. Use the `handler` block to do any required cleanup, including setting any `RPPreviewScreenController` references to `nil`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)