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
20201009 iOS 14 ウィジェットをつくってみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kei Ito
October 09, 2020
Programming
2.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20201009 iOS 14 ウィジェットをつくってみた
Kei Ito
October 09, 2020
More Decks by Kei Ito
See All by Kei Ito
20211015 Mac CatalystでmacOS用アプリを作る
itok
2
4.5k
20210219 Flutterに入門してみた
itok
1
4.1k
20191206 Property Wrappers 入門
itok
0
1.7k
20190920 iOS 13 対応ではまった話
itok
1
2.5k
20190726 Background App Refresh Taskがやってきた
itok
0
2.4k
20190722 Firebase Remote Configでアドネットワークを管理する
itok
0
1.7k
20190419 iOSアプリで証明書の情報を参照する
itok
0
1.6k
20190412 Android TV向けアプリを作ってみる
itok
0
1.1k
20190215 iOS/Androidでドキュメントスキャナーを作ってみた
itok
0
1.9k
Other Decks in Programming
See All in Programming
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
260
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
210
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
280
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
自分的「カンファレンスの楽しみ方」
syumai
0
200
typoなんかねぇよ
raspython3
0
680
ソフトウェアラスタライザ
fadis
1
800
新卒PdEのリアル
ryu1013
1
480
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
320
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
770
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
5.7k
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
520
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
440
Designing for Timeless Needs
cassininazir
1
470
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Ethics towards AI in product and experience design
skipperchong
2
370
Heart Work Chapter 1 - Part 1
lfama
PRO
9
36k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
500
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
820
Deep Space Network (abreviated)
tonyrice
0
300
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
410
The Spectacular Lies of Maps
axbom
PRO
1
990
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Transcript
J04ΟδΣοτΛ ͭͬͯ͘Έͨ .PCJMF"DU0/-*/& JUPL!ͦΒ͔ͥ
JUPL!ͦΒ͔ͥ w ͍ͱ͏͚͍ʢJUPLʣ w ɹɹɹɹɹɹͷதͷਓ w ϞόΠϧΞϓϦΤϯδχΞ݉$&0 w ෭ۀͰϑϦʔϥϯεత w
IUUQTJUPLKQ IUUQTTPSBLB[FDPKQ !JUPLKQ
ॴࡏɿژࢢதژ۠ ࣾһਓࣗ
࣮ डୗ ࣗࣾ
J04"OESPJENBD048JOEPXTαʔό ҰਓͰͬͯ·͢ʢσβΠϯҎ֎ʣ
iOS൛ v10.0.0
None
J04 ΟδΣοτΛ ͭͬͯ͘Έͨ
·ͣҙࣄ߲
4XJGU6*ඞਢ
6*,JU͑·ͤΜ
6*7JFX3FQSFTFOUBCMFΛ ͏ͱ͜͏ͳΔ
ࢀߟ w 88%$ w 8JEHFU,JUʹ͍ͭͯ w 8JEHFU$PEF"MPOHʙ
ΟδΣοτͷछྨ
TNBMM NFEJVN MBSHF ֎ݟ ૢ࡞ શମλοϓͷΈ શମ ҙͷྖҬλοϓ
ૢ࡞ w શମλοϓ w ҙͷྖҬλοϓ { }.widgetURL(url) Link(destination: url) {
}
جຊߏ 8JEHFU 8JEHFU$POpHVSBUJPO 5JNFMJOF1SPWJEFS 7JFX 5JNFMJOF&OUSZ
جຊߏ struct MyWidget: Widget { public var body: some WidgetConfiguration
{ StaticConfiguration(kind: kind, provider: MyProvider()) { entry in MyWidgetEntryView(entry: entry) } } } struct MyProvider: TimelineProvider { func getTimeline(in context: Context, completion: @escaping (Timeline<MyEntry>) -> Void) { ... completion(Timeline(entries: entries, policy: .atEnd)) } } struct MyWidgetEntryView : View { var entry: MyEntry var body: some View { ... } }
ઃఆʢTUBUJDʣ͋Γ 8JEHFU 8JEHFU$POpHVSBUJPO *OUFOU 7JFX 5JNFMJOF&OUSZ 5JNFMJOF1SPWJEFS
ઃఆʢEZOBNJDʣ͋Γ 8JEHFU 8JEHFU$POpHVSBUJPO *OUFOU 7JFX 5JNFMJOF&OUSZ 5JNFMJOF1SPWJEFS *OUFOU&YUFOTJPO
ઃఆ͋Γ struct MyWidget: Widget { public var body: some WidgetConfiguration
{ IntentConfiguration(kind: kind, intent: MySelectionIntent.self, provider: MyIntentProvider()) { entry in MyWidgetEntryView(entry: entry) } } } struct MyIntentProvider: IntentTimelineProvider { func getTimeline(for configuration: MySelectionIntent, in context: Context, completion: @escaping (Timeline<MyEntry>) -> Void) { ... completion(Timeline(entries: entries, policy: .after(date))) } }
IntentHandler.swift class IntentHandler: INExtension, MySelectionIntentHandling { func provideParameterOptionsCollection( for intent:
MySelectionIntent, with completion: @escaping (INObjectCollection<MyType>?, Error?) -> Void) { completion(INObjectCollection(items: items), nil) } *OUFOU&YUFOTJPO .Z4FMFDUJPOJOUFOUEFpOJUJPO
ߋ৽ public struct TimelineReloadPolicy : Equatable { // entries͕શ෦ऴΘͬͨΒߋ৽ public
static let atEnd: TimelineReloadPolicy // ߋ৽͠ͳ͍ public static let never: TimelineReloadPolicy // ࢦఆ࣌ؒʹߋ৽ public static func after(_ date: Date) -> TimelineReloadPolicy } // ΞϓϦଆ͔Βߋ৽Λଅ͢͜ͱ WidgetCenter.shared.reloadAllTimelines() ࣮ࡍͷߋ৽λΠϛϯά ࠷ऴతʹ04͕͍͍ײ͡ʹௐ͢ΔͷͰҙ
ෳΟδΣοτ 8JEHFU#VOEMF 8JEHFUᶄ 8JEHFUᶃ *OUFOU&YUFOTJPO @main struct Bundle: WidgetBundle {
@WidgetBundleBuilder var body: some Widget { Widget1() Widget2() } }
͍͞͝ʹ w ΟδΣοτରԠ͍ͯ͜͠͏ʂ w ͰΞϓϦຊମͷ༠ಋେࣄʁʢϏδωεతʹʣ w ΄ͲΑ͍ใͷόϥϯε۩߹ΛݟۃΊͯ