Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
About HealthKit nutrition
Search
coe
November 14, 2023
Technology
0
340
About HealthKit nutrition
potatotips #85 iOS/Android開発Tips共有会
coe
November 14, 2023
Tweet
Share
More Decks by coe
See All by coe
すべてのヘルスケアデータを紐解く.pdf
coe
0
2k
Kotlin Dynamic type
coe
0
280
iOSDC 2023 Web in tvOS and watchOS
coe
1
530
iOSDC 2023 Push To Talk
coe
1
1.6k
iOSDC手で触れずにアプリを動かす技術
coe
1
1.4k
iOSDC令和時代のXML処理を考える
coe
3
2k
iOSDC 2021 Restore
coe
6
1.8k
詳解Storyboard
coe
7
3.4k
あなたの知らない連絡先の世界
coe
15
8k
Other Decks in Technology
See All in Technology
Overview of file type identifiers
ange
0
210
AWS re:Inventを徹底的に楽しむためのTips / Tips for thoroughly enjoying AWS re:Invent
yuj1osm
0
180
Apple/Google/Amazonの決済システムの違いを踏まえた定期購読課金システムの構築 / abema-billing-system
cyberagentdevelopers
PRO
1
190
Data Migration on Rails
ohbarye
7
4.5k
Java x Spring Boot Warm up
kazu_kichi_67
2
420
急成長中のWINTICKETにおける品質と開発スピードと向き合ったQA戦略と今後の展望 / winticket-autify
cyberagentdevelopers
PRO
1
120
なんで、私がAWS Heroに!? 〜社外の広い世界に一歩踏み出そう〜
minorun365
PRO
1
540
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
340
端末が簡単にリモートから操作されるデモを通じて ソフトウェアサプライチェーン攻撃対策の重要性を理解しよう
kitaji0306
0
150
新R25、乃木坂46 Mobileなどのファンビジネスを支えるマルチテナンシーなプラットフォームの全体像 / cam-multi-cloud
cyberagentdevelopers
PRO
1
110
【LT】ソフトウェア産業は進化しているのか? -Javaの想い出とともに- #jjug_ccc
takabow
0
150
APIテスト自動化の勘所
yokawasa
4
1.1k
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
519
39k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
664
120k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
9
670
RailsConf 2023
tenderlove
29
870
The Cost Of JavaScript in 2023
addyosmani
45
6.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
GraphQLとの向き合い方2022年版
quramy
43
13k
Transcript
ڧ ͪΌΜͱӫཆΛͱΖ͏ QPUBUPUJQTJ04"OESPJE։ൃ5JQTڞ༗ձ
ͪΌΜͱӫཆΛͱΖ͏
ͪΌΜͱӫཆΛઁΖ͏
ͪΌΜͱӫཆΛઁΖ͏
ͪΌΜͱӫཆΛऔΖ͏
ӫཆΛͱΔ )FBMUI,JU OVUSJUJPO
wJ04ΤϯδχΞ wͪΐͬͱ͚ͩ"OESPJE wגࣜձࣾ"NB[JB wौ୩۠ೆฏொ൪ ߸"1-"$&ौ୩ೆฏ ' ڧ
Ͱ
ͪΌΜͱӫཆΛͱΖ͏
ͪΌΜͱӫཆΛͱΖ͏ ʮࢲɺJ1BE͔ͩΒ )FBMUI,JUؔͳ͍Ͷʯ
IUUQTXXXBQQMFDPNKQJQBEPTJQBEPT
ӫཆͷऔΓํ
ӫཆͷऔΓํ ͪΌΜͱӫཆΛͱΖ͏
ӫཆͷऔΓํ ͪΌΜͱӫཆΛͱΖ͏ let store = HKHealthStore() // ͱΓ͍ͨӫཆૉΛܾΊΔ let dietaries:
Set<HKQuantityType> = [ .init(.dietaryEnergyConsumed), .init(.dietaryCarbohydrates), .init(.dietaryProtein), .init(.dietaryMolybdenum), ] // ݖݶΛͱΔ try await store.requestAuthorization(toShare: dietaries, read: dietaries) // อଘ͢Δ try await store.save(HKObject)
ӫཆͷऔΓํ ͪΌΜͱӫཆΛͱΖ͏ let store = HKHealthStore() // ͱΓ͍ͨӫཆૉΛܾΊΔ let dietaries:
Set<HKQuantityType> = [ .init(.dietaryEnergyConsumed), .init(.dietaryCarbohydrates), .init(.dietaryProtein), .init(.dietaryMolybdenum), ] // ݖݶΛͱΔ try await store.requestAuthorization(toShare: dietaries, read: dietaries) // อଘ͢Δ try await store.save(HKObject)
w )FBMUI,JUετΞʹอଘͰ͖ΔσʔλΛද͢DMBTT w ΠϯελϯεΛ࡞ΒͣαϒΫϥεΛར༻͢Δ w ),$BUFHPSZ4BNQMF w ),2VBOUJUZ4BNQMF w ),$PSSFMBUJPO
w ),8PSLPVU ),0CKFDU ͪΌΜͱӫཆΛͱΖ͏
),0CKFDU ͪΌΜͱӫཆΛͱΖ͏ let molybdenum = HKQuantitySample(type: .init(.dietaryMolybdenum), quantity: .init(unit: .gramUnit(with:
.micro), doubleValue: 85), start: .now, end: .now) try await store.save(molybdenum)
ͪΌΜͱӫཆΛͱΖ͏ ),0CKFDU
ͪΌΜͱӫཆΛͱΖ͏ ),0CKFDU Αʔ͠ɺϞϦϒσϯΛЖH ৯ͨͧʔ
ͪΌΜͱӫཆΛͱΖ͏ let correlation = HKCorrelation(type: .init(.food), start: .now, end: .now,
objects: .init(arrayLiteral: HKQuantitySample(type: .init(.dietaryMolybdenum), quantity: .init(unit: .gramUnit(with: .micro), doubleValue: 85), start: .now, end: .now), HKQuantitySample(type: .init(.dietaryEnergyConsumed), quantity: .init(unit: .largeCalorie(), doubleValue: 717), start: .now, end: .now), HKQuantitySample(type: .init(.dietaryCarbohydrates), quantity: .init(unit: .gram(), doubleValue: 112), start: .now, end: .now), HKQuantitySample(type: .init(.dietaryProtein), quantity: .init(unit: .gram(), doubleValue: 18), start: .now, end: .now)), metadata: [HKMetadataKeyFoodType: "ڇက"]) try await store.save(correlation) ),$PSSFMBUJPOͰؔ࿈͚
w )FBMUI,JUͷɺهͰ͖ΔҰͭͷܕͷྔΛද͢ w ֤छӫཆEJFUBSZ ӳޠͰදͤΒΕΔ w EJFUBSZ7JUBNJO"Ϗλϛϯ" w EJFUBSZ*SPOమ ӫཆͷ),2VBOUJUZ5ZQF*EFOUJ
fi FS ͪΌΜͱӫཆΛͱΖ͏
͔ΜͨΜʂ
ҙ͖͢ӫཆૉ
ͪΌΜͱӫཆΛͱΖ͏ ҙ͖͢ӫཆૉ
w φτϦϜ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w φτϦϜ w EJFUBSZ/BUSJVN ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w φτϦϜ w EJFUBSZ4PEJVN w φτϦϜιδϜ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ΧϦϜ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ΧϦϜ w EJFUBSZ1PUBTTJVN w ΧϦϜϙλγϜ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w Ϗλϛϯ#⒪ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w Ϗλϛϯ#⒪ w EJFUBSZ3JCP fl BWJO w Ϗλϛϯ#⒪ϦϘϑϥϏϯ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w Ϧϯ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
None
w Ϧϯ w EJFUBSZ3JO ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
None
w Ϧϯ ྜྷ w EJFUBSZ1IPTQIPSVT ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ਫ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ਫ w EJFUBSZ8BUFS ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ਫ w EJFUBSZ8BUFS w ొ͢Δͱ͖ɺମੵͰొ͠ͳ͍ͱΫϥογϡ͢Δ w ࠓ·Ͱͷӫཆૉ࣭ྔͰొ͢Δ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ࢷ࣭ w ̏େӫཆૉͷҰͭ w ຊͰදࣔٛ͋Γ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
None
w ࢷ࣭ w ̏େӫཆૉͷҰͭ w ຊͰදࣔٛ͋Γ w )FBMUI,JUʹࢷ࣭ͱ͍͏߲ͳ͠ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ࢷ࣭ w ̏େӫཆૉͷҰͭ w ຊͰදࣔٛ͋Γ w )FBMUI,JUʹࢿ࣭ͱ͍͏߲߲ͳ͠ w EJFUBSZ'BU5PUBM
૯ࢷ ͱͯ͠ొ͢Δ w ૯ࢷ৯ʹؚ·ΕΔࢷ࣭ͷ૯ྔΛද͍ͯ͠Δ w ࢷ࣭ͷ༁ʹ֤छࢷࢎؚ͕·ΕΔ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ৯Ԙ૬ྔ w ຊͰදࣔٛ͋Γ w )FBMUI,JUʹ߲ͳ͠ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w ৯Ԙ૬ྔ w ຊͰදࣔٛ͋Γ w )FBMUI,JUʹ߲ͳ͠ w φτϦϜ EJFUBSZ4PEJVN ͔Βࢉग़Մೳ
w EJFUBSZ4PEJVN NH ৯Ԙ૬ྔ ҙ͖͢ӫཆૉ ͪΌΜͱӫཆΛͱΖ͏
w J1BE04͔ΒϔϧεέΞؚ͕·ΕΔΑ͏ʹͳͬͨ w φτϦϜιδϜ w ΧϦϜϙλγϜ w Ϗλϛϯ#⒪ϦϘϑϥϏϯ w ࢷ࣭૯ࢷ
w φτϦϜ NH ৯Ԙ૬ྔ ·ͱΊ ͪΌΜͱӫཆΛͱΖ͏
w ফඅऀி w ӫཆදࣔʹ͍ͭͯ w IUUQTXXXDBBHPKQQPMJDJFTQPMJDZGPPE@MBCFMJOHOVUSJFOU@EFDMFBSBUJPO w ӫཆදࣔΛͬͯɺ͋ͳͨ৯ԘઁऔྔΛݮΒͤΔ w IUUQTXXXDBBHPKQQPMJDJFTQPMJDZGPPE@MBCFMJOHIFBMUI@QSPNPUJPOQEG
GPPE@MBCFMJOH@DNT@@QEG w ֳϗʔϜϖʔδ w ӫཆදࣔݕ౼ձใࠂॻ w IUUQTXXXDBPHPKQDPOTVNFSIJTUPSZLBCVTPTIJLJPUIFSNFFUJOH EPD@TBOLPVQEG ࢀߟαΠτ ͪΌΜͱӫཆΛͱΖ͏