Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 25, 2008, 12:56 PM   #1
caldwelljason
macrumors member
 
Join Date: Jul 2008
Swipe to delete?

OK. Bonehead question of the day:

I have added a UITableView to a view. I would like to have the "swipe to delete" behavior. Everything I read from Apple indicates it's "just there" on a UITableView. But no so much for me...

I am handling the editingStyleForRowAtIndexPath method and returning UITableViewCellEditingStyleDelete, but that never gets called. My other delegate methods do. I copied the signature directly from the documentation, so I believe it to be correct.

I also implemented the willBeginEditingRowAtIndexPath and didEndEditingRowAtIndexPath methods, which are (obviously) also not called.

I can set the whole table to edit mode and it works fine. But then I have the delete icons all the time. Don't want it. I also don't necessarily want to go with a button to enter and leave "Edit" mode, if I can avoid it.

Any help? Is there something I have to do to the list to get it to respond to the swipe?
caldwelljason is offline   0 Reply With Quote
Old Sep 25, 2008, 01:08 PM   #2
caldwelljason
Thread Starter
macrumors member
 
Join Date: Jul 2008
Bonehead answer

You have to implement commitEditingStyle to get that behavior.

I wish that was documented somewhere.

I decided to just move on and get the data implementation working. As soon as I added that method, my swipe action worked...

Anyway, there it is, documented so that I will find it next time I search for it...
caldwelljason is offline   0 Reply With Quote
Old Sep 28, 2008, 08:00 AM   #3
elronaldo
macrumors newbie
 
Join Date: Sep 2008
When using this Swipe to Delete mode is it possible to detect this specific edit mode? For example when you are in swipe-delete view the left side of the cell does not need to be adjusted, as the delete circle is not shown.

Any ideas?
elronaldo is offline   0 Reply With Quote
Old Sep 28, 2008, 08:30 AM   #4
PhoneyDeveloper
macrumors 68030
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
Come on guys, all this stuff is documented in the Table View programming guide:

Quote:
The table view sends the tableView:commitEditingStyle:forRowAtIndexPath: message to the data source. Although this protocol method is marked as optional, the data source must implement it if it wants to insert or delete a row.
Quote:
When the user swipes a row to delete it, the table view sends setEditing:animated: to itself and enters editing mode. In this “swipe to delete” mode, the table view does not display the editing and reordering controls. Because this is a user-driven event, it also brackets the messages to the delegate inside of two other messages:
You can do a full-text search of the documentation by the following method:

Enter the text you want to search for, say 'swipe' in the search box at the top of the documentation window. Select 'Apple iPhone OS 2.1' in the Doc Sets Pane. Choose 'Full-Text' in the selection bar at the top left. Then search.
PhoneyDeveloper is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
new gmail app, can anyone swipe to delete? pixelchild iPhone and iPod touch Apps 5 Oct 22, 2014 07:48 PM
IOS 7.0.4 - Unable to Swipe to Delete in mail app sedgeman iOS 7 5 Nov 18, 2013 02:39 PM
iOS 7 Mail - How to swipe to delete Gmail messages rather than archive them bjcskier iOS 7 6 Sep 21, 2013 06:13 PM
iPhone ewon't delete emails when I delete them on my MacBook and I macs. johnstonimages iCloud and Apple Services 3 Mar 12, 2013 10:00 PM
Remove "Swipe to Delete" on iPod Touch NicMakesNoise iPod touch 5 Sep 1, 2012 09:24 AM

Forum Jump

All times are GMT -5. The time now is 07:01 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC