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
Fat ViewControllerを倒せ! 〜Cocoa MVC への道のり〜 / No M...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Elvis Shi
May 30, 2020
Programming
880
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Fat ViewControllerを倒せ! 〜Cocoa MVC への道のり〜 / No More Fat ViewController! ~The path to Cocoa MVC~
Elvis Shi
May 30, 2020
More Decks by Elvis Shi
See All by Elvis Shi
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
460
ゼロから始めるPreferenceの実装 / Let's implement Preferences from scratch
lovee
0
150
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
390
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
740
How did I build an Open-Source SwiftUI Toast Library
lovee
1
170
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
1.3k
SwiftUIで二重スクロール作ってみた / When I tried to make a dual-scroll-ish view in SwiftUI
lovee
1
380
Observation のあれこれ / A brief introduction about Observation
lovee
3
440
ChatGPT 時代の勉強 / Learning under ChatGPT era
lovee
27
9k
Other Decks in Programming
See All in Programming
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
220
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
2
750
dRuby over BLE
makicamel
2
390
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.8k
スマートグラスで並列バイブコーディング
hyshu
0
260
Oxcを導入して開発体験が向上した話
yug1224
4
340
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
260
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
7.9k
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
120
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
310
Utilizing Notion as your number one productivity tool
mfonobong
4
330
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
730
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Documentation Writing (for coders)
carmenintech
77
5.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Information Architects: The Missing Link in Design Systems
soysaucechin
0
980
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
200
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Typedesign – Prime Four
hannesfritz
42
3.1k
Transcript
'BU7JFX$POUSPMMFSΛͤʂ ʙ$PDPB.7$ͷಓͷΓʙ f o r 4X J G U
;P PN J O Ԇ ઓ
} var employedBy = "YUMEMI Inc." var job = "iOS
Tech Lead" var favoriteLanguage = "Swift" var twitter = "@lovee" var qiita = "lovee" var github = "el-hoshino" var additionalInfo = """ Twitter෮׆ͨ͠ʂ """ final class Me: Developable, Talkable {
IUUQTHJUIVCDPNSFGBDUPSJOHDIBMMFOHFSFWFSTJJPT
طଘϓϩδΣΫτͷ w ϩδοΫ͕༷ʑͳॴʹࠞࡏ͍ͯ͠Δ w ϦηοτϩδοΫ͕BoardViewʹ w ਐߦϩδοΫ͕ViewControllerʹ w ൫αΠζϩδοΫ͕BoardViewʹ w
ΞχϝʔγϣϯϩδοΫ͕ViewControllerʹ
$PDPB.7$ͷߏ 7JFX$POUSPMMFS .PEFM 7JFX ߦಈ ૢ࡞ ௨ ߋ৽
$PDPB.7$ͷߏ w .PEFMɿήʔϜϩδοΫͷॲཧ w 7JFXɿը໘ඳըͱɺϢʔβΞΫγϣϯͷड w 7JFX$POUSPMMFSɿ7JFXͱ.PEFMͷՍ͚ڮ
$PDPB.7$ͷߏ w (BNF&OHJOFɿήʔϜϩδοΫͷॲཧ w #PBSE7JFXɿը໘ඳըͱɺϢʔβΞΫγϣϯͷड w 7JFX$POUSPMMFSɿ#PBSE7JFXͱ(BNF&OHJOFͷ Ս͚ڮ
मਖ਼ํʢίϯϙʔωϯτʣ w (BNF&OHJOFʹશͯͷήʔϜϩδοΫΛू w 7JFX$POUSPMMFSͱ#PBSE7JFXͷήʔϜϩδοΫ Λશͯ(BNF&OHJOFʹҠಈ w #PBSE7JFXʹඳըॲཧͷΈΛ͢ w ήʔϜϧʔϧʹґଘͤͣɺݴΘΕͨ௨Γʹ͢Δ
͚ͩͷඳըϩδοΫ w طଘͷॲཧίʔυࣗମ࠷খݶͷमਖ਼Ͱ
मਖ਼ํʢσʔλϑϩʔʣ w ॲཧͷྲྀΕΛҰຊಓԽ w BoardView͕ϢʔβΞΫγϣϯΛड͚ͨΒ@IBAction ͘͠delegate௨ͯ͠ViewControllerʹୡ w ViewController͕ΒͬͨϢʔβΞΫγϣϯΛݩʹ GameEngineΛૢ࡞ w
GameEngine͕ಠࣗઐ༻εϨουͰૢ࡞Λॲཧ͠ɺͦͷ݁Ռ ΛAnyPublisherͰViewControllerʹ௨ w ViewController͕Βͬͨ݁ՌΛݩʹϝΠϯεϨουͰ BoardViewΛߋ৽ w BoardView͕ͦͷ݁Ռͷ௨Γʹඳը
$PDPB.7$ͷߏ 7JFX$POUSPMMFS .PEFM 7JFX ૢ࡞ ௨ ߋ৽ ߦಈ
$PDPB.7$ͷߏ 7JFX$POUSPMMFS (BNF&OHJOF #PBSE7JFX ૢ࡞ ௨ ߋ৽ ߦಈ
$PDPB.7$ͷߏ 7JFX$POUSPMMFS (BNF&OHJOF #PBSE7JFX reset() setPlayer(_:for:) getPlayer(for:)-> placeDisk(at:) nextMove() currentBoard{get}
saveGame() loadGame() $isThinking $changedDisks $currentTurn $currentCount boardSize{set} changeDisks(at:to:) reset(with:) @pressReset(_:) @changePlayerControl(_:) .didSelectCell(at:) $AnyPublisherͱͯ͠ฦ͞ΕΔ @@IBActionΛ௨ͯ͠ݺΕΔ .delegateΛ௨ͯ͠ݺΕΔ
%&.0
ল w ෦࡞ͬͯॲཧΛҠಈ͢Δલʹɺ͏গ͠ϝιουΛ ࡉ͔͘Γग़͖ͩͬͨ͢ w ॲཧͷҠಈͱϝιουͷΓग़͠ͱςετͷ࣮ͷ ಉ࣌ฒߦ͕ڧ͍ΒΕͯେมͩͬͨ w ͞Βʹͦͷ͍ͤͰ్த͔Βςετॻ͘ͷఘΊͨ
ͦͷଞ w $PDPB.7$ͷߏͷઆ໌͚ͩͳͷͰɺGameEngine ͕·ͩগʑ'BU w GameEngineΛ७ਮؔԽͯ͠ɺ֤छঢ়ଶΛ͞Βʹ GameStoreͱ͔ʹΓग़ͤߋʹ͖Ε͍ʹͳΔ w ͬͺ6*,JUʹͱͬͯ$PDPB.7$ָʂ w
protocolͰ@Published<Value>ͱ͔ΛએݴͰ͖Δ Α͏ʹͯ͠΄͍͠ w ࠓAnyPublisher<Value, Never> { get }Ͱ ఆٛ͢Δ͔͠ͳ͍ͷ͕ඍົʹਏ͍