Re: Table cell: how show blue when tapped only while editing is true?
Re: Table cell: how show blue when tapped only while editing is true?
- Subject: Re: Table cell: how show blue when tapped only while editing is true?
- From: Luke the Hiesterman <email@hidden>
- Date: Thu, 10 Sep 2009 08:28:45 -0700
When you want nothing to happen, cell.selectionStyle =
UITableViewCellSelectionStyleNone;
When you want blue, cell.selectionStyle =
UITableViewCellSelectionStyleBlue;
Luke
On Sep 9, 2009, at 11:42 PM, Steve Fogel wrote:
Hi, all...
I've got a table view for which users must tap an Edit button before
they can make changes. This button puts the table view in editing
mode.
How can I make the cell show blue (it's selected) only while editing
is true?
The scenario I want:
When editing = NO
1. User taps a cell (with default white background) and holds down
finger. No reaction, no blue
2. User lifts finger, nothing happens.
When editing = YES
1. User taps cell and holds down finger. Cell turns blue.
2. User lifts finger. Cell goes white again and is processed by
didSelectRowAtIndexPath. (didSelectRowAtIndexPath deselects cell,
then processes.)
I have #2 under control in each case, but can't figure out how to do
#1. In cellForRowAtIndexPath, I tried setting selectionStyle to
UITableViewCellSelectionStyleBlue if editing is true and to
UITableViewCellSelectionStyleNone if editing is false, but, during
the transition from not-editing to editing, unless I run reloadData,
or slide the cell out of view and then back in again, the selection
style change doesn't occur. I don't want to reload data when the
user clicks Edit, because I have some animations going (I remove a
section while editing), and reloadData fouls up the animation.
Any ideas?
Thx
Steve
_______________________________________________
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
_______________________________________________
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