-
Notifications
You must be signed in to change notification settings - Fork 0
jueun-rxflow TIL #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
jueun-rxflow TIL #20
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coordinator 의 핵심은 화면로직을 ViewController로부터 '분리'한다는 것이 핵심입니다. Coordinator를 사용하지 않고 다른 방법으로 화면로직 로직을 분리할 수 없을까요?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MVVM 아키텍처는 화면 로직을 ViewController로부터 분리하는 방법 중 하나입니다.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네..?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MVVM 아키텍처를 사용해도 화면로직을 분리할 수 있습니다.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 의도했던 답변은 Navigator였었어요! 한 번 알아보고 각각의 장단점 비교해서 상황따라 잘 사용해봐도 괜찮을거같아요 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| ## RxFlow | ||
|
|
||
| ### RxFlow란? | ||
| - Reactive Flow Coordinator패턴을 기반으로 하는 iOS 네비게이션 프레임워크 | ||
| - Coordinator패턴을 RxSwift에 녹여낸 라이브러리 | ||
|
|
||
| <br> | ||
|
|
||
| ### RxFlow의 장점 | ||
| - 스토리보드를 유닛단위로 분리하여 UIViewController의 재사용성을 키움 | ||
| - 네비게이션의 흐름(context)에 맞게 UIViewController를 다른 방식으로 보여줄 수 있음 | ||
| - 의존성 주입(Dependency Injection)을 쉽게 구현할 수 있음 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 왜 의존성 주입이 쉽게 구현될 수 있나요?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RxFlow를 사용하면 각 화면을 모듈로 분리하고, 모듈 간의 의존성을 명확하게 관리할 수 있어 더 효과적인 의존성 주입이 구현됩니다
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
실제 코드도 넣을 수 있다면 넣어서 답해주신다면 좋을거같습니다 :) |
||
| - UIViewController에 있는 모든 네비게이션 매커니즘을 삭제함 | ||
| - 반응형 프로그래밍(Reactive Programming) 사용을 촉진함 | ||
| - 네비게이션에서 일어나는 대부분의 케이스를 처리하면서 선언형으로 표현할 수 있음 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 선언형이 무엇을 의미하나요? RxFlow가 어떻게 선언형으로 표현할 수 있게 해주는건가요?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 선언형은 화면 전환과 네비게이션의 흐름을 명시적으로 선언하고 정의하는 방식을 나타냅니다.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 선언형 프로그래밍이란 무엇인지 아시나요?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 원하는 결과를 어떻게 얻을지 직접 단계별로 구현하는 것이 아니라 명시적으로 선언하는 방식의 프로그래밍 패러다임입니다 |
||
| - 어플리케이션을 네비게이션의 논리적인 블록으로 나눌 수 있음 | ||
|
|
||
| <br> | ||
|
|
||
| ### RxFlow의 6가지 특징 | ||
| 1. Flow : 네비게이션 작업(ViewController or 다른 Flow 표시)를 선언 | ||
| 2. Step : Flow화면에서 선언된 화면으로 전파될 내부값(Id, URL)을 포함할 수 있음 | ||
| 3. Stepper : Flow의 모든 네비게이션액션을 emit | ||
| 4. Presentable : 표시될 수 있는 추상화타입(기본적으로 UIViewController 및 Flow는 표시 가능) | ||
| 5. FlowContributor : FlowCoordinator에게 Flow의 새 단계를 생성할 수 있는 다음 항목이 무엇인지 알려주는 데이터 구조 | ||
| 6. FlowCoordinator | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 민재 : 왜 쓰다 말았지 |
||
|
|
||
| <br> | ||
|
|
||
| ### 정의 | ||
| 1. Step 정의 | ||
|
|
||
| : Step은 네비게이션 의도를 표현하는 각각의 상태 / enum현태로 선언하는 것이 편리 / 각각의 상태에 따른 case 정의 | ||
| 2. Flow 정의 | ||
|
|
||
| : Flow는 ViewController를 인스턴스화 할 때 의존성 주입(DI)을 구현하는데 사용 | ||
| 3. Stepper 정의 | ||
|
|
||
| : Step을 생성할 수 있는 모든 것, Stepper는 Flow내 모든 네비게이션 액션을 트리거 (ViewModel에서 분리시키는 것이 좋음) | ||
| 4. 딥링킹(Deep Linking) 사용 | ||
|
|
||
| : AppDelegate에서 FlowCoordinator에 도달하고 예를 들어 알림을 수신할 때 navigate(to:) 함수를 호출하여 사용할 수 있음 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
간단한 Sample 코드 작성해주시는거 어떤가요?