fix an issue where the keyboard can be covering voice call buttons

pull/874/head
Ryan ZHAO 1 year ago
parent d1fa40c52e
commit e235b6059f

@ -3,6 +3,7 @@
import UIKit
import CallKit
import GRDB
import SessionUIKit
import SessionMessagingKit
import SignalCoreKit
import SignalUtilitiesKit
@ -219,7 +220,10 @@ public final class SessionCallManager: NSObject, CallManagerProtocol {
preconditionFailure() // FIXME: Handle more gracefully
}
if let conversationVC: ConversationVC = presentingVC as? ConversationVC, conversationVC.viewModel.threadData.threadId == call.sessionId {
if
let conversationVC: ConversationVC = (presentingVC as? TopBannerController)?.wrappedViewController() as? ConversationVC,
conversationVC.viewModel.threadData.threadId == call.sessionId
{
let callVC = CallVC(for: call)
callVC.conversationVC = conversationVC
conversationVC.inputAccessoryView?.isHidden = true

@ -202,7 +202,7 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
else { preconditionFailure() } // FIXME: Handle more gracefully
let callVC = CallVC(for: self.call)
if let conversationVC = presentingVC as? ConversationVC {
if let conversationVC = (presentingVC as? TopBannerController)?.wrappedViewController() as? ConversationVC {
callVC.conversationVC = conversationVC
conversationVC.inputAccessoryView?.isHidden = true
conversationVC.inputAccessoryView?.alpha = 0

@ -834,7 +834,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
let callVC: CallVC = CallVC(for: call)
if let conversationVC: ConversationVC = presentingVC as? ConversationVC, conversationVC.viewModel.threadData.threadId == call.sessionId {
if
let conversationVC: ConversationVC = (presentingVC as? TopBannerController)?.wrappedViewController() as? ConversationVC,
conversationVC.viewModel.threadData.threadId == call.sessionId
{
callVC.conversationVC = conversationVC
conversationVC.inputAccessoryView?.isHidden = true
conversationVC.inputAccessoryView?.alpha = 0

@ -150,6 +150,12 @@ public class TopBannerController: UIViewController {
}
// MARK: - Functions
public func wrappedViewController() -> UIViewController? {
if let navVC = child as? UINavigationController {
return navVC.topViewController
}
return child
}
public func attachChild() {
child.willMove(toParent: self)

Loading…
Cancel
Save