Problem description
When a TableView is editable, the swipe event is not fired; instead, swiping on the table row just lets you edit it.
Steps to reproduce
Use the following code to test the issue. Changing 'editable' to 'false' fires the event.
var win1 = Ti.UI.createWindow({
backgroundColor: "#FFF",
layout: "vertical",
fullscreen: true
});
var rows = [];
for (var i=0; i<10; i++) {
var row = Ti.UI.createTableViewRow({
title: "Row " + i
});
rows.push(row);
}
var table = Ti.UI.createTableView({
editable: true,
data: rows
});
table.addEventListener('swipe', function(e) {
alert(e);
});
win1.add(table);
win1.open();
I tried with Motorola Zoom and Nexus S. Regardless of 'editable' flag, the 'swipe' event is fired. SDK 3.1.0
The swipe event does not work on iOS. Ti SDK 3.1.0.v20130402092426
This is a property of iOS: When a row is editable, the native behavior is to have a swipe be a delete command. The native OS grabs this before we can. https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006938 Note that the transitions don't have an option to block this, natively. Will need to update docs for this.
Blain. Could you set up a doc PR for this update.
PR merged: https://github.com/appcelerator/titanium_mobile/pull/4301
Swipe event is getting fired when editable property is set to true. Verified fix on: Device : iPhone 5 , iOS version : 7.0 SDK: 3.2.0.v20131016191202 CLI version : 3.2.0 OS : MAC OSX 10.8.4 Alloy : 1.2.2 Appcelerator Studio, build: 3.2.0.201310112258 XCode : 5