mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
23 lines
716 B
Swift
23 lines
716 B
Swift
import Foundation
|
|
|
|
public enum ActionSheetButtonColor {
|
|
case accent
|
|
case destructive
|
|
}
|
|
|
|
public class ActionSheetButtonItem: ActionSheetItem {
|
|
public let title: String
|
|
public let color: ActionSheetButtonColor
|
|
public let action: () -> Void
|
|
|
|
public init(title: String, color: ActionSheetButtonColor = .accent, action: () -> Void) {
|
|
self.title = title
|
|
self.color = color
|
|
self.action = action
|
|
}
|
|
|
|
public func node() -> ActionSheetItemNode {
|
|
return ActionSheetButtonNode(title: AttributedString(string: title, font: ActionSheetButtonNode.defaultFont, textColor: self.color == .accent ? UIColor(0x1195f2) : UIColor.red()), action: self.action)
|
|
}
|
|
}
|