Preparing for segue in embedded tableView in Swift

蹲街弑〆低调 提交于 2019-12-07 03:07:25

The UIStoryboardEmbedSegue is used for embed relationships in ViewControllers. It is setting up the parent-child relationship between your RootVC and TableVC. It crashes because chances are you didn't se the identifier for this particular segue. You shouldn't be overriding this function in the RootVC if you are not interested in the embed relationship.

It looks like you didn't set up the segue from your cells properly. If you post a image of your storyboard, we can take a look.

An alternative to this is to set up a segue from your TableVC (not the cells), by control dragging from the yellow VC icon on top of the VC in the storyboard to the destination you want. And then performing the segue programmatically in didSelectRow.

I had a similar problem. You cannot access segue.identifier if the identifier is left empty in storyboard.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!