Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Sources/AlertController/AlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public extension UIAlertController {
style: UIAlertAction.Style = .default,
icon: String? = nil,
systemIcon: String? = nil,
color: UIColor? = nil,
titleColor: UIColor? = nil,
imageTintColor: UIColor? = nil,
enabled: Bool = true,
checked: Bool = false,
leftAligment: Bool = false,
Expand All @@ -48,8 +49,11 @@ public extension UIAlertController {
if let systemIcon = systemIcon {
action.setIcon(systemIcon, isSystem: true)
}
if let color = color {
action.setColor(color)
if let color = titleColor {
action.setTitleColor(color)
}
if let color = imageTintColor {
action.setImageTintColor(color)
}
action.isEnabled = enabled
action.setChecked(checked)
Expand Down Expand Up @@ -109,8 +113,11 @@ public extension UIAlertAction {
}
}

func setColor(_ color: UIColor) {
func setTitleColor(_ color: UIColor) {
setValue(color, forKey: "titleTextColor")
}

func setImageTintColor(_ color: UIColor) {
setValue(color, forKey: "imageTintColor")
}

Expand Down