AsyncDisplayKit icon indicating copy to clipboard operation
AsyncDisplayKit copied to clipboard

ASCellNode with SWTableViewCell

Open asolakhyan opened this issue 11 years ago • 3 comments

Hi,

I was wondering if ASCellNode support iOS 7/8 style pan gestures (i.e. swipeable content view), sort of what SWTableViewCell does to UITableViewCell.

Thank you.

asolakhyan avatar Apr 04 '15 01:04 asolakhyan

Hi @asolakhyan ! Did you went further on your implemention of the swipe into ASCellNode ? How did it go ?

macistador avatar Feb 08 '16 12:02 macistador

I'm working on a case similar to this. Targeting iOS 8 or above you can use this:

func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {

    let editAction = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: "Mute 2h") { (rowAction, indexPath) in

    }
    editAction.backgroundColor = UIColor.railroadSecondaryColor()


    let deleteAction = UITableViewRowAction(style: .Default, title: "Leave") { (rowAction:UITableViewRowAction, indexPath:NSIndexPath) -> Void in
        //TODO: Delete the row at indexPath here
    }
    deleteAction.backgroundColor = UIColor.railroadActiveColor()

    return [deleteAction, editAction]
}

reyneiro avatar Apr 02 '16 02:04 reyneiro

@asolakhyan: Thanks for contributing to the AsyncDisplayKit community by asking your question here! I apologize that it has taken me so long to get to this question. Unfortunately, at this time we do not have any plans to support this.

However, feel free to follow up with @reyneiro or @alexrmacleod (who If I'm remembering correctly implemented a sweet example using MGSwipeTableCell - see conversation in #1586).

appleguy avatar May 11 '16 01:05 appleguy