title: Getting only AutoDetected activities from healthkit
body: <p>I am using health-kit in my application to read user's steps and activities. Every this in okay But I want to read only auto detected activities and steps. Currently I get all the data weather it was manually entereed or auto detected by health application. This is my code so far</p>
  
  <pre><code>func todaySteps(completion: (Double, NSError?) -&gt; () )
  {   
      let type = HKSampleType.quantityTypeForIdentifier(HKQuantityTypeIdentifierStepCount) // The type of data we are requesting
  
      let date = NSDate()
      print(date)
      let cal = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)!
      let newDate = cal.startOfDayForDate(date)
      print(newDate)
      let predicate = HKQuery.predicateForSamplesWithStartDate(newDate, endDate: NSDate(), options: .None) // Our search predicate which will fetch all steps taken today
  
      let query = HKSampleQuery(sampleType: type!, predicate: predicate, limit: 0, sortDescriptors: nil) { query, results, error in
          var steps: Double = 0
  
          if results?.count &gt; 0
          {
              for result in results as! [HKQuantitySample]
              {
                  steps += result.quantity.doubleValueForUnit(HKUnit.countUnit())
              }
          }
  
          completion(steps, error)
      }
  
      executeQuery(query)
  }
  </code></pre>
  
  <p>But where and how can I check the data was user entered or auto detected? I have seen <a href="https://stackoverflow.com/questions/32147812/detect-if-healthkit-activity-has-been-entered-manually">This</a> Question as well but its in objective-c and I was not able to fully understand it so please Guide me on this.</p>