0
let condition = 99

@IBAction func buttonPressed(sender: UIButton) {
    if condition == 1 {
        performSegue(withIdentifier: "basicSegue", sender: self)
    } else {
        // Do nothing
    }
}

This is just the example of what's happening in my main firebase project. I'm really grateful for all replies.

wictorious
  • 851
  • 3
  • 10
  • 24
  • Did you wire the segue from your button. You should wire it from the viewController icon at the top of the VC. See: https://stackoverflow.com/a/26457259/1630618 – vacawama Jun 22 '18 at 20:31
  • this can only happen if the button is the source of the segue – Shehata Gamal Jun 22 '18 at 20:31
  • Oh, thank's for help. The button was a source of the segue. – wictorious Jun 22 '18 at 20:33
  • Alternatively, implement `override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool { return segue.identifier == "basicSegue" && condition == 1 }` – vacawama Jun 22 '18 at 20:34

0 Answers0