Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8939449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:49:31+00:00 2026-06-15T10:49:31+00:00

I have a tableview with a label and two buttons on each cell. At

  • 0

I have a tableview with a label and two buttons on each cell. At the moment I have this code that does a swipe to delete.

- (void) tableView: (UITableView *) tableView commitEditingStyle: (UITableViewCellEditingStyle) editingStyle forRowAtIndexPath: (NSIndexPath *) indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        [appointments removeObjectAtIndex: indexPath.row];  // manipulate your data structure.
        [tableView deleteRowsAtIndexPaths: [NSArray arrayWithObject: indexPath]
                         withRowAnimation: UITableViewRowAnimationFade];
       NSLog(@"row deleted");  // Do whatever other UI updating you need to do.
    }
} 

This code gets executing when I swipe. But I want it to execute when a button is pressed. The button is linked with the following IBAction.

- (IBAction)deleteRow:(id)sender {
  //Delete row
}

One thing to keep in mind. I want that the delete button slides like when you swiped to delete.

Can anybody help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:49:33+00:00Added an answer on June 15, 2026 at 10:49 am

    If your button is in the cell, you could set its tag property to the indexPath.row value and assign it the deleteRow:(id)sender method for target via -(void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents In order to have the button slide, you may need to implement the panGestureRecognizer. I may be wrong about this but the idea should be pretty much to detect the touch locations & slide the button (setting its frame as you slide). And you may need to disable swipe to delete on the table if your intention is to delete by sliding the button.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main ViewController that has two buttons that each segue to their
I have a tableView that present a list of Books, each of the table
I have a UITableView and a UITableCell subclass. Each table cell has two scrollviews
I have a label timer inside a UITableViewCell , using this code - (UITableViewCell
i have a custom table view cell. With two labels. The Label on the
I have a label on a UITableView. When clicked it will refresh my tableview
I have a TableView with 10 sections that are loaded from a plist file
I have a TableView associated to a TreeView. Each time a node in the
i have a tableView with 3 cells. i want to change .detailTextLabel of that
i have a problem that i have two lables, 1) will contain a long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.