title: How to check nil string in if condition swift
body: <p>So when I press the button I check if both the UITextField and the UITextView have some value inside them, but if they are nil then perform this.</p>
  
  <p>So I tried this, but it didn't work:</p>
  
  <pre><code>@IBOutlet weak var defTextView = UITextView
  
  @IBAction func btnTapped(sender: UIButton) {
  
      if let definitionName = defTextView.text {
  
          print(definitionName)
  
      } else {
  
          print("nil")
  
      }
  }
  </code></pre>
  
  <p>Instead of receiving the word "nil" I got empty Strings bring printed</p>