title: How to access metaData of workout in healthkit using Swift
body: <p>I am able to get  basic data of activities like <code>duration</code>, <code>totalEnergyBurned</code> etc.
  But how can I access meta data like <code>HKWasUserEntered</code> <code>startDate</code> ?</p>
  
  <p>Here is my code so far </p>
  
  <pre><code>var predicate = HKQuery.predicateForWorkoutsWithWorkoutActivityType(HKWorkoutActivityType.Cycling)
   let sampleQuery = HKSampleQuery(sampleType: HKWorkoutType.workoutType(), predicate: predicate, limit: 0, sortDescriptors: [sortDescriptor])
      { (sampleQuery, results, error ) -&gt; Void in
  
          if let queryError = error {
              print( "There was an error while reading the samples: \(queryError.localizedDescription)")
          }
          else
          {
              print(results!)
            for samples: HKSample in results! {
                  var workout: HKWorkout = (samples as! HKWorkout)
                  print("workout Distance is \(workout.totalDistance)")
                  print("workout Energy Burned is \(workout.totalEnergyBurned)")
                  print("workout Duration in seconds is \(workout.duration)")
  
              }
          }
          completion(results,error)
      }
  
      executeQuery(sampleQuery)
  </code></pre>
  
  <p>When I print <code>results</code> I am getting this in return</p>
  
  <blockquote>
    <p>[ (46)  "Health" (9.3.2) metadata: {
        HKWasUserEntered = 1;
    } 2016-07-18 10:58:00 +0500 2016-07-18 11:58:00 +0500]</p>
  </blockquote>
  
  <p>so basically how can I fetch <code>HKWasUserEntered</code> and dates from this ?</p>