views:

1691

answers:

4

I have gone through following question.

http://stackoverflow.com/questions/1607155/how-to-change-iphone-uitableview-delete-button-title-while-editing-it

-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath{
 return @"Sagar";
}

I want a custom image instead of default red button.

Don't know how.

Thanks in advance for sharing your knowledge.

Sagar.

A: 

You can try to create your own button and add it as a subView to your cell.

Morion
+1  A: 

Probably not a good idea to change that button to something else, users expect that behavior remains consistent. If Apple wanted that bit of detail to be customizable, they would have included a way.

luvieere
Ok. But the client said that, when I flick on a cell, there should a button for going into list - playlist. orange colored.
sugar
If it is standard, Then why they have given an option to change the name of delete button?
sugar
For internationalization, so you could translate that "Delete" into another language's equivalent
luvieere
Let me give an example. MPMovieplayer is private api. Then How YouTube could customize it? ( YouTube has added two more buttons add to favorites, email this video ). There should some way. Why apple just keep customization limited to themselves?
sugar
To understand my previous comment - read this question. http://stackoverflow.com/questions/1596089/mpmovieplayercontroller-with-a-custom-button-on-its-toolbar
sugar
+2  A: 

luvieere is right -- if you want that same "delete" metaphor, you want to keep it at the red button that Apple provides. Why change it? Its globally recognizable as the standard for delete buttons.

Although, if you want something like Tweetie, where you completely change the behavior of swiping, you could use something like ABTableViewCell where you just draw in your own view. Make a custom table view, override -touchesBegan:withEvent:, and check for touches. Calculate the delta of the two touches (in touchesMoved:withEvent:) and move your own view around.

Ok. But the client said that, when I flick on a cell, there should a button for going into list - playlist. orange colored.
sugar
In that case, you'll have to draw the button yourself.
+1  A: 

The systemwide standard for the intended list-dive-in action, as you said in the comment on luvieere's answer, would be to use the detail-disclosure (blue circled arrow) cell accessory, not the swipe gesture.

That said, if you still want to use the swipe action for this, there's no way to provide your own button without manually intercepting and completely reimplementing the swipe gesture, like what Tweetie does.

Marco