-
Notifications
You must be signed in to change notification settings - Fork 0
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
ain-RxFlow #19
base: master
Are you sure you want to change the base?
ain-RxFlow #19
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RxFlow로 화면과 화면간에 데이터를 전달할때는 어떻게 할 수 있을지 한 번 작성해보는거 어떤가요?
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.
겸사겸사 더해서 push된 화면에서 이전 화면에 무언가 결과를 보내려면은 어떻게 할 수 있을지 고민해보면 좋을거같아요.
(E.g. 리스트 페이지 -> 검색 페이지 로 push했을때 검색 결과 혹은 검색 옵션을 전달)
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.
Coordinator 의 핵심은 화면로직을 ViewController로부터 '분리'한다는 것이 핵심입니다. Coordinator를 사용하지 않고 다른 방법으로 화면로직 로직을 분리할 수 없을까요?
|
||
<br> | ||
|
||
Coordinator 패턴을 RxSwift와 함께 사용할 수 있도록 랩핑한 프레임워크 |
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.
왜 RxSwift로 Coordinator를 래핑하여 쓰게 하였을까요?
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.
RxSwift의 비동기 처리 능력을 활용하여 화면 전환을 효율적으로 관리하기 위해서 라고 생각합니다.
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.
비동기 처리 능력이 어떻게 화면 전환을 효율적으로 관리할 수 있는건가요?
## RxFlow의 장점 | ||
|
||
<br> | ||
|
||
- Coordinator 패턴을 쉽게 적용할 수 있다. | ||
|
||
- 앱의 화면 전환을 효과적으로 관리할 수 있다. |
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.
반대로 단점은..?
|
||
- **Presentable**: Flow 내부에서 화면을 나타내는데 사용되는 프로토콜 | ||
|
||
UIViewController나 UINavigationController를 채택하며, Flow 내에서 화면을 나타내는 역할을 한다. |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlowContributors를 반환하는 곳이 있고, 반환하지 않는 곳도 있는데, 반환하는 때와 반환하지 않는 때는 어떤 상황이라고 생각하시나요?
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.
이후에 다른 화면전환이 있을 때는 다음 화면에 대한 정보를 함께 반환하고
화면 전환이 없다면 .none 을 반환합니다.
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.
다음 화면에 대한 정보가 무엇인가요?
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.
전환할 화면과 전환에 사용되는 Step입니다.
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.
민재 : 다음 화면에 대한 정보? 말이 좀 애매한거같은데, 아니지 않냐?
혹시 그 '하 이 미친놈이 왜이러지' 같은 생각이 드신다면 멈추라고 말씀해주시면 질문 테러 멈출게요.. 🥺 |
ㅋㅋㅋㅋㅋㅋㅋ 아니에요 바쁘실 텐데 확인해 주시는 것만으로도 감사하게 생각하고 있습ㄴㅣ닷 !! |
No description provided.