<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tokizuoh</author_name>
  <author_url>https://blog.hatena.ne.jp/tokizuoh/</author_url>
  <blog_title>カルボナーラ街道</blog_title>
  <blog_url>https://tokizuoh.hatenablog.com/</blog_url>
  <categories>
    <anon>Swift</anon>
    <anon>iOS</anon>
  </categories>
  <description>結論 HealthKit経由で取得したワークアウト（HKWorkout） から時速を取得するには、 totalDistance(HKQuantity) と duration(TimeInterval) を使って算出する必要がある。 let distance = workout.totalDistance!.kilometers() let averageSpeed = distance / ((Double)(Int(timeInterval)) / 3600) extension HKQuantity { func kilometers() -&gt; Double { return self.d…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftokizuoh.hatenablog.com%2Fentry%2F2022%2F05%2F18%2F004705&quot; title=&quot;HealthKitでcyclingの時速は直接取得できないぞ！ - カルボナーラ街道&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-05-18 00:47:05</published>
  <title>HealthKitでcyclingの時速は直接取得できないぞ！</title>
  <type>rich</type>
  <url>https://tokizuoh.hatenablog.com/entry/2022/05/18/004705</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
