Conversation
|
|
||
| func navigate(to step: Step) -> FlowContributors { | ||
| guard let step = step as? AppStep else { return .none } | ||
| switch step { | ||
| case .firstScreen: | ||
| let firstViewController = FirstViewController() | ||
| firstViewController.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(goToSecondScreen)) | ||
| navigationController.viewControllers = [firstViewController] | ||
| return .one(flowContributor: .contribute(withNextPresentable: firstViewController, withNextStepper: firstViewController)) | ||
| case .secondScreen: | ||
| let secondViewController = SecondViewController() | ||
| navigationController.pushViewController(secondViewController, animated: true) | ||
| return .none | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
RxFlow로 화면과 화면간에 데이터를 전달할때는 어떻게 할 수 있을지 한 번 작성해보는거 어떤가요?
There was a problem hiding this comment.
겸사겸사 더해서 push된 화면에서 이전 화면에 무언가 결과를 보내려면은 어떻게 할 수 있을지 고민해보면 좋을거같아요.
(E.g. 리스트 페이지 -> 검색 페이지 로 push했을때 검색 결과 혹은 검색 옵션을 전달)
There was a problem hiding this comment.
Coordinator 의 핵심은 화면로직을 ViewController로부터 '분리'한다는 것이 핵심입니다. Coordinator를 사용하지 않고 다른 방법으로 화면로직 로직을 분리할 수 없을까요?
|
|
||
| <br> | ||
|
|
||
| Coordinator 패턴을 RxSwift와 함께 사용할 수 있도록 랩핑한 프레임워크 |
There was a problem hiding this comment.
왜 RxSwift로 Coordinator를 래핑하여 쓰게 하였을까요?
There was a problem hiding this comment.
RxSwift의 비동기 처리 능력을 활용하여 화면 전환을 효율적으로 관리하기 위해서 라고 생각합니다.
There was a problem hiding this comment.
비동기 처리 능력이 어떻게 화면 전환을 효율적으로 관리할 수 있는건가요?
| ## RxFlow의 장점 | ||
|
|
||
| <br> | ||
|
|
||
| - Coordinator 패턴을 쉽게 적용할 수 있다. | ||
|
|
||
| - 앱의 화면 전환을 효과적으로 관리할 수 있다. No newline at end of file |
|
|
||
| - **Presentable**: Flow 내부에서 화면을 나타내는데 사용되는 프로토콜 | ||
|
|
||
| UIViewController나 UINavigationController를 채택하며, Flow 내에서 화면을 나타내는 역할을 한다. |
There was a problem hiding this comment.
UIViewController나 UINavigationController를 채택하며, 보다는 UIViewController나 UINavigationController, UIWindow 등이 Presentable을 채택하며, 가 자세한 표현같아요
|
|
||
| Flows.whenReady(flow1: appFlow, block: { [unowned self] root in | ||
| self.window.rootViewController = root | ||
| self.window.makeKeyAndVisible() | ||
| }) | ||
|
|
There was a problem hiding this comment.
Flows.whenReady 말고도 Flows.use도 있는데, 차이점이 무엇인가요?
| case .firstScreen: | ||
| let firstViewController = FirstViewController() | ||
| firstViewController.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(goToSecondScreen)) | ||
| navigationController.viewControllers = [firstViewController] | ||
| return .one(flowContributor: .contribute(withNextPresentable: firstViewController, withNextStepper: firstViewController)) | ||
| case .secondScreen: | ||
| let secondViewController = SecondViewController() | ||
| navigationController.pushViewController(secondViewController, animated: true) | ||
| return .none |
There was a problem hiding this comment.
FlowContributors를 반환하는 곳이 있고, 반환하지 않는 곳도 있는데, 반환하는 때와 반환하지 않는 때는 어떤 상황이라고 생각하시나요?
There was a problem hiding this comment.
이후에 다른 화면전환이 있을 때는 다음 화면에 대한 정보를 함께 반환하고
화면 전환이 없다면 .none 을 반환합니다.
There was a problem hiding this comment.
전환할 화면과 전환에 사용되는 Step입니다.
There was a problem hiding this comment.
민재 : 다음 화면에 대한 정보? 말이 좀 애매한거같은데, 아니지 않냐?
|
혹시 그 '하 이 미친놈이 왜이러지' 같은 생각이 드신다면 멈추라고 말씀해주시면 질문 테러 멈출게요.. 🥺 |
ㅋㅋㅋㅋㅋㅋㅋ 아니에요 바쁘실 텐데 확인해 주시는 것만으로도 감사하게 생각하고 있습ㄴㅣ닷 !! |
No description provided.