title: How to check if imageView is not nil in swift?
body: <p>I have a fatal error while unwrapping an optional value in swift.</p>
  
  <p>I have a profile ViewController with a background image and an avatar image witch are the same.</p>
  
  <p>When the user has not an image set, i ve got this fatal error, instead i would like to add a "by default image Shape".</p>
  
  <p>How could i check if image isn't nil ?</p>
  
  <p>This is my code :</p>
  
  <pre><code> var currentUser = PFUser.currentUser()
  
      let User = currentUser as PFUser
      let  userImage:PFFile = User["profileImage"] as PFFile {
  
   userImage.getDataInBackgroundWithBlock{(imageData:NSData!, error:NSError!)-&gt; Void in
  
          if !(error != nil) {
  
              var image:UIImage! = UIImage(data: imageData)
  
              if image != 0 {
                  self.backgroundImageUser.image = image
                  self.avatarUserView.image = image
              }
              else if image == 0 {
                  self.backgroundImageUser.image = UIImage(named: "Shape")
                  self.avatarUserView.image = UIImage(named: "Shape")
              }
              }}}
  </code></pre>