[TIMOB-18899] iOS: Support destructive alert style
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-11-26T00:23:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.1.0 |
Components | iOS |
Labels | alertDialog, ios |
Reporter | Hans Knöchel |
Assignee | Pedro Enrique |
Created | 2015-03-08T12:28:17.000+0000 |
Updated | 2017-03-14T22:10:58.000+0000 |
Description
The new iOS8 UIAlertViewController supports an destructive Ti.UI.AlertDialog style, which is specified just like the cancel property.
var win = Ti.UI.createWindow({
backgroundColor: "#fff"
});
var button = Ti.UI.createButton({
title: "Show destructive dialog"
});
var dialog = Ti.UI.createAlertDialog({
title: "Proceed",
message: "Do you really want to proceed?",
destructive: 0,
cancel: 1,
buttonNames: ["Destructive", "Cancel", "Proceed"]
});
button.addEventListener("click", function() {
dialog.show();
});
dialog.addEventListener("click", function(e) {
Ti.API.info(e);
});
win.add(button);
win.open();
Pull-Request: https://github.com/appcelerator/titanium_mobile/pull/6697
PR (from a long time ago): https://github.com/appcelerator/titanium_mobile/pull/6842
Closing ticket as fixed.