---
title: "seek(to:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avplayeritem/seek(to:)-3s9d8"
---

# seek(to:)

Sets the current playback time to the time specified by the date object.

## Declaration

```swift
@MainActor func seek(to date: Date) -> Bool
```

## Parameters

- `date`: The time to which to seek.

## Return Value

Return Value true if the playhead was moved to date, otherwise false.

## Discussion

Discussion For playback content that is associated with a range of dates, this method moves the playhead to point within that range. This method will fail (return false) if date is outside the range or if the content is not associated with a range of dates.

## See Also

### Related Documentation

- [seek(to:toleranceBefore:toleranceAfter:completionHandler:)](avfoundation/avplayeritem/seek(to:tolerancebefore:toleranceafter:completionhandler:).md)
- [seek(to:completionHandler:)](avfoundation/avplayeritem/seek(to:completionhandler:)-91gnw.md)

### Seeking through media

- [seek(to:)](avfoundation/avplayeritem/seek(to:)-1dpto.md)
- [seek(to:toleranceBefore:toleranceAfter:)](avfoundation/avplayeritem/seek(to:tolerancebefore:toleranceafter:).md)
- [seek(to:)](avfoundation/avplayeritem/seek(to:)-5rt4x.md)
