title: iOS Swift4 how to check if string is not nil and not empty?
body: <p><strong>How do I check if an optional string object is neither empty string "" nor nil in Swift4?</strong> I end up having to write weird checks like these, because </p>
  
  <pre><code> //object has instance variable     
   var title: String?
  
   //invalid comparison - cannot compare optional and non optional
   if object.title?.count &gt; 0
   {
  
   }
  
   //valid but ugly
   if object.titleString == nil {
        //has nil title
   }
   if let title = object.title
   {
      if title.count == 0
      {
          //has a "" string
      }
   }
  </code></pre>