mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
18 lines
790 B
Swift
18 lines
790 B
Swift
import Foundation
|
|
import Display
|
|
import TelegramCore
|
|
|
|
public func textAlertController(context: AccountContext, title: String?, text: String, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal) -> AlertController {
|
|
let presentationData = context.currentPresentationData.with { $0 }
|
|
let theme = presentationData.theme
|
|
|
|
let controller = standardTextAlertController(theme: AlertControllerTheme(presentationTheme: theme), title: title, text: text, actions: actions)
|
|
_ = context.presentationData.start(next: { [weak controller] presentationData in
|
|
if let strongController = controller {
|
|
strongController.theme = AlertControllerTheme(presentationTheme: presentationData.theme)
|
|
}
|
|
})
|
|
|
|
return controller
|
|
}
|