<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetWritingPlanner/SegmentResult/successWithState(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "s:So21AVAssetWritingPlannerC12AVFoundationE13SegmentResultO16successWithStateyAE10Foundation4DataVcAEmF"
  },
  "title" : "AVAssetWritingPlanner.SegmentResult.successWithState(_:)"
}
-->

# AVAssetWritingPlanner.SegmentResult.successWithState(_:)

Finish the segment successfully with custom client state.

```
case successWithState(Data)
```

## Parameters

`clientState`

Custom data to save for this segment. Commonly used
to save algorithm state, progress information, or metadata needed for resumption.

## Discussion

Use this case to save custom state data that will be restored if the export
session is interrupted and later resumed. The client state is available via
[`clientStateToRestore`](/documentation/AVFoundation/AVPlannedSegmentWritingRequest/clientStateToRestore) when the segment is
resumed.
Only the last successful state data is persisted. Any previous state data will be overwritten.

---

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)