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
AlarmKitで明後日起きれるアラームアプリを作る
Search
Trickart
May 15, 2026
Programming
380
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AlarmKitで明後日起きれるアラームアプリを作る
potatotips #95
https://potatotips.connpass.com/event/389026/
Trickart
May 15, 2026
More Decks by Trickart
See All by Trickart
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
210
Xcode MCPでスクリーンショット撮りを90%自動化する
trickart
0
180
External Accessory入門
trickart
0
990
日本語でもいい感じに改行したい!! / Split Japanese sentence for UILabel and SwiftUI Text
trickart
3
4.3k
Other Decks in Programming
See All in Programming
AHC070解法紹介
eijirou
0
130
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
520
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.1k
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
660
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
260
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
200
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
16
15k
The Rails Doctrine Decade
koic
2
350
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
390
Workers Cache を知る
syumai
0
210
Heart of Swift Concurrency
koher
0
960
Are APIs Still Relevant in the AI Era?
soyuka
0
300
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
1.1k
Speed Design
sergeychernyshev
33
2.1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
430
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
The Spectacular Lies of Maps
axbom
PRO
1
1k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
440
YesSQL, Process and Tooling at Scale
rocio
174
15k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
570
Transcript
AlarmKitで 明後日起きれる アラームアプリを作る trickart 1
自己紹介 trickart / POSレジアプリ開発 どうしても明後日起きたくて作った アプリの話です 2
こんな経験ありませんか? 出張・旅行で 明後日の朝早く起きたい しかしiOS標準アラームで設定しようとすると… 基本24時間先までしか設定できない 明後日7:00に起きたいのに7:00と設定すると明日7:00になってしまう 「明日設定しよう」→忘れる 明後日を設定できるアラームアプリが欲しい 3
あさってアラーム DayAfterTomorrow 明後日のアラームが設定できるアプリ 開くと2日後の日付がもう選ばれている iOS 26+ / AlarmKit 製 4
AlarmKitとは? WWDC2025(Session 230)で発表されたフレームワーク(iOS 26+) サードパーティアプリからOS標準アラームと同等のアラームを鳴らせる サイレント・集中モード貫通 Apple Watch鳴動 5
明後日を指定する - .fixed モードによる日時指定 AlarmKitの Alarm.Schedule には3つのスケジュール方式がある .relative(repeats: .never) …
24時間以内・単発 .relative(repeats: .weekly([.monday])) … 毎週月曜 .fixed(Date) … 特定の日の特定時刻 ← あさってアラームはこれ // 明後日の日付 + 7:00 を組み立てる var components = Calendar.current.dateComponents( [.year, .month, .day], from: dayAfterTomorrow ) components.hour = 7 components.minute = 0 // Alarm.Schedule生成 let schedule: Alarm.Schedule = .fixed(Calendar.current.date(from: components)!) 6
Alarm Configurationにscheduleを渡して スケジュールする let configuration = AlarmManager.AlarmConfiguration( countdownDuration: .init(preAlert: nil,
postAlert: 5 * 60), // Snoozeの長さ schedule: schedule, // ← さっきの .fixed attributes: AlarmAttributes(presentation: .init(alert: alertContent), tintColor: .orange), stopIntent: StopAlarmIntent(alarmID: id.uuidString), // LiveActivityIntent secondaryIntent: SnoozeAlarmIntent(alarmID: id.uuidString) // LiveActivityIntent ) try await AlarmManager.shared.schedule(id: id, configuration: configuration) attributes タイトルや色を設定できる 7
これでよいかと思いきや…落とし穴 タイムゾーン問題 .fixed(Date) は UTC絶対時刻 として保存される 東京(UTC+9)で「4/12 7:00」設定 → UTC
4/11 22:00 ニューヨーク(UTC-4)に移動すると… → 現地 4/11 18:00 に鳴る APIの仕様としては自然だが、自分のユースケースとしてはちょっと困る → タイムゾーン変更を検知して 再スケジュール が必要 8
3層補正アーキテクチャ アプリ起動時・アプリが閉じられているとき・アプリ起動中の3つでカバーする 対策 手段 メリット・デメリット 1 起動時に lastKnownTimeZone と比較 権限不要・確実
開かないと直らない 2 BGAppRefreshTask で定期チェック 起動しなくても動く 実行保証なし 3 NSSystemTimeZoneDidChange を購読 即時反映 起動中限定 9
まとめ AlarmKitにはiOS標準のアラーム同等の機能がある サイレント貫通・Live Activity・Dynamic Island 24時間先まで・weeklyで鳴らせる 使いこなせばiOS標準のアラーム"以上"の事ができる 24時間以上先:Alarm.Suchedule.fixed(Date) で明後日でも確実に起きられる 3層TZ補正:起動時
/ BGAppRefresh / システム通知 を重ねる 10
Thank you! ref: AlarmKit – WWDC2025 Session 230 AlarmKit |
Apple Developer Documentation 11