UITableViewCell and accessoryView
UITableViewCell and accessoryView
- Subject: UITableViewCell and accessoryView
- From: Hrishikesh Murukkathampoondi <email@hidden>
- Date: Wed, 26 Jan 2011 19:47:25 +0530
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?
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?
Thanks
Hrishi
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden