title: Swift optional binding in while loop
body: <p>According to <a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/TheBasics.html#//apple_ref/doc/uid/TP40014097-CH5-ID309" rel="noreferrer">Swift documentation</a>:</p>
  
  <blockquote>
    <p><strong>Optional</strong> binding can be used with <strong>if</strong> and <strong>while</strong> <strong>statements</strong> to check for a value inside an optional, and to extract that value into a constant or variable, as part of a single action.</p>
  </blockquote>
  
  <p>The documentation only shows an example of optional-binding using if statement like:</p>
  
  <pre><code>if let constantName = someOptional {
      statements
  }
  </code></pre>
  
  <p>I'm looking for an example of <strong>optional-binding</strong> using while loop?</p>