How to “cancel” a UIStoryBoardSegue

前端 未结 9 1855
小蘑菇
小蘑菇 2020-12-23 21:40

Does anyone know how to \"stop\" a segue transition conditionally:

My table view cells represent products which can be viewed in a drill-down \"detail\" view... or

9条回答
  •  抹茶落季
    2020-12-23 22:02

    Here another solution I just found.

    In your Mainstoryboard TableView, as you use automatic segue from your cell (identifier=Cell) to the destination view, you can also add another cell with another identifier (identifier=CellWithoutSegue). So when creating new cell in cellForRowAtIndexPath, just reuse the cell identifier you want (with or without segue).

    Hope it helps!

    (Tell me if you want some code source examples).

    Regards,

提交回复
热议问题