iOS notes "cell right-swipe gesture" 2017-09-09

Source: Internet
Author: User

Response cell right-swipe gesture override Func TableView (_ Tableview:uitableview, Editactionsforrowat indexpath:indexpath), [ Uitableviewrowaction]?            {Let Actionshare = Uitableviewrowaction (style:. Normal, Title: "Share") {(_,indexpath) in//define sliding menu style and caption Let Actionsheet = Uialertcontroller (title: "Share to", Message:nil, Preferredstyle:. Actionsheet)//define by button Let Optionqq = uialertaction (title: "QQ", Style:. Default, Handler:nil) let optionweixin = Uialer  Taction (title: "", Style:. Default, Handler:nil) Let Optioncancel = uialertaction (title: "Cancel", Style:. Cancel, Handler:nil)//Add the option operation to Actionsheet actionsheet.addaction (OPTIONQQ) actionsheet.ad  Daction (optionweixin) actionsheet.addaction (optioncancel)//Show self.present (Actionsheet,  Animated:true, Completion:nil)}//Configure button Color Actionshare.backgroundcolor = Uicolor.orange Let Actiondel = Uitableviewrowaction (style:. Destructive, title: "Delete") {(_, Indexpath) in//delete the corresponding data for each row Self.areai Mages.remove (At:indexPath.row) self.areaProvice.remove (at:indexPath.row) self.areas.remove (at:ind            Expath.row) Self.areaType.remove (at:indexPath.row) self.visted.remove (At:indexPath.row)                Delete the row from the data source Tableview.deleterows (at: [Indexpath], with:. Fade)} Let Actiontop = Uitableviewrowaction (style:. Default, Title: "pinned") {(_, _) in} actiontop.b Ackgroundcolor=uicolor (red:245/255, green:199/255, blue:221/255, alpha:1)//Return to the Slide submenu array r Eturn [Actionshare,actiondel,actiontop]}

iOS notes "cell right-swipe gesture" 2017-09-09

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.