title: iOS compatibility with Swift's String .isEmpty
body: <p>What compatibility issues, if any, are there with using <code>isEmpty</code> on a string in Swift?</p>
  
  <pre><code>let str = "Hello, planet"
  
  if !str.isEmpty {
      print(str)
  }
  </code></pre>
  
  <p>I'm developing with the latest Xcode+Swift versions, but I thought I once read (perhaps incorrectly) that <code>.isEmpty</code> will not work with older versions of iOS, and so <code>str == ""</code> should be used instead.</p>
  
  <p>Thanks!</p>
  
  <p><strong>References (whose overlap confuses me some):</strong></p>
  
  <ul>
  <li><a href="https://developer.apple.com/documentation/swift/string/2946268-isempty" rel="nofollow noreferrer">(String) "whether a string has no characters" ... From Protocol: Collection</a></li>
  <li><a href="https://developer.apple.com/documentation/swift/string/1539462-isempty" rel="nofollow noreferrer">(String) "whether the collection is empty"</a></li>
  <li><a href="https://developer.apple.com/documentation/swift/range/3018235-isempty" rel="nofollow noreferrer">(Range) "whether the collection is empty" ... SDK: Xcode 10+</a></li>
  </ul>