# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1626641745 0 # Node ID 4628c8c341252a40013cccfaf6fbfccc41882106 # Parent ed2c4a50366640f94d3ffea2729470c0c61c18d7 iOS: Standardize DWContainer behavior part 1. If single selection a single tap on a row will cause ENTER. It multiple selection... single tap will select or deselect. A long tap will cause CONTEXT, a double tap will cause ENTER. diff -r ed2c4a503666 -r 4628c8c34125 ios/dw.m --- a/ios/dw.m Sun Jul 18 15:56:12 2021 +0000 +++ b/ios/dw.m Sun Jul 18 20:55:45 2021 +0000 @@ -2078,6 +2078,8 @@ unsigned long _DW_COLOR_ROW_ODD, _DW_COLOR_ROW_EVEN; int iLastAddPoint, iLastQueryPoint; int filesystem; + NSTimeInterval lastClick; + NSInteger lastClickRow; } -(NSInteger)tableView:(UITableView *)aTable numberOfRowsInSection:(NSInteger)section; -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; @@ -2432,10 +2434,18 @@ /* If multiple selection is enabled, treat it as selectionChanged: */ if([self allowsMultipleSelection]) { - /* Handler for container class */ - _dw_event_handler(self, (id)params, 12); + NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate]; + + /* Handler for container class... check for double tap */ + if(lastClickRow == indexPath.row && now - lastClick < 0.3) + _dw_event_handler(self, (id)params, 9); + else + _dw_event_handler(self, (id)params, 12); /* Handler for listbox class */ _dw_event_handler(self, DW_INT_TO_POINTER((int)indexPath.row), 11); + /* Update lastClick for double tap check */ + lastClick = now; + lastClickRow = indexPath.row; } else /* Otherwise treat it as doubleClicked: */ {