Didselectrowatindexpath Tap Event Response latency in iOS development

Source: Internet
Author: User

To add the tapped event for UITableViewCell, the code is as follows:

Class Videoviewcontroller:uiviewcontroller, Uitableviewdatasource,uitableviewdelegate {//...    Func TableView (Tableview:uitableview, didDeselectrowatindexpath indexpath:nsindexpath) {        //play box background picture Let        imagename:string = "cs50-" +string (indexpath.row+1) let        image:uiimage = UIImage (named:imagename)!        Backgroundimageview.image = Nil        Backgroundimageview.contentmode = Uiviewcontentmode.scaleaspectfit        Backgroundbackimageview.clipstobounds = true        backgroundbackimageview.image = Image    }}

I want to click on a video in the list and then display the background image of the video in the Uiimageview above the screen. However, the result of the operation backfired, the first tap did not respond; the second tap after Uiimageview displays the picture that should appear the first time you click it.

A careful examination revealed that, in addition to the didSelectRowatindexpath, the TableView delegate method had a diddeselectRowatindexpath, The two do not look closely at all. Since the code auto-complete the de line before SE, so I chose the inappropriate method Diddeselect ...

Thank you for this theme: "Ghosts" in iphone development--press two times,-(void) Tableview:diddeselectrowatindexpath: only response

Didselectrowatindexpath Tap Event Response latency in iOS development

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.