title: Create an array of times with 15 minute interval (Swift)
body: <p>I'm new to programming and having a hard time coming up with an efficient way to create an array of times without typing out the entire array in swift.</p>
  
  <p>I would like to dynamically create an array of the form:</p>
  
  <pre><code>["5:00","5:30", (...), "22:00"]
  </code></pre>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>var timeSlots = [Double]()
  var firstTime: Double = 5
  var lastTime: Double = 22 // 10pm
  var slotIncrement = 0.5
  var numberOfSlots = Int((lastTime - firstTime) / slotIncrement)
  
  var i: Double = 0
  while timeSlots.count &lt;= numberOfSlots {
      timeSlots.append(firstTime + i*slotIncrement)
      i += 1
  }
  
  print(timeSlots) // [5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5, 15.0, 15.5, 16.0, 16.5, 17.0, 17.5, 18.0, 18.5, 19.0, 19.5, 20.0, 20.5, 21.0, 21.5, 22.0]
  </code></pre>
  
  <p>The time interval portion is important because I would like to be able to create an array with 15 minute times slots, 10 minute time slots, etc.</p>