I have UIViewControllerone that is popped out navigationController, which uses a custom left / back button using interactivePopGestureRecognizer, however, when I click a row from a table, my application sometimes holds even after I press the home button and go to the background, and then opens the application again. it continues, but the swipe action of the navigation controller becomes weird. Here is a video of what I'm saying;
https://streamable.com/xvl38
func openChat(with nick: String, isFromConversationList: Bool) {
guard let chatVC = UIStoryboard(name: "Main", bundle: .main).instantiateViewController(withIdentifier: "ChatViewController") as? ChatViewController,
let rootNC = UIApplication.shared.keyWindow?.rootViewController as? UINavigationController else {
return
}
rootNC.pushViewController(chatVC, animated: true)
}
override func viewDidLoad() {
super.viewDidLoad()
navigationController?.interactivePopGestureRecognizer?.delegate = nil
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
}
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false
}
What could be the reason for this?
source
share