---
title: "makeSampleCursor(presentationTimeStamp:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avassettrack/makesamplecursor(presentationtimestamp:)"
---

# makeSampleCursor(presentationTimeStamp:)

Creates a sample cursor and positions it at or near the specified presentation timestamp.

## Declaration

```swift
func makeSampleCursor(presentationTimeStamp: CMTime) -> AVSampleCursor?
```

## Parameters

- `presentationTimeStamp`: The initial presentation timestamp of the sample cursor.

## Return Value

Return Value An instance of AVSampleCursor.

## Discussion

Discussion If the track’s asset property value for providesPreciseDurationAndTiming is true, the sample cursor is accurately positioned at the track’slast media sample with a presentation timestamp less than or equal to the desired timestamp, or, if there are no such samples, the first sample in presentation order. If the track’s asset property value for providesPreciseDurationAndTiming is false, and it’s prohibitively expensive to locate the precise sample at the desired timestamp, the sample cursor may be approximately positioned.

## See Also

### Creating sample cursors

- [makeSampleCursorAtFirstSampleInDecodeOrder()](avfoundation/avassettrack/makesamplecursoratfirstsampleindecodeorder().md)
- [makeSampleCursorAtLastSampleInDecodeOrder()](avfoundation/avassettrack/makesamplecursoratlastsampleindecodeorder().md)
