swift - Segue from a Custom Cell in UItableVew in IOS -


i have created custom cell , want perform segue viewcontroller clicking on it.

i used didselectrowatindexpath method , performed segue no result. segue not work!

override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) {     self.performseguewithidentifier("todetailviewsegue", sender: self) }  override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) {     let indexpath = tableview.indexpathforselectedrow;     let cellname = tableview.cellforrowatindexpath(indexpath!) as! cardtableviewcell;     let detailviewcontroller = segue.destinationviewcontroller     detailviewcontroller.title = cellname.textlabel?.text  } 

check following items:

first, make sure established segue. in table view controller, control click on yellow icon @ top of table view controller's scene in storyboard. drag destination view.

second, make sure name of storyboard segue matches desired value (todetailviewsegue).

  • in storyboard, click on segue created (either in document outline or directly on storyboard).
  • in utilities bar (right-side pane), go attributes inspector. there see identifier of storyboard segue. make sure correct value.

enter image description here

third, make sure custom table view cell has user interaction enabled checked.

  • in storyboard, click on custom cell.
  • go attributes inspector. interaction field within view section. make sure checked.

enter image description here


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -