---
title: "AVAssetWritingPlanner.SegmentResult.successWithState(_:)"
framework: avfoundation
role: symbol
role_heading: Case
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "avfoundation/avassetwritingplanner/segmentresult/successwithstate(_:)"
---

# AVAssetWritingPlanner.SegmentResult.successWithState(_:)

Finish the segment successfully with custom client state.

## Declaration

```swift
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

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 when the segment is resumed. Only the last successful state data is persisted. Any previous state data will be overwritten.

## See Also

### Completion Options

- [AVAssetWritingPlanner.SegmentResult.success](avfoundation/avassetwritingplanner/segmentresult/success.md)
- [AVAssetWritingPlanner.SegmentResult.cancelled](avfoundation/avassetwritingplanner/segmentresult/cancelled.md)
