explaingit

cewendel/swtableviewcell

7,078Objective-CAudience · developerComplexity · 2/5Setup · easy

TLDR

An Objective-C iOS library that adds swipe-to-reveal action buttons to table view rows, the same behavior as the iOS Mail app, with support for custom colors, icons, and tap callbacks.

Mindmap

mindmap
  root((SWTableViewCell))
    What it does
      Swipe gestures
      Reveal action buttons
      Smooth dismiss
    Tech Stack
      Objective-C
      iOS
      CocoaPods
    Button Options
      Text labels
      Colored backgrounds
      Icon images
    Use Cases
      Email-style lists
      Action menus
      Legacy iOS apps
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add swipe-to-delete or swipe-to-archive buttons to any iOS table view list without writing gesture logic from scratch.

USE CASE 2

Build an email-style inbox where swiping a row reveals labeled action buttons with custom colors on both sides.

USE CASE 3

Add swipe actions to custom Interface Builder cells in a legacy Objective-C iOS project.

Tech stack

Objective-CiOSCocoaPods

Getting it running

Difficulty · easy Time to first run · 30min

Targets iOS 6.1+ and Objective-C only, not intended for new Swift projects.

In plain English

On iOS, scrollable lists of items are built using a component called a table view, where each row is a cell. This Objective-C library adds swipe gestures to those cells, letting users reveal hidden action buttons by swiping left or right on a row, the same behavior you see in the built-in Mail and Reminders apps. Swipe left on a cell and buttons appear on the right side. Swipe right and buttons appear on the left. You can add as many buttons as you want to either side, and the library automatically adjusts their size so they all fit. Each button can have a text label, a colored background, or an icon image. When the user taps a button, a delegate method fires so your code can respond to whichever button was pressed. The library also handles an edge case that the built-in behavior gets wrong: if a user taps the cell while the buttons are visible, the cell slides back to its original position instead of triggering the cell's selection event. This matches how the iOS Mail app works, where accidentally touching a swiped-open cell does not open the underlying item. The library works with both standard table view cells and custom-designed cells built with Interface Builder. Adding it to a project is done either through CocoaPods, which is a package manager for iOS projects, or by copying the source files directly into your Xcode project. This library targets iOS 6.1 and later, including iOS 7. Given its age and the Objective-C language it uses, it is primarily relevant to older iOS projects or developers maintaining legacy apps rather than new projects using Swift.

Copy-paste prompts

Prompt 1
Add SWTableViewCell to my iOS project via CocoaPods and show me how to attach a delete and archive button to each table row.
Prompt 2
How do I add different swipe action buttons to the left and right side of a table cell using SWTableViewCell in Objective-C?
Prompt 3
Show me how to implement the SWTableViewCell delegate callback that fires when the user taps the second button on a swiped-open row.
Prompt 4
I am using a custom UITableViewCell subclass built in Interface Builder, how do I make SWTableViewCell work with it?
Open on GitHub → Explain another repo

← cewendel on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.