fix ios dialogs.action when message/title is null

This commit is contained in:
Peter Staev
2016-02-02 18:41:36 +02:00
parent bf96d83cc4
commit 31a6da0676

View File

@ -403,11 +403,15 @@ function showUIAlertController(alertController: UIAlertController) {
var lblColor = dialogsCommon.getLabelColor(); var lblColor = dialogsCommon.getLabelColor();
if (lblColor) { if (lblColor) {
if (alertController.title) {
var title = NSAttributedString.alloc().initWithStringAttributes(alertController.title, <any>{ [NSForegroundColorAttributeName]: lblColor.ios }); var title = NSAttributedString.alloc().initWithStringAttributes(alertController.title, <any>{ [NSForegroundColorAttributeName]: lblColor.ios });
alertController.setValueForKey(title, "attributedTitle"); alertController.setValueForKey(title, "attributedTitle");
}
if (alertController.message) {
var message = NSAttributedString.alloc().initWithStringAttributes(alertController.message, <any>{ [NSForegroundColorAttributeName]: lblColor.ios }); var message = NSAttributedString.alloc().initWithStringAttributes(alertController.message, <any>{ [NSForegroundColorAttributeName]: lblColor.ios });
alertController.setValueForKey(message, "attributedMessage"); alertController.setValueForKey(message, "attributedMessage");
} }
}
viewController.presentModalViewControllerAnimated(alertController, true); viewController.presentModalViewControllerAnimated(alertController, true);
} }