mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
20 lines
618 B
Swift
20 lines
618 B
Swift
import Foundation
|
|
import Display
|
|
import TelegramCore
|
|
import Postbox
|
|
|
|
func navigateToChatController(navigationController: NavigationController, account: Account, peerId: PeerId) {
|
|
var found = false
|
|
for controller in navigationController.viewControllers {
|
|
if let controller = controller as? ChatController, controller.peerId == peerId {
|
|
navigationController.popToViewController(controller, animated: true)
|
|
found = true
|
|
break
|
|
}
|
|
}
|
|
|
|
if !found {
|
|
navigationController.pushViewController(ChatController(account: account, peerId: peerId))
|
|
}
|
|
}
|