Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old Sep 25, 2008, 12:56 PM   #1
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
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
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
macrumors 68020
PhoneyDeveloper's Avatar
Join Date: Sep 2008
Come on guys, all this stuff is documented in the Table View programming guide:

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.
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

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Do we need to delete cloud music from iOS devices? thatsmyaibo iCloud and Apple Services 3 Nov 20, 2011 03:15 AM
How to delete unneeded printer drivers in Lion? axio Mac OS X 10.7 Lion 4 Jul 31, 2011 08:37 PM
Is it safe to delete my iPhoto library? MrFluffums Mac Applications and Mac App Store 3 Apr 12, 2011 08:01 PM
Way to delete podcast downloads from the Downloads window? BlueberryMac Mac Applications and Mac App Store 1 Mar 28, 2011 05:24 AM
Swipe to delete an email from list. 4DThinker iPod touch 3 Apr 17, 2008 03:41 PM

All times are GMT -5. The time now is 08:25 PM.

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

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