---
title: "didMoveTab(_:from:in:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensioncontroller/didmovetab(_:from:in:)"
---

# didMoveTab(_:from:in:)

Should be called by the app when a tab is moved to fire appropriate events with all loaded web extensions.

## Declaration

```swift
@MainActor @preconcurrency func didMoveTab(_ movedTab: any WKWebExtensionTab, from index: Int, in oldWindow: (any WKWebExtensionWindow)? = nil)
```

## Parameters

- `movedTab`: The tab that was moved.
- `index`: The old index of the tab within the window.
- `oldWindow`: The window that the tab was moved from, or nil if the tab is moving from no open window.

## Discussion

Discussion This method informs all loaded extensions of the movement of a tab, ensuring consistent understanding across extensions. If the window is staying the same, the current window should be specified. If the intention is to inform only a specific extension, use the respective method on that extension’s context instead.
