Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18899] iOS: Support destructive alert style

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-11-26T00:23:06.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsiOS
LabelsalertDialog, ios
ReporterHans Knöchel
AssigneePedro Enrique
Created2015-03-08T12:28:17.000+0000
Updated2017-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

Comments

  1. Hans Knöchel 2015-11-26

    PR (from a long time ago): https://github.com/appcelerator/titanium_mobile/pull/6842
  2. Lee Morris 2017-03-14

    Closing ticket as fixed.

JSON Source