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
MVCからVIPERへのリファクタに入門した話
Search
Shoryu0831
November 29, 2019
Technology
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MVCからVIPERへのリファクタに入門した話
VIPERへのリファクタをする時に、悩んだところについて説明しました。
Shoryu0831
November 29, 2019
Other Decks in Technology
See All in Technology
ウォンテッドリーの最近のプロダクトと技術の紹介
stomk
0
130
パッチ更新でterraform initが落ちた日
grimoh
1
140
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
140
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
230
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
180
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
5.1k
Getting Started with Google Antigravity
glaforge
0
320
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
230
その Valkey 使いこなしていますか?
onk
PRO
5
1.6k
夫婦で子育てするための育児標準化
codmoninc
PRO
0
450
今さら理解するウェブフォントver.2026
takanorip
3
900
Featured
See All Featured
A better future with KSS
kneath
240
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
590
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
Why Our Code Smells
bkeepers
PRO
340
58k
Side Projects
sachag
456
43k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
ラッコキーワード サービス紹介資料
rakko
1
5.4M
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
Transcript
MVC͔ΒVIPERͷ ϦϑΝΫλʹೖͨ͠ @Shoryu0831
ࣗݾհ • SHORYU • @Shoryu0831 • iOSΤϯδχΞ(2019/08~)@Azit • ॳLT
֓ཁ
֓ཁ • ݱࡏΞϓϦͷϦϑΝΫλத(MVC->VIPER) • ࣗͷܦݧMVCͱMVVMΛগ͠ • ܦݧ͕গͳ͍ਓ͕VIPERʹ৮ΕͯΈͨΛ ͠·͢
Μͩॴ
import UIKit class menuViewController: UIViewController { //ུ override func viewDidLoad()
{ if AuthUtil.getAuthInfo() { //ུ ݩͷίʔυ
มΛͲ͜Ͱ͔࣋ͭ • ࠷ॳViewͰauthenticatedͱ͍͏ϩάΠϯঢ় گʹΑͬͯΛม͑ΔมΛఆٛ͠ɺͦΕͷ ʹΑͬͯϝχϡʔͷग़͚͠Λ͍ͯͨ͠ɻ
import UIKit final class menuViewController { private authenticated: Bool =
false //ུ override func viewDidLoad() { presenter.getAuth(authenticated) //͜͜ͰauthenticatedͷΓସ͑ } //ུ ϩάΠϯঢ়گΛͲ͜Ͱ͔࣋ͭ
Viewͷʁ
Viewͷ • Cheesecake LabsͷUsing VIPERʹΑΔͱɻɻ Its sole responsibility is to
display what the Presenter tells it to, and handle the user interactions with the screen. (https://cheesecakelabs.com/blog/ios-project-architecture-using-viper/ΑΓҾ༻) • ViewͷׂPresenter͕͑ͨ௨Γʹදࣔ͢ΔͷͱɺUI ͷૢ࡞Λॲཧ͢Δ͜ͱɻ
มߋ
ॻ͖͑ޙ - Presenter import Foundation final class MenuPresenter { private
var authenticated: Bool = false } // ུ extension MenuPresenter: MenuInteractorDelegate { func didFetchLoggedIn(_ loggedIn: Bool) { self.authenticated = loggedIn } func updateSettingList() { if authenticated { view.updateList() } } }
ॻ͖͑ޙ - View import UIKit final class menuViewController { private
authenticated: Bool = false //ུ override func viewDidLoad() { presenter.getAuth(authenticated) } func updateList() { // ϦετΛߋ৽͢Δ //ུ
͍͞͝ʹ
͍͞͝ʹ • VIPER׳ΕΔ·Ͱॻ͘ͷ͕େม • Ͳ͜ʹԿ͕͋Δ͔໌֬ͳͷͰಡΈ͍͢ • ੋඇVIPERͬͯΈ·͠ΐ͏
͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ