@@ -9,6 +9,7 @@ final class BookDetailCoordinator: Coordinator {
99
1010 private let isbn : String
1111 private let userBookId : String
12+ private weak var bookDetailViewController : BookDetailViewController ?
1213
1314 init (
1415 parentCoordinator: Coordinator ? ,
@@ -30,6 +31,7 @@ final class BookDetailCoordinator: Coordinator {
3031 )
3132 )
3233 viewController. coordinator = self
34+ bookDetailViewController = viewController
3335 navigationController. pushViewController ( viewController, animated: true )
3436 }
3537}
@@ -52,15 +54,35 @@ extension BookDetailCoordinator {
5254 }
5355
5456 func didTapCell( recordId: String ) {
55- let viewController = NoteCompletionViewController (
56- viewModel: NoteCompletionViewModel ( recordId: recordId)
57- )
58- let noteNavigationController = UINavigationController ( rootViewController: viewController)
59-
57+ let noteNavigationController = UINavigationController ( )
6058 noteNavigationController. modalPresentationStyle = . fullScreen
59+
60+ let noteCompletionCoordinator = NoteCompletionCoordinator (
61+ parentCoordinator: self ,
62+ navigationController: noteNavigationController,
63+ recordId: recordId
64+ )
65+ addChildCoordinator ( noteCompletionCoordinator)
66+ noteCompletionCoordinator. start ( )
67+
6168 navigationController. present ( noteNavigationController, animated: true )
6269 }
6370
71+ func didTapEditButton( recordId: String , from presentingController: UIViewController ) {
72+ let editNavigationController = UINavigationController ( )
73+ editNavigationController. modalPresentationStyle = . fullScreen
74+
75+ let noteEditCoordinator = NoteEditCoordinator (
76+ parentCoordinator: self ,
77+ navigationController: editNavigationController,
78+ recordId: recordId
79+ )
80+ addChildCoordinator ( noteEditCoordinator)
81+ noteEditCoordinator. start ( )
82+
83+ presentingController. present ( editNavigationController, animated: true )
84+ }
85+
6486 /// 문장 카드 확인 및 공유하기 화면으로 이동합니다.
6587 func goToShareView( item: BookDetailItem ) {
6688 let viewController = SentenceCardViewController (
@@ -71,4 +93,3 @@ extension BookDetailCoordinator {
7193 navigationController. pushViewController ( viewController, animated: true )
7294 }
7395}
74-
0 commit comments