Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
iPhoneで正しい1日の歩数を取得する方法
Search
yamada-ysys
April 12, 2019
Programming
390
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iPhoneで正しい1日の歩数を取得する方法
yamada-ysys
April 12, 2019
Other Decks in Programming
See All in Programming
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
110
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
430
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
170
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
990
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.7k
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
We Have a Design System, Now What?
morganepeng
55
8.4k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
The Curious Case for Waylosing
cassininazir
1
570
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Speed Design
sergeychernyshev
33
2.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Transcript
iPhoneͰਖ਼͍͠1ͷาΛ औಘ͢Δํ๏ Ysysɹࢁాɹහ
ਖ਼͍͠1ͷาͬͯʁ ❖ ࣮ࡍʹਓ͕ؒ1ʹԿาา͍͔ͨ ΞϓϦͰऔಘ͢Δͷ͍͠͠ɺਖ਼֬ʹΧϯτͰ͖͍ͯΔϢʔβ·͍ͣͳ͍ɻଞσόΠε Ͱऔಘͨ͠ͱͷൺֱͷ߹ɺΞϓϦ։ൃऀʹ͍߹ΘͤΔ͜ͱগͳ͍ ❖ ϔϧεέΞΞϓϦͷาදࣔ าʹؔ͢Δ͓͍߹Θͤ༰ΛݟͯΈΔͱϔϧεέΞΞϓϦͰදࣔ͞ΕΔา͕ਖ਼͍͠า ͱͯ͠ೝࣝ͞Ε͍ͯΔ
ผาҰཡ
าͲͷΑ͏ʹه͞Ε͍ͯΔ͔ ❖ ֤σόΠε͝ͱʹෆఆͳִ࣌ؒؒͰ ❖ าɺ։࢝࣌ؒɺऴྃ࣌ؒɺιʔ εɺه͕ͨ࣌ؒ͠ه͞ΕΔ
1ͷาͷऔಘ // ݕࡧର let type = HKSampleType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)! // ݕࡧ݅
let predicate = HKQuery.predicateForSamples(withStart: startDate, end: endDate, options: [.strictStartDate]) let query = HKStatisticsQuery(quantityType: type, quantitySamplePredicate: predicate, options: [.cumulativeSum, .separateBySource], completionHandler: { (query, result, error) in var steps = 0 if let doubleSteps = result?.sumQuantity()?.doubleValue(for: HKUnit.count()){ steps = Int(doubleSteps) } }) healthStore.execute(query)
❖ ମॏͷΑ͏ʹ͋Δ࣌ͷσʔλͰͳ͘ɺา࣌ؒͷ෯Λ࣋ͬͨσʔλ ❖ ։࢝࣌ؒ (or ऴྃ࣌ؒ) ͰσʔλΛݕࡧͯ͠߹ܭ͢Δ ❖ ʹͪΛލ͙ͱ͜ΖͰޡ͕ࠩൃੜ
ɾɾɾ TVN
iOS12ͷϦϦʔεޙʹൃੜ ❖ ϔϧεέΞʹه͞ΕΔִ͕ؒۃʹ͍߹͕ൃੜ ʢྫʣ4·ͱΊͯ5ສา ❖ ͳ͔ͥϔϧεέΞΞϓϦͰຖ̍ສาʴαͷਖ਼ͦ͠͏ͳΛදࣔ ❖ Ͳ͏࣌ؒͰ҈͢Δͱྑͦ͞͏
HKStatisticsCollectionQuery ❖ ࢦఆͨ͠ظؒΛࢦఆͨ࣌ؒ͠ͰεϥΠεͨ͠σʔλΛऔಘ ❖ Ұཡදࣔ͢Δͱ͖ʹϧʔϓΛճ͞ͳͯ͘ྑ͍ͷͰศར
ਖ਼͍͠1ͷาͷऔಘ // ݕࡧର let type = HKSampleType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)! // ݕࡧ݅
let predicate = HKQuery.predicateForSamples(withStart: startDate, end: endDate, options: []) let query = HKStatisticsCollectionQuery(quantityType: type, quantitySamplePredicate: predicate, options: [.cumulativeSum, .separateBySource], anchorDate: anchorDate, intervalComponents: intervalComponents) query.initialResultsHandler = { [unowned self] (query, result, error) in guard let result = result, error == nil else { return } for item in result.statistics() { print("\(item.startDate) - \(item.endDate) \(item.sumQuantity()!.doubleValue(for: HKUnit.count()))”) } } healthStore.execute(query)
·ͱΊ ❖ 1ͷาϔϧεέΞΞϓϦʹදࣔ͞Ε͍ͯΔ͕ਖ਼͍͠ͷͱҰൠతʹ ೝࣝ͞Ε͍ͯΔ ❖ 1ͷาΛ1͚ͩٻΊΔ߹ʹHKStatisticsCollectionQueryΛ͏ͷ ͕Α͍