Изменение цвета текста, шрифт, начертание в title и message alertController - Swift - 5
let alertController = UIAlertController(
title: "Выберите действие",
message: "Список вариантов",
preferredStyle: .actionSheet)
// Message:
alertController.
setValue(NSAttributedString(
string: alertController.message!,
attributes: [NSAttributedStringKey.
font : UIFont.
systemFont(ofSize: 15,
weight: UIFont.Weight.medium), NSAttributedStringKey.
foregroundColor : UIColor.black]),
forKey: "attributedMessage")
// Title:
alertController.setValue(NSAttributedString(
string: alertController.message!,
attributes: [NSAttributedStringKey.
font : UIFont.
systemFont(ofSize: 29,
weight: UIFont.Weight.medium), NSAttributedStringKey.
foregroundColor : UIColor.red]),
forKey: "attributedTitle")
Возврат к списку