mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
18 lines
839 B
Swift
18 lines
839 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.sharedContext.currentPresentationData.with { $0 }
|
|
|
|
let controller = standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: title, text: text, actions: actions)
|
|
let presentationDataDisposable = context.sharedContext.presentationData.start(next: { [weak controller] presentationData in
|
|
controller?.theme = AlertControllerTheme(presentationTheme: presentationData.theme)
|
|
})
|
|
controller.dismissed = {
|
|
presentationDataDisposable.dispose()
|
|
}
|
|
|
|
return controller
|
|
}
|