<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableViewCell/willTransition(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITableViewCell(im)willTransitionToState:"
  },
  "title" : "willTransition(to:)"
}
-->

# willTransition(to:)

Notifies the cell that it’s about to transition to a new cell state.

```
func willTransition(to state: UITableViewCell.StateMask)
```

## Parameters

`state`

A bit mask indicating the state or combination of states the cell is transitioning to.

## Discussion

Subclasses of `UITableViewCell` can implement this method to animate additional changes to a cell when it is changing state. `UITableViewCell` calls this method whenever a cell transitions between states, such as from a normal state (the default) to editing mode. The custom cell can set up and position any new views that appear with the new state. The cell then receives a [`layoutSubviews()`](/documentation/UIKit/UIView/layoutSubviews()) message (`UIView`) in which it can position these new views in their final locations for the new state. Subclasses must always call `super` when overriding this method.

Note that when the user swipes a cell to delete it, the cell transitions to the state identified by the [`showingDeleteConfirmation`](/documentation/UIKit/UITableViewCell/StateMask/showingDeleteConfirmation) constant but the [`showingEditControl`](/documentation/UIKit/UITableViewCell/StateMask/showingEditControl) is not set.

## See Also

[`editingAccessoryType`](/documentation/UIKit/UITableViewCell/editingAccessoryType)

The type of standard accessory view for the cell to use in the table view’s editing state.

[`editingAccessoryView`](/documentation/UIKit/UITableViewCell/editingAccessoryView)

The view to use on the right side of the cell, typically as a control, in the table view’s editing state.

[`accessoryView`](/documentation/UIKit/UITableViewCell/accessoryView)

The view to use on the right side of the cell, typically as a control, in the table view’s normal state.

[`accessoryType`](/documentation/UIKit/UITableViewCell/accessoryType-swift.property)

The type of standard accessory view for the cell to use in the table view’s normal state.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)