<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITabBarController/Sidebar-swift.class/Delegate-swift.protocol/tabBarController(_:sidebarVisibilityWillChange:animator:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITabBarControllerSidebarDelegate(im)tabBarController:sidebarVisibilityWillChange:animator:"
  },
  "title" : "tabBarController(_:sidebarVisibilityWillChange:animator:)"
}
-->

# tabBarController(_:sidebarVisibilityWillChange:animator:)

Notifies the delegate when the visibility of the sidebar is about to change when `sidebar.isHidden` changes.
Add animations to the animator to run alongside the visibility update. Alongside animations and completions will run immediately
if the sidebar visibility is changed without animation.

```
optional func tabBarController(_ tabBarController: UITabBarController, sidebarVisibilityWillChange sidebar: UITabBarController.Sidebar, animator: any UITabBarController.Sidebar.Animating)
```

---

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)