cancel
Showing results for 
Search instead for 
Did you mean: 

iOS: Performing swipe action on the tablecell.

SOLVED
New Contributor

iOS: Performing swipe action on the tablecell.

In our iOS app, we have a table and swiping from right to left on any cell activates the delete button.

Using TC, I am not able to perform the swipe action. Recording the swipe action in the UI, generates the following line but running it fails with "Object doesn't support this property"error. Please let me know if there's any work around for swipe action.



Sub Test

Mobile.Device.Process("x").Window.TableView.TableViewCell(1, 0).ScrollView.wPositionX = 82

End Sub



Thanks!



1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: iOS: Performing swipe action on the tablecell.

We've had some issues with this in the past too, but I think we have found a good solution to swipe from right to left in a TableVewCell. An example procedure is below (in DelphiScript). It finds the coordinates by using the cell's position and size, then swipes. Just pass in the TableViewCell object:

procedure SwipeToExposeRemoveButton(oTableViewCell : OleVariant);
var
iScreenTop, iScreenLeft, xStart, yStart, xEnd, yEnd : integer;
begin


    iScreenTop  := oTableViewCell.ScreenTop;  // Get distance from top of cell to top of screen
    iScreenLeft := oTableViewCell.ScreenLeft;  // Get distance from left of cell to left of screen

    // Define start and end coordinates to swipe
    xStart := iScreenLeft + oTableViewCell.Width * 0.99;  // Distance left of object + 99/100 the width of cell
    yStart := oTableViewCell.Height/2 + iScreenTop;         // Middle of cell heightwise
    xEnd   := iScreenLeft + oTableViewCell.Width * 0.01; // Distance left of object + 1/100 the width of cell
    yEnd   := yStart;
    
    // Swipe to expose remove button
    Mobile.Device.Swipe(xStart, yStart, xEnd, yEnd, 5, 200);
       
end;

 

Hope this helps!

-Corey

4 REPLIES 4
Community Manager

RE: iOS: Performing swipe action on the tablecell.

Hi Rani,

 


Can you check whether the Swipe method is applied to the app window or the table window? You could try calling it. Please read the "Swipe Method" article for details.


 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Contributor

Re: RE: iOS: Performing swipe action on the tablecell.

In our iOS app, we have a table and swiping from right to left on any cell activates the Custom button.

 

Using TC, I am not able to perform the swipe action. Recording the swipe action in the UI, generates the following line but running it fails with "min =0 max =30 , set to 30" error. Please let me know if there's any work around for swipe action.

tried different options but no sucess, please hlep me here

Aliases.Device.processSaminspectTc.window0.tableview0.TableViewCell0_0.scrollview0.wPositionX = 95;

 

thanks in advance

Highlighted
Occasional Contributor

Re: iOS: Performing swipe action on the tablecell.

We've had some issues with this in the past too, but I think we have found a good solution to swipe from right to left in a TableVewCell. An example procedure is below (in DelphiScript). It finds the coordinates by using the cell's position and size, then swipes. Just pass in the TableViewCell object:

procedure SwipeToExposeRemoveButton(oTableViewCell : OleVariant);
var
iScreenTop, iScreenLeft, xStart, yStart, xEnd, yEnd : integer;
begin


    iScreenTop  := oTableViewCell.ScreenTop;  // Get distance from top of cell to top of screen
    iScreenLeft := oTableViewCell.ScreenLeft;  // Get distance from left of cell to left of screen

    // Define start and end coordinates to swipe
    xStart := iScreenLeft + oTableViewCell.Width * 0.99;  // Distance left of object + 99/100 the width of cell
    yStart := oTableViewCell.Height/2 + iScreenTop;         // Middle of cell heightwise
    xEnd   := iScreenLeft + oTableViewCell.Width * 0.01; // Distance left of object + 1/100 the width of cell
    yEnd   := yStart;
    
    // Swipe to expose remove button
    Mobile.Device.Swipe(xStart, yStart, xEnd, yEnd, 5, 200);
       
end;

 

Hope this helps!

-Corey

New Contributor

Re: iOS: Performing swipe action on the tablecell.

Hi Corey,

 

 

thanks for the reply.

 

your solution worked for me.

 

Soujanya

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors