I want to create a popover menu with UIAlertController which includes customize action items, user can define style like font-size , background-color, alignment and Icon Position (Leading / Trailing), how to change icon position, make the icon behind the title ?
enter image description here
I use the following extension to set color and alignment, but don’t know how to set font-size and icon position, please help me find a solution.
extension UIAlertAction {
var titleTextColor: UIColor? {
get { return self.value(forKey: "titleTextColor") as? UIColor }
set { self.setValue(newValue, forKey: "titleTextColor") }
}
var titleAlignment: Int? {
get { return self.value(forKey: "titleTextAlignment") as? Int }
set { self.setValue(newValue, forKey: "titleTextAlignment") }
}
}
William Wang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.