Merge pull request #1474 from PeterStaev/dialog-action-fix

fix ios dialogs.action when message/title is null
This commit is contained in:
Vladimir Enchev
2016-02-03 10:53:04 +02:00

View File

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