I can add detect other touches. But how would I know which row 
(UITableViewCell) to remove the accessoryView for?

One, perhaps hacky, way is store a pointer to the UITableViewCell (or store its 
index) that has the accessoryView and if any other cell is touched I can remove 
the accessoryView. Is there a better way to do this. 

Hrishi

On 26-Jan-2011, at 8:51 PM, Luke Hiesterman wrote:

> 
> 
> On Jan 26, 2011, at 6:17 AM, Hrishikesh Murukkathampoondi <hris...@gmail.com> 
> wrote:
> 
>> 
>> 
>> In a UITableView when a cell is swiped a delete button appears and allows 
>> you to delete the row. I want to change this behavior by putting up a 
>> different button "Complete" that will perform a different action.
>> 
>> 
>> For this I created a UISwipeGestureRecognizer and added it to the 
>> UITableViewCell. The swipe handler method modifies the UITableViewCell by 
>> setting a button as its accessoryView.
>> 
>> When the user clicks on the complete button I do the right thing (and also 
>> dispose off the button).
>> 
>> Question 1:
>> Here is where I am stuck. How do I remove the "Complete" button when the 
>> user first swipes and then clicks on some other row or does some other 
>> action.
>> 
>> For example in the Mail application if you swipe to delete an email and then 
>> touch anywhere else except the delete button the delete button goes away. In 
>> my App when the Complete button is displayed  in cell1 and another cell is 
>> touched I want to make the complete button disappear in cell1. But how do I 
>> get a handle to cell1?
>> 
> 
> You'd have to detect touches any where else. Perhaps a gesture recognized on 
> the whole view. 
> 
>> 
>> Question 2:
>> Do I really nee to implement a UISwipeGestureRecognizer for my purpose? A 
>> UITableViewCell already recognizes swipes. Is there a way to change what it 
>> does on a swipe rather than what I have done?
> 
> The UITableViewDelegate protocol provides a method for customizing the text 
> of the delete button, but there isn't a way to customize the behavior beyond 
> that. 
> 
> Luke
> 
>> 
>> 
>> Thanks
>> Hrishi
>> 
>> 
>> _______________________________________________
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
>> 
>> This email sent to luket...@apple.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to