0

I am facing problem with segue as I want to delete particular cell on particular condition when user select cell.

But I also set segue on cell for detail page of cell item. And whenever I am try to delete it always goes to next screen even delete condition is active.

On LongPress I activate delete condition otherwise it should go normally to next screen.

Singhak
  • 7,824
  • 2
  • 29
  • 34

1 Answers1

1

Don't link your button directly to the segue. Control-drag from your source view controller (not your button) to your destination view controller, create a segue of the desired type, and give it a unique identifier.

Then attach an IBAction (not a segue) to your button. In your IBAction method, test your condition(s), and only invoke the segue (using performSegueWithIdentifier) if the conditions are met.

Duncan C
  • 122,346
  • 22
  • 162
  • 258