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
identifierof storyboard segue. make sure correct value.
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.


Comments
Post a Comment