title: What is the easiest way to generate random integers within a range in Swift?
body: <p>The method I've devised so far is this:</p>
  
  <pre><code>func randRange (lower : Int , upper : Int) -&gt; Int {
      let difference = upper - lower
      return Int(Float(rand())/Float(RAND_MAX) * Float(difference + 1)) + lower
  }
  </code></pre>
  
  <p>This generates random integers between lower and upper inclusive.</p>