Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions RxFlow/jueun-RxFlow.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

간단한 Sample 코드 작성해주시는거 어떤가요?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator 의 핵심은 화면로직을 ViewController로부터 '분리'한다는 것이 핵심입니다. Coordinator를 사용하지 않고 다른 방법으로 화면로직 로직을 분리할 수 없을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MVVM 아키텍처는 화면 로직을 ViewController로부터 분리하는 방법 중 하나입니다.
또한 Clean 아키텍처의 한 종류인 VIPER도 화면 로직을 모듈화된 컴포넌트로 분리합니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MVVM 아키텍처를 사용해도 화면로직을 분리할 수 있습니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하

Copy link
Contributor

Choose a reason for hiding this comment

The 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)을 쉽게 구현할 수 있음
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

왜 의존성 주입이 쉽게 구현될 수 있나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RxFlow를 사용하면 각 화면을 모듈로 분리하고, 모듈 간의 의존성을 명확하게 관리할 수 있어 더 효과적인 의존성 주입이 구현됩니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 모듈로 분리한다는 것이 무엇을 의미하나요?
  • 의존성을 관리할 수 있다고 하셨는데, 의존성을 관리한다는게 무슨 의미인가요?

실제 코드도 넣을 수 있다면 넣어서 답해주신다면 좋을거같습니다 :)

- UIViewController에 있는 모든 네비게이션 매커니즘을 삭제함
- 반응형 프로그래밍(Reactive Programming) 사용을 촉진함
- 네비게이션에서 일어나는 대부분의 케이스를 처리하면서 선언형으로 표현할 수 있음
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선언형이 무엇을 의미하나요? RxFlow가 어떻게 선언형으로 표현할 수 있게 해주는건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선언형은 화면 전환과 네비게이션의 흐름을 명시적으로 선언하고 정의하는 방식을 나타냅니다.
Flow와 Step, FlowContributor를 사용하면 선언적 방식으로 앱의 네비게이션 흐름을 표현할 수 있습니다.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

선언형 프로그래밍이란 무엇인지 아시나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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:) 함수를 호출하여 사용할 수 있음