How to “cancel” a UIStoryBoardSegue

前端 未结 9 1856
小蘑菇
小蘑菇 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:01

    I may be wrong here, but after struggling myself with this, I just disabled the cell's user interaction on the cells where I didn't want the seque triggered (in cellForRowAtIndexPath:). Seems to work perfectly, and it's only 1 line of code!

    cell.userInteractionEnabled = NO;
    

提交回复
热议问题