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
Data Essentials in SwiftUI
Search
ry-itto
July 09, 2020
Programming
1
440
Data Essentials in SwiftUI
集まれSwift好き!Swift愛好会スピンオフ WWDC20セッション要約会 @オンライン
ry-itto
July 09, 2020
Tweet
Share
More Decks by ry-itto
See All by ry-itto
決定版!?OSSアプリプロジェクトでのBeta版アプリ配布の方法「Xcode Cloud + TestFlight」
ryitto
0
290
CA.swift#14
ryitto
3
5k
swift-argument-parserで 簡単 CLI ツール作り
ryitto
1
110
Composable Architecture
ryitto
0
710
CollectionViewの 新しいレイアウトの作り方
ryitto
0
47
Swift5.1 SwiftUI
ryitto
0
120
Other Decks in Programming
See All in Programming
CSC305 Lecture 26
javiergs
PRO
0
140
Security_for_introducing_eBPF
kentatada
0
110
Beyond ORM
77web
5
660
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
3
700
快速入門可觀測性
blueswen
0
350
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
760
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
470
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
Featured
See All Featured
How GitHub (no longer) Works
holman
311
140k
The Cost Of JavaScript in 2023
addyosmani
45
7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
The Language of Interfaces
destraynor
154
24k
The World Runs on Bad Software
bkeepers
PRO
65
11k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Code Reviewing Like a Champion
maltzj
520
39k
Making the Leap to Tech Lead
cromwellryan
133
9k
Rails Girls Zürich Keynote
gr2m
94
13k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Into the Great Unknown - MozCon
thekraken
33
1.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Transcript
3ZPZB*UP !SZJUUP %BUB&TTFOUJBMTJO4XJGU6* ू·Ε4XJGU͖ʂ4XJGUѪձεϐϯΦϑ88%$ηογϣϯཁձ!ΦϯϥΠϯ
ࣗݾհ ҏ౻྇ !SZJUUP ձେֶֶ෦ੜ Χϐόϥ͕͖
ηογϣϯͷ༰ w 4XJGU6*Ͱͷσʔλϑϩʔ w ΞϓϦͷσʔλϞσϧઃܭ w ࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ
ηογϣϯͷ༰ w 4XJGU6*Ͱͷσʔλϑϩʔ w ΞϓϦͷσʔλϞσϧઃܭ w ࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ
4XJGU6*Ͱͷσʔλϑϩʔ ϏϡʔΛ࡞Δ࣌ʹߟ͍͑ͨ̏ͭͷ࣭ w ࡞͢ΔϏϡʔͰඞཁͳσʔλԿ͔ʁ w ࡞͢ΔϏϡʔͰσʔλΛͲͷΑ͏ʹૢ࡞͢Δ͔ʁ w σʔλͲ͔͜ΒདྷΔʢ͞ΕΔʣͷ͔ʁ
4XJGU6*Ͱͷσʔλϑϩʔ ϏϡʔΛ࡞Δ࣌ʹߟ͍͑ͨ̏ͭͷ࣭ w ࡞͢ΔϏϡʔͰඞཁͳσʔλԿ͔ʁ CPPLͱ͍͏#PPLܕͷ QSPHSFTTͱ͍͏%PVCMFܕͷ ͦΕͧΕ͕͋ΕϏϡʔΛදࣔͰ͖ͦ͏ɻ w ࡞͢ΔϏϡʔͰσʔλΛͲͷΑ͏ʹૢ࡞͢Δ ͔ʁ
ಛʹͳͦ͞͏ w σʔλͲ͔͜ΒདྷΔʢ͞ΕΔʣͷ͔ʁ ͜ͷϏϡʔΛ͏ϏϡʔͰ͞ΕΔ͜ͱʹͳΓͦ͏ɻ struct BookCard : View { let book: Book let progress: Double var body: some View { HStack { Cover(book.coverName) VStack(alignment: .leading) { TitleText(book.title) AuthorText(book.author) } Spacer() RingProgressView(value: progress) } } }
4XJGU6*Ͱͷσʔλϑϩʔ ϏϡʔΛ࡞Δ࣌ʹߟ͍͑ͨ̏ͭͷ࣭ w ࡞͢ΔϏϡʔͰඞཁͳσʔλԿ͔ʁ CPPLͱ͍͏#PPLܕͷ QSPHSFTTͱ͍͏%PVCMFܕͷ ͦΕͧΕ͕͋ΕϏϡʔΛදࣔͰ͖ͦ͏ɻ w ࡞͢ΔϏϡʔͰσʔλΛͲͷΑ͏ʹૢ࡞͢ Δ͔ʁ
ಛʹͳͦ͞͏ w σʔλͲ͔͜ΒདྷΔʢ͞ΕΔʣͷ͔ʁ ͜ͷϏϡʔΛ͏ϏϡʔͰ͞ΕΔ͜ͱʹͳΓͦ͏ɻ struct BookCard : View { let book: Book let progress: Double var body: some View { HStack { Cover(book.coverName) VStack(alignment: .leading) { TitleText(book.title) AuthorText(book.author) } Spacer() RingProgressView(value: progress) } } } l4PVSDFPG5SVUIzͱ͍͏ݴ༿ͰηογϣϯͰѻΘΕΔ
4XJGU6*Ͱͷσʔλϑϩʔ ϏϡʔͰͷσʔλอ࣋ɺͦΕͧΕͲΜͳ࣌ʹ͏ʁ ϓϩύςΟϏϡʔʹΑͬͯมߋ͞Εͳ͍σʔλ !4UBUFϏϡʔʹΑͬͯอ࣋͞ΕΔҰ࣌తͳσʔλΛѻ͏ !#JOEJOHଞͷϏϡʔʹΑͬͯอ࣋͞Ε͍ͯΔσʔλΛมߋ͍ͨ͠߹
ηογϣϯͷ༰ w 4XJGU6*Ͱͷσʔλϑϩʔ w ΞϓϦͷσʔλϞσϧઃܭ w ࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ
ΞϓϦͷσʔλϞσϧઃܭ σʔλϞσϧఆٛ w 0CTFSWBCMF0CKFDUΛ͏ w !1VCMJTIFEΛ͏ w ̎ͭͷ࣭ ࡞͢ΔϏϡʔͰσʔλΛͲͷΑ͏ʹૢ࡞͢ Δ͔ʁ
ʹ͑Δͷ༰қ class CurrentlyReading: ObservableObject { let book: Book @Published var progress = ReadingProgress() @Published var isFinished = false var currentProgress: Double { isFinished ? 1.0 : progress.progress } }
ΞϓϦͷσʔλϞσϧઃܭ ϏϡʔͰ࡞ͬͨϞσϧΛ͏ w ଞͷ̎ͭͷ࣭ʹ͍ͭͯʁ w ࡞͢ΔϏϡʔͰඞཁͳσʔλԿ͔ʁ w ࡞͢ΔϏϡʔͰσʔλΛͲͷΑ͏ʹૢ࡞͢Δ͔ʁ w σʔλͲ͔͜ΒདྷΔʢ͞ΕΔʣͷ͔ʁ
ΞϓϦͷσʔλϞσϧઃܭ ϏϡʔͰ࡞ͬͨϞσϧΛ͏ w ѻ͏ͨΊͷ1SPQFSUZ8SBQQFS͕̏ͭ w !0CTFSWFE0CKFDU w !&OWJSPONFOU0CKFDU w !4UBUF0CKFDU
/FX
ΞϓϦͷσʔλϞσϧઃܭ ϏϡʔͰ࡞ͬͨϞσϧΛ͏ !0CTFSWFE0CKFDU σʔλͷґଘؔΛ࡞Δ !&OWJSPONFOU0CKFDU Ϗϡʔ֊ؒͷ0CTFSWBCMF0CKFDUͷѻ͍Λศརʹ͢Δ !4UBUF0CKFDU /FX 0CTFSWBCMF0CKFDUΛϏϡʔͷϥΠϑαΠΫϧʹ݁ͼ͚ͭΔ
ηογϣϯͷ༰ w 4XJGU6*Ͱͷσʔλϑϩʔ w ΞϓϦͷσʔλϞσϧઃܭ w ࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ
࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ w ࢠͷϏϡʔͰϞσϧΛϓϩύςΟͰ ͍࣋ͬͯͯɺͦ͜ͰॳظԽ͍ͯ͠Δ ߹ w 3FBEJOH-JTU7JFXFS͕ࡍϨϯμϦϯά͞ ΕΔͨͼʹϞσϧͷΠϯελϯε͕ੜ ͞Εͯ͠·͏
struct ReadingListViewer: View { var body: some View { NavigationView { ReadingList() Placeholder() } } } struct ReadingList: View { @ObservedObject var store = ReadingListStore() var body: some View { // ... } }
࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ ղܾࡦ w !4UBUF0CKFDUΛΘΓʹ͏͜ͱ Ͱղܾ͕Ͱ͖ΔʢΒ͍͠ʣ w !4UBUF0CKFDUΛ༻͢Δͱ4XJGU6*͕ దͳλΠϛϯάͰΠϯελϯεԽΛ͠ ͯ͘ΕΔͱͷ͜ͱ struct
ReadingListViewer: View { var body: some View { NavigationView { ReadingList() Placeholder() } } } struct ReadingList: View { @StateObject var store = ReadingListStore() var body: some View { // ... } }
࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ ୭͕σʔλΛ࣋ͭͷ͔ w ڞ௨ͷઌʹ࣋ͭ w !4UBUF0CKFDUΛͬͯͦͷϏϡʔ͕ࣗ࣋ͭ w ΞϓϦͷάϩʔόϧͳσʔλͱͯ࣋ͭ͠ w "QQΛܧঝͨ͠Ϗϡʔʹ!4UBUFͳͲΛར༻ͯ͠એݴͯ͋͛͠Δ
࣮ࡍʹΞϓϦʹऔΓೖΕΔࡍͷςΫχοΫ σʔλͷӬଓԽ w 4DFOF4UPSBHF w 4XJGU6*͕ཧ͍ͯ͠ΔϏϡʔͰ͔͑͠ͳ͍ w ߲ͷબঢ়ଶͳͲΛอଘ w "QQ4UPSBHF
w 6TFS%FGBVMUΛ༻ͨ͠άϩʔόϧετϨʔδ w ઃఆͳͲͷখ͞ͳσʔλΛอଘ
͓·͚ ৽͘͠Ճ͞ΕͨΠϕϯτιʔε w PO$IBOHF w PO0QFO63- w PO$POUJOVF6TFS"DUJWJUZ