Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12783] iOS: Swipe event not fired when TableView has property editable set to true

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-04T17:35:54.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 12 API, 2013 Sprint 12, Release 3.2.0
ComponentsiOS
Labelsexalture, module_tableview, qe-testadded
ReporterDavide Cassenti
AssigneeBlain Hamon
Created2013-02-19T17:59:37.000+0000
Updated2014-06-19T12:42:54.000+0000

Description

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();

Comments

  1. Sunila 2013-03-07

    I tried with Motorola Zoom and Nexus S. Regardless of 'editable' flag, the 'swipe' event is fired. SDK 3.1.0
  2. Pedro Enrique 2013-04-02

    The swipe event does not work on iOS. Ti SDK 3.1.0.v20130402092426
  3. Blain Hamon 2013-05-07

    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.
  4. Vishal Duggal 2013-05-09

    Blain. Could you set up a doc PR for this update.
  5. Benjamin Hatfield 2013-06-04

    PR merged: https://github.com/appcelerator/titanium_mobile/pull/4301
  6. Paras Mishra 2013-10-17

    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

JSON Source