Latest 0.7.2
Homepage https://github.com/spaceelephant/SESlideTableViewCell
License MIT
Platforms ios 8.0, requires ARC
Authors

SESlideTableViewCell

A subclass of UITableViewCell that shows buttons with swiping it.

Features

  • Portable. Made up with only one header and one source file.
  • Indicator that shows which way you can swipe.
  • Compatible with iOS 7 – 9.
  • Supports Swift language.

Requirements

SESlideTableViewCell runs on iOS 7 and later.
It also works iOS 8 and it can be used in Swift language.

How to Set up

Use CocoaPods to set up SESlideTableViewCell.

platform :ios, "7.0"
pod 'SESlideTableViewCell'

See http://cocoapods.org/ for more information about CocoaPods.

Getting Started with Objective-C

You can create a SESlideTableViewCell in your UITableViewController like this.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSString * const CELL_ID = @"Cell";
    SESlideTableViewCell* cell = (SESlideTableViewCell*)[tableView dequeueReusableCellWithIdentifier:CELL_ID];
    if (!cell) {
        cell = [[SESlideTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CELL_ID];
        cell.delegate = self;
        [cell addRightButtonWithText:@"Hello" textColor:[UIColor whiteColor] backgroundColor:[UIColor colorWithHue:0.0/360.0 saturation:0.8 brightness:0.9 alpha:1.0]];
        [cell addRightButtonWithText:@"World!!" textColor:[UIColor whiteColor] backgroundColor:[UIColor colorWithHue:180.0/360.0 saturation:0.8 brightness:0.9 alpha:1.0]];
    }
    return cell;
}

You can know which button is triggered with a SESlideTableViewCellDelegate method.

- (void)slideTableViewCell:(SESlideTableViewCell*)cell didTriggerRightButton:(NSInteger)buttonIndex {
    NSLog(@"right button triggered:%d", (int)buttonIndex);
}

Getting Started with Swift

You can create a SESlideTableViewCell in your UITableViewController like this.

override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell? {
    let CELL_ID = "Cell"
    var cell = tableView.dequeueReusableCellWithIdentifier(CELL_ID) as? SESlideTableViewCell
    if !cell {
        cell = SESlideTableViewCell(style: .Default, reuseIdentifier: CELL_ID)
        cell!.delegate = self
        cell!.addRightButtonWithText("Hello", textColor: UIColor.whiteColor(), backgroundColor: UIColor(hue: 0.0/360.0, saturation: 0.8, brightness: 0.9, alpha: 1.0))
        cell!.addRightButtonWithText("World!!", textColor: UIColor.whiteColor(), backgroundColor: UIColor(hue: 180.0/360.0, saturation: 0.8, brightness: 0.9, alpha: 1.0))
    }

    return cell
}

You can know which button is triggered with a SESlideTableViewCellDelegate method.

func slideTableViewCell(cell: SESlideTableViewCell!, didTriggerRightButton buttonIndex: NSInteger) {
    let indexPath = tableView.indexPathForCell(cell)
    println("right button (buttonIndex) tapped in cell (indexPath.section) - (indexPath.row)")
}

Documentation

The reference manual is avaiable at:
http://cocoadocs.org/docsets/SESlideTableViewCell/

License

MIT license.

Limitations

The animation of the contents in the cell stops while buttons are displayed.
This comes from using snapshot to display the existing content in the cell.

Aknowledgement

Thank you for your contribution.

Latest podspec

{
    "name": "SESlideTableViewCell",
    "version": "0.7.2",
    "summary": "A subclass of UITableViewCell that shows buttons with swiping it.",
    "homepage": "https://github.com/spaceelephant/SESlideTableViewCell",
    "screenshots": "http://i.imgur.com/395rqmq.gif",
    "license": "MIT",
    "authors": {
        "Junji Tago": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/spaceelephant/SESlideTableViewCell.git",
        "tag": "0.7.2"
    },
    "source_files": "SESlideTableViewCell/lib",
    "public_header_files": "SESlideTableViewCell/lib/*.h",
    "requires_arc": true
}

Pin It on Pinterest

Share This