diff --git a/Tusker/Screens/Main/NewMainTabBarViewController.swift b/Tusker/Screens/Main/NewMainTabBarViewController.swift index 9891249217..62627144dc 100644 --- a/Tusker/Screens/Main/NewMainTabBarViewController.swift +++ b/Tusker/Screens/Main/NewMainTabBarViewController.swift @@ -490,6 +490,18 @@ extension NewMainTabBarViewController: UITabBarControllerDelegate { } func tabBarController(_ tabBarController: UITabBarController, didSelectTab newTab: UITab, previousTab: UITab?) { + // Workaround for FB16476036 (visionOS: tabBarController(_:shouldSelectTab:) delegate method not called) + #if os(visionOS) + if let previousTab, + newTab.identifier == Tab.compose.rawValue { + compose(editing: nil) + DispatchQueue.main.async { + self.selectedTab = previousTab + } + return + } + #endif + self.updateViewControllerSafeAreaInsets(newTab.viewController!) // All tabs in a tab group deliberately share the same view controller, so we have to do this ourselves.