IOS-110: Fix Cannot switch accounts when large content viewer is enabled (#976)

This commit is contained in:
Marcus Kida 2023-03-16 00:18:22 +01:00 committed by GitHub
parent c1dab782b1
commit 73ce92216a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,8 @@ class MainTabBarController: UITabBarController {
var authContext: AuthContext?
private let largeContentViewerInteraction = UILargeContentViewerInteraction()
let composeButttonShadowBackgroundContainer = ShadowBackgroundContainer()
let composeButton: UIButton = {
let button = UIButton()
@ -180,6 +182,8 @@ class MainTabBarController: UITabBarController {
self.coordinator = coordinator
self.authContext = authContext
super.init(nibName: nil, bundle: nil)
tabBar.addInteraction(largeContentViewerInteraction)
}
required init?(coder: NSCoder) {
@ -349,6 +353,7 @@ extension MainTabBarController {
let tabBarLongPressGestureRecognizer = UILongPressGestureRecognizer()
tabBarLongPressGestureRecognizer.addTarget(self, action: #selector(MainTabBarController.tabBarLongPressGestureRecognizerHandler(_:)))
tabBarLongPressGestureRecognizer.delegate = self
tabBar.addGestureRecognizer(tabBarLongPressGestureRecognizer)
// todo: reconsider the "double tap to change account" feature -> https://github.com/mastodon/mastodon-ios/issues/628
@ -844,3 +849,9 @@ extension MainTabBarController {
}
}
extension MainTabBarController: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
true
}
}