<!--
{
  "availability" : [
    "macOS: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaExtension",
  "identifier" : "/documentation/MediaExtension/MESampleCursor/stepInPresentationOrder(by:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MediaExtension"
    ],
    "preciseIdentifier" : "c:objc(pl)MESampleCursor(im)stepInPresentationOrderByCount:completionHandler:"
  },
  "title" : "stepInPresentationOrder(by:completionHandler:)"
}
-->

# stepInPresentationOrder(by:completionHandler:)

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

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

## 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.

## Discussion

If the request would advance the cursor past the last sample or before the first sample, the cursor points to that limiting sample and `actualStepCount` is equal to the number of samples the cursor moved. If decode order and presentation order are the same, in other words, the samples aren’t reordered, this method has the same effect as <doc://com.apple.documentation/documentation/AVFoundation/AVSampleCursor/stepInDecodeOrder(byCount:)>.

---

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)