---
title: clearSelection()
framework: pdfkit
role: symbol
role_heading: Instance Method
path: pdfkit/pdfview/clearselection()
---

# clearSelection()

Clears the selection.

## Declaration

```swift
func clearSelection()
```

## Discussion

Discussion The view redraws as necessary but does not scroll. This call is equivalent to calling [PDFView setCurrentSelection:NULL].

## See Also

### Handling Selections

- [currentSelection](pdfkit/pdfview/currentselection.md)
- [setCurrentSelection(_:animate:)](pdfkit/pdfview/setcurrentselection(_:animate:).md)
- [selectAll(_:)](pdfkit/pdfview/selectall(_:).md)
- [copy(_:)](pdfkit/pdfview/copy(_:).md)
- [scrollSelectionToVisible(_:)](pdfkit/pdfview/scrollselectiontovisible(_:).md)
- [highlightedSelections](pdfkit/pdfview/highlightedselections.md)
