IOS8 using Uitableviewrowaction to implement cell custom slide operation

Source: Internet
Author: User

-  (BOOL) TableView: (uitableview *) Tableview caneditrowatindexpath: (nsindexpath *) indexPath{     return yes;} -  (Uitableviewcelleditingstyle) TableView: (uitableview *) Tableview editingstyleforrowatindexpath :(nsindexpath *) Indexpath{    return uitableviewcelleditingstyledelete;} -(nsarray *) TableView: (uitableview *) Tableview editactionsforrowatindexpath: (NSIndexPath * ) indexpath{    uitableviewrowaction *laytoprowaction1 = [ uitableviewrowaction rowactionwithstyle:uitableviewrowactionstyledestructive title:@ "Delete"   handler:^ (Uitableviewrowaction *action, nsindexpath *indexpath)  {         nslog (@ "clicked Delete");        [tableview  setediting:no animated:yes];    }];      Laytoprowaction1.backgroundcOlor = [uicolor redcolor];    uitableviewrowaction *laytoprowaction2  = [uitableviewrowaction rowactionwithstyle:uitableviewrowactionstyledestructive title:@ " Pinned " handler:^ (Uitableviewrowaction *action, nsindexpath *indexpath)  {         nslog (@ "click on top");         [tableview  setEditing:NO animated:YES];    }];             layTopRowAction2.backgroundColor = [UIColor greenColor];     UITableViewRowAction *layTopRowAction3 = [UITableViewRowAction  rowactionwithstyle:uitableviewrowactionstyledestructive title:@ "More"  handler:^ (UITableViewRowAction  *action, nsindexpath *indexpath)  {        nslog (@ "Click for more");        [tableView setEditing:NO animated:YES];          }];    layTopRowAction3.backgroundColor = [UIColor  Bluecolor];    nsarray *arr = @[laytoprowaction1,laytoprowaction2, Laytoprowaction3];    return arr;}

IOS8 using Uitableviewrowaction to implement cell custom sliding operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.