아는 형님이 설명해주신 방법이 좋은 것 같아서 정리해 본 페이지
MVC
Controller에 코드 다 때려박음
Model View ViewModel
MVVM 에서 View와 관련없는 로직은 ViewModel에 위치하게됨
View 와 ViewModel 은 binding이 이루어짐 (rxSwift, Combine 이용)
Massive Controller 에서 Massive viewModel된 느낌
Model View ViewModel + Coordinator
화면전환 역할을 ViewController 에서 분리해서 Coordinator에 적용
화면 전환을 해결해 준 Coordinator 패턴
리액티브 프로그래밍(Reactive Programming)을 사용하기 위해, VIPER 패턴으로 되어 있는 앱 구조를 MVVM 패턴으로 변환하는 작업을 시작했을 때였습니다. MVVM 패턴을 사용해 보지 않았지만, VIPER 패턴의 I
labs.brandi.co.kr
Model View ViewModel + Coordinator + Interactor
네트워킹 쪽을 ViewModel에서 분리해서 Interactor로 분리함
Interactor는 request parametor 넘겨주고 return 으로 데이터나 필요하다면 에러도 전달
디코딩 역시 rx로 map 하여 view 에 표시
View에서 요청 -> ViewModel에 요청 -> Interactor 요청 -> 네트워킹 작업 -> Interactor return -> ViewModel return -> View 표시
행님은 화면 하나당 ViewModel, Coordinator, Interactor 1대1 로 말씀해주심
View 작업
UI는 anchor constraint 로 전부 작업
Cell 단위로 모두 나눠서 enum type 과 ViewModel 주입하여 사용
거의 모든 화면을 Cell 로 나눠 작업하고 UITableView로 구성
네트워킹
네트워킹은 Alamofire + Moya 사용
baseURL 이나 endpoint 정리 가능함
쭈욱 읽어보니 뭔가 VIP 패턴인 것 같다.
VIP에도 coordinator 가 있나
stackoverflow.com/questions/55555285/routers-vs-coordinators
Routers VS coordinators
I am an ios developer and trying to figure out the difference between the router in viper architecture and coordinator . I really cant find a clear answer is the coordinator just considered a patte...
stackoverflow.com
VIP 구조 레퍼런스
medium.com/swift2go/installing-the-clean-swift-template-in-xcode-6b4367006827
Installing the Clean Swift Template in Xcode
Clean Swift becomes more and more popular amongst iOS Developers. This short tutorial will show you how to install the template in Xcode…
medium.com
hackernoon.com/introducing-clean-swift-architecture-vip-770a639ad7bf
Introducing Clean Swift Architecture (VIP) | Hacker Noon
Introducing Clean Swift Architecture (VIP) Forget MVC, now! https://clean-swift.com/clean-swift-ios-architecture/ A couple of years ago, all of the iOS apps were small containing less than 10 screens. The codebase was small, storyboards were working excel
hackernoon.com
www.youtube.com/watch?v=WGP-1b1WBz0
기타
www.youtube.com/watch?v=GXAGCTsnShI
www.youtube.com/watch?v=AnUcZUMGVBI
www.youtube.com/watch?v=3XS6xLzKRjc
www.youtube.com/watch?v=KUEe1tc2CbE
www.youtube.com/watch?v=AnUcZUMGVBI
Get Started with Clean Swift - Clean Swift
Do you resonate with any of the following? Do your view controllers become massive and hard to understand, fix bugs, and add new features? Okay, you moved the business logic to the models. But now your models become too fat. Does your app use one gigantic
clean-swift.com
'iOS > Architecture' 카테고리의 다른 글
클린 아키텍쳐 4부 정리 (12장~14장) (0) | 2022.04.08 |
---|---|
클린 아키텍쳐 1, 2, 3부 정리 (1장~11장) (0) | 2022.03.31 |
클린 아키텍쳐를 어떻게 공부하지 (0) | 2022.03.26 |
iOS: Repository pattern in Swift (0) | 2020.08.07 |
iOS - MVVM Simple look (0) | 2020.04.22 |
댓글