mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
22 lines
1.3 KiB
Swift
22 lines
1.3 KiB
Swift
import Foundation
|
|
import TelegramCore
|
|
import Display
|
|
|
|
import TelegramUIPrivateModule
|
|
|
|
func legacyChannelIntroController(account: Account, theme: PresentationTheme, strings: PresentationStrings) -> ViewController {
|
|
let controller = LegacyController(presentation: .custom, theme: theme)
|
|
controller.bind(controller: TGChannelIntroController(context: controller.context, getLocalizedString: { string in
|
|
return strings.dict[string!] ?? string
|
|
}, theme: TGChannelIntroControllerTheme(backgroundColor: theme.list.plainBackgroundColor, primaryColor: theme.list.itemPrimaryTextColor, secondaryColor: theme.list.itemSecondaryTextColor, accentColor: theme.list.itemAccentColor, backArrowImage: NavigationBarTheme.generateBackArrowImage(color: theme.list.itemAccentColor), introImage: UIImage(bundleImageName: "Chat/Intro/ChannelIntro")), dismiss: { [weak controller] in
|
|
if let navigationController = controller?.navigationController as? NavigationController {
|
|
_ = navigationController.popViewController(animated: true)
|
|
}
|
|
}, completion: { [weak controller] in
|
|
if let navigationController = controller?.navigationController as? NavigationController {
|
|
navigationController.replaceTopController(createChannelController(account: account), animated: true)
|
|
}
|
|
})!)
|
|
return controller
|
|
}
|