---
title: clearsSelectionOnViewWillAppear
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uitableviewcontroller/clearsselectiononviewwillappear
---

# clearsSelectionOnViewWillAppear

A Boolean value indicating if the controller clears the selection when the table appears.

## Declaration

```swift
var clearsSelectionOnViewWillAppear: Bool { get set }
```

## Mentioned in

Handling row selection in a table view

## Discussion

Discussion The default value of this property is true. When true, the table view controller clears the table’s current selection when it receives a viewWillAppear(_:) message. Setting this property to false preserves the selection.
