---
title: "stepInDecodeOrder(by:completionHandler:)"
framework: MediaExtension
role: symbol
role_heading: Instance Method
platforms: [macOS 14.0+]
path: "mediaextension/mesamplecursor/stepindecodeorder(by:completionhandler:)"
---

# stepInDecodeOrder(by:completionHandler:)

Moves the cursor a given number of samples in decode order.

## Declaration

```swift
func stepInDecodeOrder(by stepCount: Int64, completionHandler: @escaping @Sendable (Int64, (any Error)?) -> Void)
```

```swift
func stepInDecodeOrder(by stepCount: Int64) async throws -> Int64
```

## Parameters

- `stepCount`: The number of samples to move. If positive, the cursor steps forward. If negative, the cursor steps backward.
- `completionHandler`: The completion block to execute when the move operation finishes.

## See Also

### Stepping through samples

- [samplesWithEarlierDTSsMayHaveLaterPTSs(than:)](mediaextension/mesamplecursor/sampleswithearlierdtssmayhavelaterptss(than:).md)
- [samplesWithLaterDTSsMayHaveEarlierPTSs(than:)](mediaextension/mesamplecursor/sampleswithlaterdtssmayhaveearlierptss(than:).md)
- [estimatedSampleLocation()](mediaextension/mesamplecursor/estimatedsamplelocation().md)
- [refineSampleLocation(_:refinementData:refinementDataLength:refinedLocation:)](mediaextension/mesamplecursor/refinesamplelocation(_:refinementdata:refinementdatalength:refinedlocation:).md)
- [stepByDecodeTime(_:completionHandler:)](mediaextension/mesamplecursor/stepbydecodetime(_:completionhandler:).md)
- [stepByPresentationTime(_:completionHandler:)](mediaextension/mesamplecursor/stepbypresentationtime(_:completionhandler:).md)
- [stepInPresentationOrder(by:completionHandler:)](mediaextension/mesamplecursor/stepinpresentationorder(by:completionhandler:).md)
