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
ヘッドジェスチャを検知して Vibe Cooking - iOSDC Japan 2025
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kanta Oikawa
September 20, 2025
660
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ヘッドジェスチャを検知して Vibe Cooking - iOSDC Japan 2025
Kanta Oikawa
September 20, 2025
More Decks by Kanta Oikawa
See All by Kanta Oikawa
2027年のMetricKit
kantacky
0
57
はじめてのCoreSpotlight
kantacky
0
120
もう怖くないバックグラウンド処理 Background Tasks のすべて - Hakodate.swift #1
kantacky
0
450
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
67k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.8k
Facilitating Awesome Meetings
lara
57
7.1k
Abbi's Birthday
coloredviolet
3
9.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
250
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Side Projects
sachag
455
43k
KATA
mclloyd
PRO
35
15k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Transcript
Kanta Oikawa - 2025/09/20 ϔουδΣενϟΛݕͯ͠ Vibe Cooking iOSDC Japan 2025
Day 1 Track A 1
͓͍͍͠ྉཧΛָʹ࡞ͬͯ৯͍ͨ 1ਓΒ͠ͷྉཧॳ৺ऀ • ޮతʹ͡Ό͕ɾਬ͖ࠐΈ͝ΜɾಲोΛ࡞Γ͍ͨ • γϯάϧεϨουͰ • ϨγϐΛݟͳ͕Β࡞Γ͍ͨ • ྉཧதʹiPhoneɾiPadΛ৮Γͨ͘ͳ͍
2
Vibe Cooking • ෳͷϨγϐ͔Β1ͭͷϨγϐΛੜ • ϨγϐͷखॱΛಡΈ্͛ • ಡΈ্͛ΔखॱΛԻͰίϯτϩʔϧ 3
Vibe Cooking x ϔουδΣενϟ • ԻಡΈ্͛ɾίϯτϩʔϧͰڥͷӨڹΛड͚͍͢ • ྉཧத AirPods Λண
• Core Motion Λͬͯ AirPods ͷϞʔγϣϯσʔλΛऔಘՄೳ • ਐΉɾΔૢ࡞ΛϔουδΣενϟͰ 4
AirPods ͰϔουδΣενϟΛݕ͢Δྫ (2024/09) ϔουδΣενϟΛ༻ͯ͠ Siri ʹԠ͢Δ • AirPods Pro 2·ͨAirPods
4ʢ྆ϞσϧʣΛ͓࣋ͪͰɺʮԻͰண৴Λ ΒͤΔʯͱʮ௨ͷಡΈ্͛ʯΛΦϯʹ͍ͯ͠Δ߹ɺ·ͨखΛΘ ͣʹɺϔουδΣενϟΛ༻ͯ͠ɺ௨Λड͚ͨΓڋ൱ͨ͠Γɺ௨Λ։͍ ͨΓดͨ͡Γ͢Δ͜ͱͰ͖·͢ɻ • ϔουδΣενϟΛ༻ͯ͠SiriʹԠ͢Δ • ిʹग़Δɺ·ͨ௨ͱϝοηʔδʹฦ৴͢Δ: ᰐ͖·͢ɻ • ిΛڋ൱͢Δɺ·ͨ௨ͱϝοηʔδΛด͡Δ: टΛࠨӈʹৼΓ·͢ɻ 5 AirPodsͰίϯτϩʔϧͱδΣενϟΛ༻͢Δ - Apple αϙʔτʢຊʣ https://support.apple.com/ja-jp/guide/airpods/devb2c431317 (Accessed on 2025/09/12)
UX ઃܭ 6 30° ͪ͜ΒΛ͍ͯ͏ͳͣ͘ͱ ӈʹεϫΠϓ ͪ͜ΒΛ͍ͯ͏ͳͣ͘ͱ ࠨʹεϫΠϓ
͍͍ͯΔํΛݕ͢Δ final class HeadphoneMotionRepository: NSObject, CMHeadphoneMotionManagerDelegate, Sendable { private let
manager: CMHeadphoneMotionManager override init() { ... } func startTracking(queue: OperationQueue? = .current) throws -> AsyncStream<CMDeviceMotion> { guard manager.isDeviceMotionAvailable else { throw HeadphoneMotionRepositoryError.deviceMotionNotAvailable } return AsyncStream { continuation in manager.startDeviceMotionUpdates(to: queue ?? .main) { motion, error in guard let motion else { return } continuation.yield(motion) } } } ... } 7
͍͍ͯΔํΛݕ͢Δ for await motion in try motionService.startTracking() { state.motion =
motion } ... if abs(state.motion?.attitude.yaw ?? 0) > .pi / 12 { // π / 12 = 15° ... } 8 yaw | Apple Developer Documentation https://developer.apple.com/documentation/coremotion/cmattitude/yaw (Accessed on 2025/09/20)
͏ͳ͖ͣδΣενϟΛݕ͢Δ 1. ͏ͳ͖ͣδΣενϟͷϞʔγϣϯσʔλΛऩू͢Δ 2. ϞʔγϣϯσʔλΛֶशͯ͠ Core ML ϞσϧΛ࡞͢Δ 3. ϞσϧΛͬͯ͏ͳ͖ͣδΣενϟΛݕ͢Δ
9
͏ͳ͖ͣδΣενϟΛݕ͢Δ 1. ͏ͳ͖ͣδΣενϟͷϞʔγϣϯσʔλΛऩू͢Δ • ͏ͳͣ͘δΣενϟ ͱ ͦΕҎ֎ͷδΣενϟ ͷ 2 Ϋϥε
• CMDeviceMotion ʹؚ·ΕΔΛ CSV ϑΝΠϧʹॻ͖ࠐΈ • attitude_roll, attitude_pitch, attitude_yaw, gravity_x, gravity_y, gravity_z, quaternion_x, quaternion_y, quaternion_z, quaternion_w, rotation_rate_x, rotation_rate_y, rotation_rate_z, user_acceleration_x, user_acceleration_y, user_acceleration_z • ͻͨ͢Β͏ͳͣ͘ 10
͏ͳ͖ͣδΣενϟΛݕ͢Δ 1. ͏ͳ͖ͣδΣενϟͷϞʔγϣϯσʔλΛऩू͢Δ 11
͏ͳ͖ͣδΣενϟΛݕ͢Δ 2. ϞʔγϣϯσʔλΛֶशͯ͠ Core ML ϞσϧΛ࡞͢Δ 12
͏ͳ͖ͣδΣενϟΛݕ͢Δ 3. ϞσϧΛͬͯ͏ͳ͖ͣδΣενϟΛݕ͢Δ let configuration = MLModelConfiguration() let model =
try HeadGestureClassifier(configuration: configuration) let input = HeadGestureClassifierInput( rotation_rate_x: try MLMultiArray(motions.map { $0.rotationRate.x }), stateIn: try MLMultiArray(shape: [400], dataType: .double) ) let output = try model.prediction(input: input) return Gesture(rawValue: output.label) ?? .idle ... enum Gesture: String { case idle case nod ... } 13
σϞ 14
ͬͯΈͨײɾߟ • टΛಈ͔͢ͷ͕ͭΒ͍ • খ͞ͳಈ͖ͰݕͰ͖Δײ • ޡݕ͠ͳ͍ਫ਼ • ϑΟʔυόοΫ͕΄͍͠ •
Siri ͷԠ࣌ʹ "Χνο"ͱ͍͏ԻʢʁʣͷϑΟʔυόοΫ 15
࣮ͯ͠Έͨײ • Core Motion ͱ Core ML ΛΈ߹ΘͤͯδΣενϟݕ͕؆୯ʹ࣮Ͱ͖ͨ • ML
ʹؔ͢Δߴͳ͕ࣝͳͯ͘؆୯ʹϞσϧΛ࡞Δ͜ͱ͕Ͱ͖Δ • ͕ࣝ͋Εਫ਼্͕͕Γͦ͏ • CMDeviceMotionͷͦΕͧΕͷ͕ҙຯ͢Δ͜ͱΛཧղ͢Δ͜ͱ͕ॏཁ 16
Vibe Cooking Coming this fall 17
Kanta Oikawa Kantacky • ެཱͩͯ͜ະདྷେֶ M1 • ઈࢍब׆தʂʂ • GitHub:
@kantacky • Twitter: @kanta_cky 18