title: Reverse Range in Swift
body: <p>Is there a way to work with reverse ranges in Swift?</p>
  
  <p>For example:</p>
  
  <pre><code>for i in 5...1 {
    // do something
  }
  </code></pre>
  
  <p>is an infinite loop.</p>
  
  <p>In newer versions of Swift that code compiles, but at runtime gives the error: </p>
  
  <blockquote>
    <p>Fatal error: Can't form Range with upperBound &lt; lowerBound</p>
  </blockquote>
  
  <p>I know I can use <code>1..5</code> instead, calculate <code>j = 6 - i</code> and use <code>j</code> as my index. I was just wondering if there was anything more legible?</p>