title: How can stop to jump next view controller? (swift)
body: <p>I am using segue to send data from one <code>viewController</code> to <code>destinationViewController</code>. I set button and use push segue to connects to next view controller. In the first view, I set a boolean to check the images is or not empty. If there is any empty, it will pop up alert to remind users. If success, it will send the images to next view controller. </p>
  
  <p>Although I can transmit the images and pop up the alert, it also jump to next view controller if there is any empty. Moreover, the alert is popped after jumping to next view controller, not in the first view controller</p>
  
  <p>Now, here is the code</p>
  
  <pre><code>override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  
      if Jumpsuit.isHidden == false &amp;&amp; self.Hair.image != nil &amp;&amp; self.Jumpsuit.image != nil &amp;&amp; self.Shoes.image != nil {
  
          let DestViewController : ChooseBGViewController = segue.destination as! ChooseBGViewController
  
          DestViewController.imgHair = Hair.image
          DestViewController.imgJumpsuit = Jumpsuit.image
          DestViewController.imgShoes = Shoes.image
          DestViewController.dressingtype = 1
      } else if Jumpsuit.isHidden == false &amp;&amp; self.Hair.image == nil || self.Jumpsuit.image == nil || self.Shoes.image == nil {
          let alert = UIAlertView()
          alert.title = "No Image"
          alert.message = "Please check again"
          alert.addButton(withTitle: "OK")
          alert.show()
  
      }
  }
  </code></pre>
  
  <p>How can I stop jumping to next view controller and pop up the alert in first view controller. Please help!</p>