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
Eight iOSを支えるアーキテクチャ
Search
Masashi
June 15, 2019
Programming
1
610
Eight iOSを支えるアーキテクチャ
Developers Boost KANSAI
https://event.shoeisha.jp/devboost/20190615
Masashi
June 15, 2019
Tweet
Share
More Decks by Masashi
See All by Masashi
Speech Frameworkを使った音声認識の基本
kawabe
0
63
これだけは伝えたい設計の技術
kawabe
0
1.3k
EightのUI Component化の取り組み
kawabe
0
130
Other Decks in Programming
See All in Programming
Flutter로 Gemini와 MCP를 활용한 Agentic App 만들기 - 박제창 2025 I/O Extended Seoul
itsmedreamwalker
0
150
GUI操作LLMの最新動向: UI-TARSと関連論文紹介
kfujikawa
0
1k
Honoアップデート 2025年夏
yusukebe
1
840
Kiroの仕様駆動開発から見えてきたAIコーディングとの正しい付き合い方
clshinji
1
140
コンテキストエンジニアリング Cursor編
kinopeee
1
700
コーディングエージェント時代のNeovim
key60228
1
100
「リーダーは意思決定する人」って本当?~ 学びを現場で活かす、リーダー4ヶ月目の試行錯誤 ~
marina1017
0
240
レガシープロジェクトで最大限AIの恩恵を受けられるようClaude Codeを利用する
tk1351
2
980
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
720
AHC051解法紹介
eijirou
0
620
The State of Fluid (2025)
s2b
0
190
ソフトウェアテスト徹底指南書の紹介
goyoki
1
110
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Thoughts on Productivity
jonyablonski
69
4.8k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
How to Think Like a Performance Engineer
csswizardry
25
1.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
What's in a price? How to price your products and services
michaelherold
246
12k
Raft: Consensus for Rubyists
vanstee
140
7.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Side Projects
sachag
455
43k
Fireside Chat
paigeccino
39
3.6k
Transcript
ɹ&JHIUJ04Λࢧ͑ΔΞʔΩςΫνϟ Տลխ࢙ 4BOTBOגࣜձࣾ
Տลխ࢙ɹMasashi Kawabe Sansanגࣜձࣾ Eightࣄۀ෦ Engineering Group iOS ΤϯδχΞ 20184݄ Sansanגࣜձࣾ৽ଔೖࣾ
Eight iOS ͷ։ൃʹैࣄ
2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦ଐ
ϝϯγϣϯػೳͷ࣮ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮
2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦ଐ
ϝϯγϣϯػೳͷ࣮ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮
None
2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦ଐ
ϝϯγϣϯػೳͷ࣮ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮
ϝϯγϣϯػೳͷ࣮ ओʹϝϯγϣϯͷදࣔɺΞϓϦىಈ࣌ʹදࣔ ͢Δػೳઆ໌ͷφϏήʔγϣϯ࣮Λ୲
2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦ଐ
ϝϯγϣϯػೳͷ࣮ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮
Eight iOS v9.0.0 ϦϦʔε ओʹձࣾϑΥϩʔҰཡը໘ɺձࣾϑΥϩʔɾ ΞϯϑΥϩʔػೳɺ͓Βͤը໘ɺϑΟʔυ UI ৽ɺ UI Component
ಋೖΛ୲
2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦ଐ
ϝϯγϣϯػೳͷ࣮ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮
Sansan iOS v5.0.0 ϦϦʔε ओʹ໊Ұཡը໘ͷ࣮ɺ UI Component ಋೖΛ୲
2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦ଐ
ϝϯγϣϯػೳͷ࣮ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮
໊ࡱӨ ࿈བྷઌҰཡ ϑΟʔυ ϓϨϛΞϜػೳ
໊ࡱӨ ࿈བྷઌҰཡ ϑΟʔυ ϓϨϛΞϜػೳ ը໘ʹө͢Δঢ়ଶ͕ଟ͘ෳࡶ
ઃܭͱʁ ؔ৺ͷʹΑͬͯɺෳࡶͳΛ ୯७ͳͷ܈ͱͯ͠Γ͚Δ͜ͱ Ҿ༻J04ΞϓϦઃܭύλʔϯೖ IUUQTQFBLTDDCPPLTJ04@BSDIJUFDUVSF
αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ɺ ਓใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ
αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ɺ ਓใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ ෳࡶ
௨৴͍ͨ͠ αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ɺ ਓใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ
σʔλΛΈཱ͍ͯͨ αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ɺ ਓใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ
σʔλΛอଘ͍ͨ͠ αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ɺ ਓใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ
ϨΠΞτ͍ͨ͠ αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ɺ ਓใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ
௨৴͍ͨ͠ αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ σʔλΛΈཱ͍ͯͨ ਓใΛ࣋ͭ Entity ʹ parse ͢Δ σʔλΛอଘ͍ͨ͠ Ωϟογϡʹऔಘͨ͠ใΛอଘ͢Δ
ϨΠΞτ͍ͨ͠ View ʹදࣔ͢Δ
ઃܭΛ͢Δࡍʹཱͭͷ͕ઃܭύλʔϯ ༗໊ͳͷɺ GoF ͷ 23ݸͷσβΠϯύλʔϯ
ઃܭύλʔϯΛΔϝϦοτ - ࠶ར༻ੑͷߴ͍ॊೈͳઃܭ͕Ͱ͖Δ - ։ൃऀؒͷҙࢥૄ௨͕༰қʹͳΔ https://www.techscore.com/tech/DesignPattern/foundation/foundation1.html/#dp0-3 YYYύλʔϯͰ͢
ΞʔΩςΫνϟύλʔϯ - ΞϓϦΛಈ͔͢ͱ͍͏ෳࡶͳɺେ·͔ͳෳͷʢ୯७ͳʣʹ Γ͚ΒΕΔ - ͦ͜Ͱ׆༻͞ΕΔͷ͕ΞʔΩςΫνϟ - Eight iOS Ͱ
MVVM ύλʔϯΛ࠾༻
ͳͥ MVVM Λ࠾༻ʁ αʔϏεͷॳظஈ֊໊ཧΞϓϦͩͬͨͨΊɺ MVC Ͱ ྑ͔͔ͬͨ͠Εͳ͍
ͳͥ MVVM Λ࠾༻ʁ - αʔϏε͕͢ΔʹͭΕͯɺSNS ػೳͷΑ͏ͳ ಈతʹঢ়ଶ͕มΘΔͷ͕૿͖͑ͯͨ - ඇಉظॲཧΛநԽ͢ΔͨΊʹར༻͍ͯ͠Δ RxSwift
ͷ binding ػߏΛ࠷େݶʹ׆͔͢͜ͱ͕ Ͱ͖Δ
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
"QQMF͕ఏڙ͢Δ6*,JUʹ6*7JFX$POUSPMMFSͱ͍͏7JFXΛཧ͢ΔΫϥε͕͋Γɺ ը໘ͷϥΠϑαΠΫϧͱը໘ભҠΛ୲͏
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
7JFX - " ͖͢͜ͱ - UI Λఆٛ͢Δ - ViewModel ʹ
UI Events Λ͑Δ - ViewModel ͔Βड͚औͬͨσʔλΛө͢Δ - # ͖͢Ͱͳ͍͜ͱ - ϓϨθϯςʔγϣϯϩδοΫΛఆٛ͢Δ - ௨৴σʔλૢ࡞Λߦ͏
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
7JFX.PEFM - " ͖͢͜ͱ - UI Events Λࢹ͠ɺModel ʹॲཧΛґཔ͢Δ -
Model ͔Βड͚औͬͨσʔλΛ View Ͱར༻͢Δͷʹ ࠷దͳܗʹՃ͢Δ - # ͖͢Ͱͳ͍͜ͱ - UI Λఆٛ͢Δ - ௨৴σʔλૢ࡞Λߦ͏
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
.PEFM - " ͖͢͜ͱ - σʔλߏΛఆٛ͢Δ - σʔλΛӬଓԽ͢Δ - σʔλΛૢ࡞͢Δ
- # ͖͢Ͱͳ͍͜ͱ - UI Λఆٛ͢Δ - σʔλΛ View Ͱར༻͢Δͷʹ࠷దͳܗʹՃ͢Δ
MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH
7JFX 7JFX$POUSPMMFS 7JFX.PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH .PEFM &OUJUZ 3FQPTJUPSZ
3FRVFTU 6TF$BTF .PEFM
- Entity - σʔλߏΛఆٛ͢Δߏମ - Repository - Entity ͷ CRUD
ૢ࡞Λఏڙ͢Δ - SQLite UserDefaults ͷ DataSource ΛӅṭ - Request - HTTP Request Λ͛ΔॲཧΛఆٛ͢Δ - UseCase - ϏδωεϩδοΫΛهड़͢Δ
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
௨৴͍ͨ͠ αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ σʔλΛΈཱ͍ͯͨ ਓใΛ࣋ͭ Entity ʹ parse ͢Δ σʔλΛอଘ͍ͨ͠ Ωϟογϡʹऔಘͨ͠ใΛอଘ͢Δ
ϨΠΞτ͍ͨ͠ View ʹදࣔ͢Δ
௨৴͍ͨ͠ αʔόʔ͔ΒϑΥϩʔ͍ͯ͠ΔਓϦετΛऔಘͯ͠ σʔλΛΈཱ͍ͯͨ ਓใΛ࣋ͭ Entity ʹ parse ͢Δ σʔλΛอଘ͍ͨ͠ Ωϟογϡʹऔಘͨ͠ใΛอଘ͢Δ
ϨΠΞτ͍ͨ͠ View ʹදࣔ͢Δ ίʔυΛݟͯΈ·͠ΐ͏$ ⚠આ໌ͷͨΊʹίʔυ؆ུԽ͍ͯ͠·͢
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
Entity ߏମͰσʔλΛఆٛ
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
Request 3FTQPOTFͷܕΛఆٛ
Request )551.FUIPEΛఆٛ
Request )551.FUIPEΛ͛Δ1BUIΛఆٛ
Request 3FTQPOTFΛड͚औͬͨࡍͷॲཧΛఆٛ
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
Repository 1SPUPDPM *OUFSGBDF Ͱ$36%ૢ࡞Λఆٛ
Repository ఆٛͨ͠$36%ૢ࡞Λ࣮
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
UseCase ۩ମܕͰͳ͘நʹґଘ *OJUJBMJ[FSͰґଘੑʢඞཁͳͷʣΛೖ
UseCase - ґଘؔٯసͷݪଇΛద༻ - มԽ͍͢͠۩Ͱͳ͘ɺ҆ఆͨ͠நʹґଘ - Dependency Injection Λద༻ -
Ϋϥεͷ֎͔Βґଘ͍ͯ͠ΔΛೖ - நʹґଘ͠ɺΫϥεͷ֎͔ΒඞཁͳͷΛೖ͢Δ͜ͱͰςελϒϧʹ
UseCase ϏδωεϩδοΫΛ࣮
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
ViewModel 7JFXͰදࣔ͢Δ&OUJUZΛެ։
ViewModel 7JFX͔Β6*&WFOUΛऔಘ
ViewModel .PEFMʹॲཧΛґཔ
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
View ը໘ىಈͷΠϕϯτΛ௨
View 7JFX.PEFMʹΠϕϯτΛ͑Δ
View 7JFX.PEFM͔Βड͚औͬͨ σʔλΛө
7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ
&OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
·ͱΊ - Eight iOS Ͱ MVVM ύλʔϯΛ࠾༻ - ֤ͷ͖͢͜ͱɾ͖͢Ͱͳ͍͜ͱΛҙ࣮ࣝͯ͠ -
มԽ͍͢͠۩ͷґଘආ͚ɺநґଘ
None
None