Recognizing when the UITableViewCell delete button is shown - uitableview

I have the following problem:
My UITableViewCell contains an UIButton and if the user swipes from right to left to show the deletion button the button in the Cell gets triggered sometimes.
Is there a way to recognize the swipe or that the deletion button is shown, so I could avoid that the buttons event gets triggered?

Solution: I check in the buttons event whether the tableview is currently in editing mode. This solved the problem :)

Related

Turn off delete confirmation in table view cell after tap on the deletion control

In my tableView I use editing mode for deleting and inserting rows. When I tap on delete, the "delete" button appears on the right of the cell. I want to delete the cell immediately without confirmation.
Is there any way to turn off this delete confirmation after tapping on deletion control?
I want to remove this delete confirmation button.
Unfortunately I didn't find any good native solution for this problem. I solved this problem by custom UIButton which I placed in my custom uitableViewcell, which triggers deletion of the row.

UITableviewCell - Clicking on empty checkmark circle in edit mode does not select cell

I have a table view with several rows. I have enabled multiple selections in edit mode. When I toggle edit mode, I initially select all rows programmatically. Everything works fine except for re-selecting a row that was deselected by tapping on the empty circle where the checkmark was.
Table View Configuration:
Sample Cells, one has been deselected:
The interesting thing is that I can tap on the checkmark to deselect a row (didDeselectRowAtIndexPath is called), but immediately tapping on the same spot again will not call didSelectRowAtIndexPath. I have to tap on the main part of the cell. Naturally, this is not a good user experience.
Here is an overlay showing the areas that respond to taps highlighted in green.
I have been unable to find any events that are fired when tapping on the edit control of a deselected row. I have no code inside didSelectRowAtIndexPath or didDeselectRowAtIndexPath and I am just relying on the list of selected cells that the tableview maintains when the edit mode is toggled off. Any help isolating this issue would be greatly appreciated.
The problem ended up being that I was setting a backgroundView on my custom table cell and that was preventing the touches from getting to the right target.

How to disable the selection on UITableViewCell's accessory view only?

My UITableViewCell has an accessory view of UIButton on the right edge of the cell. However, the button might not be available to an user and thus I shall disable it via self.myButton.enabled = false.
While this makes the cell selection work as usual however, now the selection also reacts to the tap on the button. In other words, while the button is disabled and the user still taps on the button, the tap is now responding to the didSelectRowAtIndexPath: method.
This is not what I want, since it might confuse my users at times. So I want to implement it as follows:
When the button is available, tapping the cell and tapping the button execute different methods respectively (which I implemented and worked).
When the button is unavailable, tapping the cell works only on the part of where the button is not located.
Is it possible to set the functionality here?

How to prevent disclosure button being triggered on a UITableViewCell when swiping left

This seems like a simple enough problem but I can't seem to find a solution.
I have a table view that has cells with the disclosure button. I'm using accessoryButtonTappedForRowWithIndexPath to trigger the click on the button so that it takes the user to an info page.
I also have the swipe left to delete action set up on the cell.
The problem is, when the user swipes left, but while doing so touches the disclosure button, both actions occur (meaning accessoryButtonTappedForRowWithIndexPath gets fired, but also the swipe left happens).
Is there any way to prevent this? I would like that when the swipe happens, only "swipe left to delete" occurs and the info page does not fire (which should only fire upon a click).
I'll attempt to explain what I think was going on. The function accessoryButtonTappedForRowWithIndexPath seems to bind the accessory button to a touch up inside event, which gets fired when you do a drag and lift up your finger after because your finger is still inside the button (which followed the drag).
I worked around this by using a custom button and attaching an UITapGestureRecongnizer to it.

How can I detect a right swipe on UITableCell and display a custom button instead of Delete button

I want to display a "Duplicate" button where the Delete button would usually appear if the user swipes from left to right on a UITableView cell. I understand I can add a gesture recogniser to the cell as per this example https://stackoverflow.com/a/6167841/2567126.
How do I create and place a button on the cell so that it appears in a similar manner to the Delete button to allow the user to confirm the action? The cells are just standard UITableViewCells with the default style.
You can change the title of delete button with delegate method - tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:.

Resources