---
title: "tabBarController(_:didSelect:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitabbarcontrollerdelegate/tabbarcontroller(_:didselect:)"
---

# tabBarController(_:didSelect:)

Tells the delegate that the user selected an item in the tab bar.

## Declaration

```swift
optional func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController)
```

## Parameters

- `tabBarController`: The tab bar controller containing viewController.
- `viewController`: The view controller that the user selected. In iOS v3.0 and later, this could be the same view controller that was already selected.

## Discussion

Discussion In iOS v3.0 and later, the tab bar controller calls this method regardless of whether the selected view controller changed. In addition, it is called only in response to user taps in the tab bar and is not called when your code changes the tab bar contents programmatically. In versions of iOS prior to version 3.0, this method is called only when the selected view controller actually changes. In other words, it is not called when the same view controller is selected. In addition, the method was called for both programmatic and user-initiated changes to the selected view controller.

## See Also

### Managing tab bar selections

- [tabBarController(_:shouldSelect:)](uikit/uitabbarcontrollerdelegate/tabbarcontroller(_:shouldselect:).md)
