---
title: "tabBarController(_:sidebar:contextMenuConfigurationFor:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitabbarcontroller/sidebar-swift.class/delegate-swift.protocol/tabbarcontroller(_:sidebar:contextmenuconfigurationfor:)"
---

# tabBarController(_:sidebar:contextMenuConfigurationFor:)

Called when the sidebar is about to display a context menu for the specified tab. Return either a concrete UIContextMenuConfiguration or nil if the tab does not show context menus.

## Declaration

```swift
optional func tabBarController(_ tabBarController: UITabBarController, sidebar: UITabBarController.Sidebar, contextMenuConfigurationFor tab: UITab) -> UIContextMenuConfiguration?
```

## Mentioned in

Elevating your iPad app with a tab bar and sidebar
