visionOS: Workaround for Compose screen not being opened

See #564
This commit is contained in:
Shadowfacts 2025-02-10 10:22:56 -05:00
parent 2fc889a5f9
commit 33c641cd85

View File

@ -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.