clearsSelectionOnViewWillAppear
is a boolean property of table and collection views, and it's set to true
by default. According to the Apple Reference:
A Boolean value indicating if the controller clears the selection when the table appears.
What does that mean?
Let's say that, as is usual, you tap a cell and this presents a new view controller. Okay, but how does it do that? Your tap selects the cell. That is a visible change in the cell - the cell is highlighted.
Later, you dismiss that view controller and return to your table / collection view.
The question is: should the selection (caused by your earlier tap) still be showing as a selection? Should the cell still be visibly highlighted? The default is: no. We clear the selection before you visibly return to the table / collection view.
(You could do this yourself in your viewWillAppear:
implementation, but the table / collection view controller is willing to do it for you.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With