title: How to group HKStatistics by hour?
body: <p>I'm trying to extract step data from HealthKit.</p>
  
  <p>I want to create a summary of step data grouped by hour. Currently, I can extract all of the samples of data between a date range provided by <code>NSPredicate</code> with <code>HKSampleQuery</code>. I could also get a sum of the step count between a date range with <code>HKStatisticsQuery</code>.</p>
  
  <p>What I am asking is if there is a way to sum group the samples or statistics by hour. In SQL I would write something like this:</p>
  
  <p><code>SELECT HOUR(date), SUM(steps) FROM healthkit WHERE date BETWEEN 'blah' AND 'blah' GROUP BY 1;</code></p>
  
  <p>Am I seriously going to have to query HKStatistics 24 x 31 times to write the last month of step data grouped by hour? Because that seems rather inefficient, especially with how the <code>resultsHandler</code> is implemented.</p>