UITableView Delete button - iphone

I want to replace the default delete buttons in editing style of UITableView with my own buttons. how to do it?
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:
(NSIndexPath *)indexPath
{
return #"title!";
}
this edits title of button .What about changing the color of button..
can anyone help me out

We can customize the default delete button in UITableView.But as per the IOS Human Interface guidelines your app may rejected by the apple if ur try to change that one.
You can refer http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/Introduction/Introduction.html

Related

Overriding the default tableview setEditing behaviour

I have currently implemented the setEditing/commitEditing methods for my table view, which now shows the 'delete' button upon swiping a cell.
Just wondering if there is any way to change the text on this button from 'delete' to something else, so that I can use the 'commitEditing' method to perform custom behaviour, such as update some settings?
thanks
You can specify the delete button title with the UITableViewDelegate method:
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath

Delete Button in UITableView

i want a Delete Button in my UITableView like in die AdressBook when editing a contact.
Is this a custom cell, or a UIButton?
To make such button you can do following:
Make your UITableView style Grouped.
Add +1 section to your table.
Say to your table that it is one cell for last section
Just return custom cell (with red background and appropriate label) for last section
If you implement the Delegate method's for edit the tableview
- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
And than implement the DataSource method
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
For allowing to get that delete button when you swipe a cell use the
Cell Editing Style : UITableViewCellEditingStyleDelete
// Edit: Wrong answer.
Do you mean the Big one at the bottom or with the sign on the left?
use....
firstly use
[btn removeFromSuperview];
and
[tblobj reload];

Distinguish between click on AccessoryView and Cell Content and will Apple allow it?(iPhone)

I was wondering if there is a delegate method to implement that let's me distinguish between a tap on the content view of the cell and the disclosure symbol to the right.
I would like to send the user to two different view depending on where on the cell they tap.
I think the event is normally caught by testing if the tableView is:
(self.editing)
I can only remember having seen this functionality during editing in the Alarm Clock and Address Book app. Does anyone know if it is even "allowed" by Apple or is it considered "bad" user interface design? Anyone know of other Apple apps that implements this approach?
Hope someone can shed a little light on this issue:)
Thank you
Implement the Delegate method to handle taps on accessory button
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath;
And you know how to handle cell selection..
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

Can I make a cell be in editing mode all the time?

I have a UITableView with one section. The last row it to add new objects, and it reads "Add Object".
How can I make this cell stay in editing mode so that it will always show the plus icon? I've tried using cell.editing = YES and [cell setEditing:YES animated:NO] but neither makes the cell appear in editing mode.
Thanks!
Implement delegate's
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
method. You might also need to set tableview's editing property to YES, but I am not sure.

Change UITableViewCell appearance when drag handle is pressed

I'd like to change the appearance of a cell when the user tap the drag handle.
I searched in the documentation, forums and google, but I can't find a method or an event that say when the drag icon is pressed.
Any help will be appreciated!
Thanks
Does this function help:
// Allows customization of the target row for a particular row as it is being moved/reordered
- (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath;
It doesn't seem to fire until the cell has been dragged about half way into another cell, though.
It is the only indication I could find that a cell is moving.