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
iOS Apple Dev Tutorialsとpointfreeのモダン実装を比較する
Search
ああうえ
July 20, 2023
Programming
590
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iOS Apple Dev Tutorialsとpointfreeのモダン実装を比較する
ああうえ
July 20, 2023
More Decks by ああうえ
See All by ああうえ
メモリ不足との戦い〜大量データを扱うアプリでの実践例〜
kwzr
1
2.4k
エンジニアとデザイナーがわかる iPadの画面サイズ対応入門
kwzr
0
210
react-reconcilerでオレオレReact Nativeを作ろう!
kwzr
1
3.3k
iOS・Androidで使える デザインシステムをどう実装するか
kwzr
3
5.9k
Apple Pencilと左利き対応
kwzr
5
2.7k
BitriseでUIの差分検出
kwzr
0
1.6k
CIをGASで継続的に改善したら幸せになった
kwzr
3
2k
Other Decks in Programming
See All in Programming
気持ちぃ〜角丸 Squircle
ryu1013
0
330
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
8.7k
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.2k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.8k
Simple Storage Service(S3) is not simple
iwatsukayura
0
320
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.5k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.1k
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
830
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1.2k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
270
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
200
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
560
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Thoughts on Productivity
jonyablonski
76
5.4k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
BBQ
matthewcrist
90
10k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
580
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
Transcript
͋͋͏͑(@_kwzr_) iOS Apple Dev Tutorialsͱ pointfreeͷϞμϯ࣮Λൺֱ͢Δ
ࣗݾհ • ͋͋͏͑(@_kwzr_) • ॴଐ: ৽نࣄۀ෦ɾCTOࣨσβΠϯγεςϜ෦ • ࣄ: ଟiOSΤϯδχΞ •
झຯ: εϓϥɾ͓ֆ͔͖
iOS։ൃΛֶͿʹ...
AppleͷνϡʔτϦΞϧͬͱ͍ͯʂ
AppleͷνϡʔτϦΞϧΛ ͍ͬͯͩ͘͞
iOS Apple Dev Tutorials • SwiftUIͱUIKitͷνϡʔτϦΞϧ͕͋Δ • εςοϓ͝ͱʹஸೡͳઆ໌ • ϖʔδͷ࠷ޙʹ͕͋Γɺཧղ
ΛνΣοΫͰ͖Δ https://developer.apple.com/tutorials/app-dev-training
Scrumdinger(Standups) • SwiftUI൛Ͱ࣮͞Ε͍ͯΔΞϓϦ • λΠϚʔΛઃఆͰ͖ͨΓɺձٞͷ༰ΛԻ ͨ͠ΓɺࢀՃऀΛهͰ͖ΔΞϓϦ
νϡʔτϦΞϧͰֶͿ͜ͱ • ϨΠΞτ(VStack, HStack...) • ΞΫηγϏϦςΟରԠํ๏ • ϞσϧΛ࡞ͬͯListʹө • ը໘ભҠ(NavigationStack)
• ঢ়ଶཧ(@State, @Binding, ObservableObject, ...) • ϥΠϑαΠΫϧ(onAppear, onDisappear)
νϡʔτϦΞϧͰֶͿ͜ͱ • Swift Concurrency • File ManagerΛͬͨӬଓԽ • গ͠ൃలతͳඳը(PathͳͲ) •
Τϥʔը໘ͷදࣔ • OSͷAPIݺͼग़͠(Speech frameworkݖݶͷڐՄ) • ͳͲ
(͏͜Εࣄ͡ΌΜ)
iOSΞϓϦ։ൃΛֶͼ͍ͨਓʹ ͱ͓ͯ͢͢Ίʂʂ
νϡʔτϦΞϧͬͨɺ͜ͷઌͲ͏͢Ε... • UIKitͱֶ͔ͼ͍ͨ → UIKitνϡʔτϦΞϧɺpixivͷνϡʔτϦΞϧ • ΞʔΩςΫνϟͱ͔ςετͱ͔ • യવͱɺΑΓྑ͍ίʔυΛॻ͖͍ͨͱ͔
pointfreeͷϞμϯ࣮ͱൺΔ
pointfreeco/standups • TCAΛ࡞͍ͬͯΔpointfree͕࡞͍ͬͯΔ • ScrumdingerΛΑΓϞμϯʹॻ͍ͯΈͨϓϩδΣΫτ
Ϟμϯ #ͱ
ϓϩδΣΫτߏΛൺֱ͢Δ
None
None
None
φϏήʔγϣϯपΓͷൺֱ
ϓϩδΣΫτߏΛݟΔ • 2ͭͷϓϩδΣΫτ͕͋ͬͨ • StackBased • TreeBased
None
StackBased vs TreeBased • StackBased • AppViewͰNavigationStack(path:)ΛݟͯɺϧʔςΟϯά • TreeBased •
֤View͔ΒnavigationDestinationΛ֤ͬͯը໘ʹભҠ͍ͯ͠Δ • ͦΕͧΕϝϦσϝ͋Γɺ͜Ε͕શਖ਼ղͱ͍͏ͷݱঢ়ͳ͍
ঢ়ଶϕʔεͷφϏήʔγϣϯʹ͍ͯ͠Δ • pointfreeco/swiftui-navigation • SwiftUIͷը໘ભҠͷΛղܾ͍ͯ͠ΔϥΠϒϥϦ • NavigationLinkTabViewঢ়ଶͱը໘ભҠ͕ඥ͔ͮͳ͍ • ྻڍܕΛͬͯը໘ભҠͰ͖ΔΑ͏ʹ͍ͯ͠Δ •
DeepLinkͳͲΛ͘͢͠ͳΔ
None
None
ςετͷൺֱ
ςετίʔυ͕ॻ͔Ε͍ͯΔ • AppleͷνϡʔτϦΞϧʹςετॻ͔Ε͍ͯͳ͍͕ɺpointfreeͷํ ςετ͕ॻ͔Ε͍ͯΔ • ViewModelతͳͭͷϢχοτςετ • ςετΛॻ͚ΔΑ͏ʹ͍ͯ͠Δ(େࣄ)
ViewͷϩδοΫɾঢ়ଶʹؔ͢Δςετ͕ॻ͚Δ • جຊతʹViewͷϢχοτςετΛॻ͘ͷ͍͠ • ϥΠϒϥϦΛ͏ͳͲ͢ΕͰ͖Δ͕... • https://github.com/nalexn/ViewInspector • Ұൠతͳํ: ViewModelతͳͷΛ࡞ΓɺϩδοΫͱঢ়ଶʹؔ͢Δς
ετΛॻ͘
Apple νϡʔτϦΞϧͰςετΛॻ͍ͯΈΔ • MeetingViewͰΘΕ͍ͯΔScrumTimerΫϥελΠϚʔ + ݱࡏͷൃ දऀͷঢ়ଶΛ࣋ͭModel • ͍ɺViewʹঢ়ଶ͕ͬͨΓॻ͔Ε͍ͯΔײ͡Ͱͳ͔ͬͨͷͰɺλΠ Ϛʔ+ঢ়ଶͷςετΛॻ͚ͨ
None
pointfreeͷtimerͷςετ • DateͷΘΓʹclockΛ͍ɺςετίʔυͰ࣌ؒΛਐΊΒΕΔΑ͏ʹ ͍ͯ͠Δ
None
None
None
Dependency InjectionΛ͍ͯ͠Δ • pointfreeco/swift-dependencies
swift-dependencies͕ͳ͍ͱ͖ • ී௨ʹΔͱςετ༻ͷϞοΫΛࠩ͠ࠐΜͩΓ͢ΔͨΊʹɺί ϯετϥΫλͳͲͰΠϯελϯεΛͨ͠Γ͢Δඞཁ • ໘ɻόέπϦϨʔ͠ͳ͖Ό͍͚ͳ͍࣌ͬͱ໘
ͷఏڙ • SpeechClientͷΠϯελϯεΛఏڙ ͍ͨ͠߹ӈͷΑ͏ʹॻ͘ • ςετ༻ɺϓϨϏϡʔ༻ͷΛఏڙ Մೳ
• @Dependency(\.speechClient)ͰSpeechClientͷΠϯελϯεΛऔͬͯ དྷͯ͘ΕΔΑ͏ʹ • Property WrapperͰ͑ͯศར • ClockUUIDͳͲɺΑ͘͏ͷΛඪ४Ͱఏڙ swift-dependencies͕͋Δͱ͖
ͦͷଞ
SpeechRecognizer • ݩʑͷSpeechRecognizer • Իೝࣝ݁ՌΛड͚औΔ + ݁ՌΛอ࣋͢Δ AppleͷνϡʔτϦΞϧ
pointfree൛ SpeechClient • AsyncThrowingStreamͰྲྀ͚ͩ͢ʹ͍ͯ͠Δ
ࡉ͔͍ॻ͖ํͳͲ • ViewଆͰ͏༻ʹInt, Doubleͷ ϓϩύςΟΛ࡞͍ͬͯΔ • গࠞ͠ཚͦ͠͏ AppleͷνϡʔτϦΞϧ
Durationܕͷ༻ • Durationܕ(iOS 16+)ʹஔ͖Θ͓ͬͯΓɺformatͳͲViewଆͰߦͬͯ ͍Δ pointfreeͷ࣮
• iOS 16͔Β͑Δγϯϓϧͳͷʹ DocumentDirectoryͷऔಘํ๏
Previewͷઆ໌จ • ϓϨϏϡʔͷઆ໌จΛදࣔ͢ΔViewΛࠩ͠ࠐΜͰ͍Δ
None
࿔ΒΕ͍ͯͳ͔ͬͨॴ • SwiftUIͷViewಛʹมߋͯ͠ͳͦ͞͏ • ݩ͔Β͔ͳΓ៉ྷʹ࡞ΒΕ͍ͯΔͱࢥͬͨ
͕࣌ؒͳͯͤ͘ͳ͔ͬͨͱ͜Ζ • Identi fi edArrayͷ • pointfreeతʹਪ͠ϙΠϯτͬΆ͍ • ύϑΥʔϚϯε͕ߴ͍ListΛॻ͖͘͢ •
Ϟνϕʔγϣϯͷจ຺Λ͚ͩ͢Ͱֻ͕͔࣌ؒͬͯ͠·͏ • Sendableॻ͍ͯͨΓ
Ϟμϯͱ • ΑΓྑ͍φϏήʔγϣϯ • DeepLink͘͢͠ • ςελϏϦςΟ • DI •
ͷׂ • ύϑΥʔϚϯε • Identi fi edArray • ΑΓ͘ॻ͚ΔAPI
Apple࣮ͷ؆ܿ͞ྑ͍ • ΞϓϦ։ൃ࢝Ίͨͯͷਓ͕ύϑΥʔϚϯεςελϏϦςΟΛؾʹ͢͠ ͗ͯԿ࣮Ͱ͖ͳ͘ͳΔͷΑ͘ͳ͍
ͳΜͱTCA൛࣮͋Δ
TCAͷExamplesʹStandups͕Ճ͞Εͨ • pointfreeco/swift-composable-architecture • 5݄ʹϦϦʔε͞ΕͨTCAͷNavigationػೳͱڞʹStandupsͷαϯϓϧ Ճ͞Εͨ
pointfreeco/standupsͷඍົ͞Λײ͡Δ TreeBasedͷίʔυ͕ͩɺStackBasedͰࣅͨΑ͏ͳ͜ͱΛ͍ͬͯΔ
pointfreeco/standupsͷඍົ͞Λײ͡Δ TreeBasedͷίʔυ͕ͩɺStackBasedͰࣅͨΑ͏ͳ͜ͱΛ͍ͬͯΔ ↓ͳΜ͔ॻ͖Εͦ͏
• ࢠ(ભҠઌ)ͷΞΫγϣϯReducerͷenumͰཏతʹॻ͚Δ TCA
TCA͍͍ͧ (झࢫ͕ͣΕ͖ͯͦ͏) ͜Ε͚ͩͰͳ͍͚Ͳ...
·ͱΊ • AppleͷνϡʔτϦΞϧ࣮ͱpointfreeͷϞμϯ࣮Λൺֱͨ͠ • ςελϏϦςΟύϑΥʔϚϯεΛҙࣝ͢Δ͜ͱͰϞμϯͳ࣮ʹɻ࣮ ެ։͞Ε͍ͯΔͷͰൺֱͯ͠ΈΑ͏ʂ
AppleͷνϡʔτϦΞϧͬͱ͍ͯʂ ↑ͪͳΈʹ͜ͷਓΤΞϓɻνϡʔτϦΞϧͬͨ͜ͱ͋Γ·ͤΜ
ࢀߟ • https://www.pointfree.co/blog/posts/99-modern-swiftui • pointfreeͷ༗ྉهࣄཧղͷ֬ೝͷΈʹͬͯ·͢