From cc9dc1a9ce402414af21d87c18d7686cff2d3dfa Mon Sep 17 00:00:00 2001 From: 513sojin <513sojin@naver.com> Date: Wed, 22 Nov 2023 15:52:44 +0900 Subject: [PATCH 01/12] =?UTF-8?q?[Feat]=20#214=20-=20custom=20alert=20?= =?UTF-8?q?=EC=BB=A4=EC=8A=A4=ED=85=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/UIKit+/UIViewController+.swift | 2 +- .../Global/UIComponents/CustomAlertVC.swift | 69 ++++++++++++++----- 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift b/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift index a61a029b..7d08e1eb 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift @@ -39,7 +39,7 @@ extension UIViewController { } func presentSignInRequestAlertVC() { - let alertVC = CustomAlertVC() + let alertVC = CustomAlertVC(type: .image) .setTitle("가입 후 로그인 시 코스를 저장하고 달릴 수 있어요!") .setLeftButtonTitle(NSAttributedString(string: "닫기", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.m1])) .setRightButtonTitle(NSAttributedString(string: "가입하기", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.w1])) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift index 4fd70b1d..52a6b84c 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift @@ -8,6 +8,11 @@ import UIKit import Combine +enum CustomAlertType { + case text + case image +} + final class CustomAlertVC: UIViewController { // MARK: - Properties @@ -26,6 +31,7 @@ final class CustomAlertVC: UIViewController { var leftButtonTapAction: (() -> Void)? var rightButtonTapAction: (() -> Void)? + private var alertType: CustomAlertType! private var cancelBag = CancelBag() @@ -55,11 +61,19 @@ final class CustomAlertVC: UIViewController { } // MARK: - View Life Cycle + init(type: CustomAlertType) { + super.init(nibName: nil, bundle: nil) + self.alertType = type + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } override func viewDidLoad() { super.viewDidLoad() self.setUI() - self.setLayout() + self.setLayout(self.alertType) self.bindViews() } } @@ -117,26 +131,43 @@ extension CustomAlertVC { alertView.layer.cornerRadius = 20 } - private func setLayout() { + private func setLayout(_ type: CustomAlertType) { view.addSubviews(alertView) - alertView.addSubviews(alertImageView, contentsLabel, buttonStackView) - - alertView.snp.makeConstraints { make in - make.center.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) - } - - alertImageView.snp.makeConstraints { make in - make.top.equalToSuperview().inset(38) - make.centerX.equalToSuperview() - make.width.equalTo(189) - make.height.equalTo(169) - } - contentsLabel.snp.makeConstraints { make in - make.top.equalTo(alertImageView.snp.bottom).offset(24) - make.leading.trailing.equalToSuperview().inset(10) - make.centerX.equalToSuperview() + switch type { + case .text: + alertView.addSubviews( contentsLabel, buttonStackView) + + alertView.snp.makeConstraints { make in + make.center.equalTo(view.safeAreaLayoutGuide) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) + } + + contentsLabel.snp.makeConstraints { make in + make.top.equalTo(alertView.snp.top).offset(24) + make.leading.trailing.equalToSuperview().inset(10) + make.centerX.equalToSuperview() + } + case .image: + alertView.addSubviews(alertImageView, contentsLabel, buttonStackView) + + alertView.snp.makeConstraints { make in + make.center.equalTo(view.safeAreaLayoutGuide) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) + } + + alertImageView.snp.makeConstraints { make in + make.top.equalToSuperview().inset(38) + make.centerX.equalToSuperview() + make.width.equalTo(189) + make.height.equalTo(169) + } + + contentsLabel.snp.makeConstraints { make in + make.top.equalTo(alertImageView.snp.bottom).offset(24) + make.leading.trailing.equalToSuperview().inset(10) + make.centerX.equalToSuperview() + } } buttonStackView.snp.makeConstraints { make in From ed34c160692426b7f0c728801351917eebe0b12c Mon Sep 17 00:00:00 2001 From: 513sojin <513sojin@naver.com> Date: Thu, 23 Nov 2023 23:07:29 +0900 Subject: [PATCH 02/12] =?UTF-8?q?[Feat]=20#214=20-=20custom=20alert=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runnect-iOS/Global/UIComponents/CustomAlertVC.swift | 4 ++-- .../Presentation/CourseDrawing/VC/CourseDrawingVC.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift index 52a6b84c..9b4627ce 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift @@ -43,10 +43,10 @@ final class CustomAlertVC: UIViewController { } private let contentsLabel: UILabel = UILabel().then { $0.text = "코스를 만들었어요!\n지정한 코스는 보관함에서 볼 수 있어요." - $0.font = .h5 + $0.font = .b4 $0.textColor = .g2 $0.textAlignment = .center - $0.numberOfLines = 2 + $0.numberOfLines = 3 } private let leftButton = CustomButton(title: "보관함 가기") diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift index 98166a01..6d9d8ae4 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift @@ -203,7 +203,7 @@ extension CourseDrawingVC { } private func presentAlertVC(courseId: Int) { - let alertVC = CustomAlertVC() + let alertVC = CustomAlertVC(type: .image) alertVC.modalPresentationStyle = .overFullScreen alertVC.leftButtonTapped.sink { [weak self] _ in From c08c04002af583cdbc6c8290c74a00fd5118c366 Mon Sep 17 00:00:00 2001 From: 513sojin <513sojin@naver.com> Date: Thu, 23 Nov 2023 23:08:03 +0900 Subject: [PATCH 03/12] =?UTF-8?q?[Feat]=20#214=20-=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EC=A0=91=EA=B7=BC=20=ED=97=88=EC=9A=A9=20=ED=8C=9D=EC=97=85=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseDrawing/VC/DepartureSearchVC.swift | 80 ++++++++++++++++++- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift index 5313442a..b98634b8 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift @@ -25,7 +25,6 @@ final class DepartureSearchVC: UIViewController, CLLocationManagerDelegate { private lazy var naviBar = CustomNavigationBar(self, type: .search) .setTextFieldPlaceholder(placeholder: "출발지를 설정해주세요") - .showKeyboard() private let dividerView = UIView().then { $0.backgroundColor = .g5 @@ -79,6 +78,12 @@ final class DepartureSearchVC: UIViewController, CLLocationManagerDelegate { self.setDelegate() self.registerCell() self.setBinding() + self.setAuthorization() + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.naviBar.showKeyboard() } } @@ -89,6 +94,7 @@ extension DepartureSearchVC { self.naviBar.delegate = self self.locationTableView.delegate = self self.locationTableView.dataSource = self + self.locationManager.delegate = self } private func registerCell() { @@ -103,12 +109,14 @@ extension DepartureSearchVC { } private func setBinding() { - selectDirectionView.gesture().sink { _ in + selectDirectionView.gesture().sink { [weak self] _ in + guard let self = self else { return } SelectedInfo.shared.type = .other self.setLocation() }.store(in: cancelBag) - selectMapView.gesture().sink { _ in + selectMapView.gesture().sink { [weak self] _ in + guard let self = self else { return } SelectedInfo.shared.type = .map self.setLocation() }.store(in: cancelBag) @@ -120,7 +128,6 @@ extension DepartureSearchVC { extension DepartureSearchVC { /// 현재 위도, 경도에 따른 주소 받아오는 함수 private func setLocation() { - locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest DispatchQueue.global().async { [self] in @@ -136,6 +143,71 @@ extension DepartureSearchVC { } } } + + private func setAuthorization() { + let authorizationStatus: CLAuthorizationStatus + if #available(iOS 14.0, *) { + authorizationStatus = locationManager.authorizationStatus + }else { + authorizationStatus = CLLocationManager.authorizationStatus() + } + + DispatchQueue.global().async { [weak self] in + guard let self = self else { return } + if CLLocationManager.locationServicesEnabled() { + switch authorizationStatus { + case .notDetermined ,.restricted ,.denied: + DispatchQueue.main.async { + self.presentAlertVC() + } + default: + DispatchQueue.main.async { + self.naviBar.showKeyboard() + } + } + } else { + DispatchQueue.main.async { + self.presentServiceAlertVC() + } + } + } + } + + private func presentServiceAlertVC() { + let requestLocationServiceAlert = UIAlertController(title: "위치 정보 이용", message: "위치 서비스를 사용할 수 없습니다.\n디바이스의 '설정 > 개인정보 보호'에서\n위치 서비스를 먼저 켜주세요.", preferredStyle: .alert) + let cancel = UIAlertAction(title: "확인", style: .default) { [weak self] _ in + self?.navigationController?.popViewController(animated: true) + } + requestLocationServiceAlert.addAction(cancel) + + present(requestLocationServiceAlert, animated: true) + } + + private func presentAlertVC() { + let alertVC = CustomAlertVC(type: .text) + .setTitle("위치 접근을 허용해야 사용할 수 있어요.\n[설정] - [애플리케이션] - [위치접근]을\n허용해 주세요.") + .setLeftButtonTitle(NSAttributedString(string: "아니오", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.m1])) + .setRightButtonTitle(NSAttributedString(string: "예", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.w1])) + alertVC.modalPresentationStyle = .overFullScreen + + alertVC.leftButtonTapped.sink { [weak self] _ in + guard let self = self else { return } + alertVC.dismiss(animated: false) + self.navigationController?.popViewController(animated: true) + }.store(in: cancelBag) + + alertVC.rightButtonTapped.sink { [weak self] _ in + guard let self = self else { return } + if let url = URL(string: UIApplication.openSettingsURLString) { + UIApplication.shared.open(url) + alertVC.dismiss(animated: false) + } + self.navigationController?.popViewController(animated: true) + + }.store(in: cancelBag) + + self.present(alertVC, animated: false) + } } // MARK: - UI & Layout From f1b5db1ecafce78ed57e539e82cfac4d7ffc58bc Mon Sep 17 00:00:00 2001 From: 513sojin <513sojin@naver.com> Date: Tue, 5 Dec 2023 21:50:44 +0900 Subject: [PATCH 04/12] =?UTF-8?q?[Fix]=20#214=20-=20custom=20alert=20?= =?UTF-8?q?=EC=9B=90=EC=83=81=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/UIKit+/UIViewController+.swift | 2 +- .../Global/UIComponents/CustomAlertVC.swift | 72 ++++++------------- 2 files changed, 21 insertions(+), 53 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift b/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift index 7d08e1eb..a61a029b 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift @@ -39,7 +39,7 @@ extension UIViewController { } func presentSignInRequestAlertVC() { - let alertVC = CustomAlertVC(type: .image) + let alertVC = CustomAlertVC() .setTitle("가입 후 로그인 시 코스를 저장하고 달릴 수 있어요!") .setLeftButtonTitle(NSAttributedString(string: "닫기", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.m1])) .setRightButtonTitle(NSAttributedString(string: "가입하기", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.w1])) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift index 9b4627ce..2084fced 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift @@ -8,11 +8,6 @@ import UIKit import Combine -enum CustomAlertType { - case text - case image -} - final class CustomAlertVC: UIViewController { // MARK: - Properties @@ -31,7 +26,6 @@ final class CustomAlertVC: UIViewController { var leftButtonTapAction: (() -> Void)? var rightButtonTapAction: (() -> Void)? - private var alertType: CustomAlertType! private var cancelBag = CancelBag() @@ -46,7 +40,7 @@ final class CustomAlertVC: UIViewController { $0.font = .b4 $0.textColor = .g2 $0.textAlignment = .center - $0.numberOfLines = 3 + $0.numberOfLines = 2 } private let leftButton = CustomButton(title: "보관함 가기") @@ -61,19 +55,10 @@ final class CustomAlertVC: UIViewController { } // MARK: - View Life Cycle - init(type: CustomAlertType) { - super.init(nibName: nil, bundle: nil) - self.alertType = type - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - override func viewDidLoad() { super.viewDidLoad() self.setUI() - self.setLayout(self.alertType) + self.setLayout() self.bindViews() } } @@ -131,45 +116,28 @@ extension CustomAlertVC { alertView.layer.cornerRadius = 20 } - private func setLayout(_ type: CustomAlertType) { + private func setLayout() { view.addSubviews(alertView) - switch type { - case .text: - alertView.addSubviews( contentsLabel, buttonStackView) - - alertView.snp.makeConstraints { make in - make.center.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) - } - - contentsLabel.snp.makeConstraints { make in - make.top.equalTo(alertView.snp.top).offset(24) - make.leading.trailing.equalToSuperview().inset(10) - make.centerX.equalToSuperview() - } - case .image: - alertView.addSubviews(alertImageView, contentsLabel, buttonStackView) - - alertView.snp.makeConstraints { make in - make.center.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) - } - - alertImageView.snp.makeConstraints { make in - make.top.equalToSuperview().inset(38) - make.centerX.equalToSuperview() - make.width.equalTo(189) - make.height.equalTo(169) - } - - contentsLabel.snp.makeConstraints { make in - make.top.equalTo(alertImageView.snp.bottom).offset(24) - make.leading.trailing.equalToSuperview().inset(10) - make.centerX.equalToSuperview() - } + alertView.addSubviews(alertImageView, contentsLabel, buttonStackView) + + alertView.snp.makeConstraints { make in + make.center.equalTo(view.safeAreaLayoutGuide) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) } + alertImageView.snp.makeConstraints { make in + make.top.equalToSuperview().inset(38) + make.centerX.equalToSuperview() + make.width.equalTo(189) + make.height.equalTo(169) + } + + contentsLabel.snp.makeConstraints { make in + make.top.equalTo(alertImageView.snp.bottom).offset(24) + make.leading.trailing.equalToSuperview().inset(10) + make.centerX.equalToSuperview() + } buttonStackView.snp.makeConstraints { make in make.top.equalTo(contentsLabel.snp.bottom).offset(26) make.leading.trailing.equalToSuperview().inset(14) From 4dc643d9575c252a74a592fe0b93fb2f3b0503ac Mon Sep 17 00:00:00 2001 From: SojinLee <513sojin@naver.com> Date: Tue, 5 Dec 2023 23:19:45 +0900 Subject: [PATCH 05/12] =?UTF-8?q?[Feat]=20#214=20-=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?alertVC=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseDrawing/VC/CourseDrawingVC.swift | 2 +- .../CourseDrawing/VC/DepartureSearchVC.swift | 23 +++++-------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift index b204b75d..2b154a26 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift @@ -203,7 +203,7 @@ extension CourseDrawingVC { } private func presentAlertVC(courseId: Int) { - let alertVC = CustomAlertVC(type: .image) + let alertVC = CustomAlertVC() alertVC.modalPresentationStyle = .overFullScreen alertVC.leftButtonTapped.sink { [weak self] _ in diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift index b98634b8..aff79cbc 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift @@ -80,11 +80,6 @@ final class DepartureSearchVC: UIViewController, CLLocationManagerDelegate { self.setBinding() self.setAuthorization() } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - self.naviBar.showKeyboard() - } } // MARK: - Methods @@ -184,27 +179,21 @@ extension DepartureSearchVC { } private func presentAlertVC() { - let alertVC = CustomAlertVC(type: .text) - .setTitle("위치 접근을 허용해야 사용할 수 있어요.\n[설정] - [애플리케이션] - [위치접근]을\n허용해 주세요.") - .setLeftButtonTitle(NSAttributedString(string: "아니오", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.m1])) - .setRightButtonTitle(NSAttributedString(string: "예", attributes: [.font: UIFont.h5, .foregroundColor: UIColor.w1])) + let alertVC = RNAlertVC(description: "위치 접근을 허용해야 사용할 수 있어요.\n[설정] - [애플리케이션] - [위치접근]을\n허용해 주세요.") alertVC.modalPresentationStyle = .overFullScreen + alertVC.alertType = .custom - alertVC.leftButtonTapped.sink { [weak self] _ in - guard let self = self else { return } + alertVC.leftButtonTapAction = { alertVC.dismiss(animated: false) self.navigationController?.popViewController(animated: true) - }.store(in: cancelBag) - - alertVC.rightButtonTapped.sink { [weak self] _ in - guard let self = self else { return } + } + alertVC.rightButtonTapAction = { if let url = URL(string: UIApplication.openSettingsURLString) { UIApplication.shared.open(url) alertVC.dismiss(animated: false) } self.navigationController?.popViewController(animated: true) - - }.store(in: cancelBag) + } self.present(alertVC, animated: false) } From 374faa782d539daf47656aa690804ed728649223 Mon Sep 17 00:00:00 2001 From: SojinLee <513sojin@naver.com> Date: Tue, 5 Dec 2023 23:19:45 +0900 Subject: [PATCH 06/12] =?UTF-8?q?[Feat]=20#214=20-=20=EA=B8=B0=EC=A1=B4=20?= =?UTF-8?q?alertVC=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/UIComponents/RNAlertVC.swift | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift index ea377387..f159ed5c 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift @@ -10,11 +10,17 @@ import UIKit import SnapKit import Then +enum AlertType { + case defaultType + case custom +} + final class RNAlertVC: UIViewController { // MARK: - Properties - + var leftButtonTapAction: (()-> Void)? var rightButtonTapAction: (() -> Void)? + var alertType: AlertType = .defaultType // MARK: - UI Components @@ -69,8 +75,10 @@ final class RNAlertVC: UIViewController { extension RNAlertVC { override func touchesBegan(_ touches: Set, with event: UIEvent?) { super.touchesBegan(touches, with: event) - if let touch = touches.first, touch.view == self.view { - dismiss(animated: false) + if alertType == .defaultType { + if let touch = touches.first, touch.view == self.view { + dismiss(animated: false) + } } } @@ -91,7 +99,8 @@ extension RNAlertVC { extension RNAlertVC { @objc private func touchUpNoButton() { - dismiss(animated: false) + alertType == .defaultType + ? dismiss(animated: false) : self.leftButtonTapAction? () } @objc private func touchYesButton() { From 458c5001f6d72c3d0717259cace5859ddb9ece65 Mon Sep 17 00:00:00 2001 From: 513sojin <513sojin@naver.com> Date: Fri, 8 Dec 2023 17:07:24 +0900 Subject: [PATCH 07/12] =?UTF-8?q?[Fix]=20#214=20-=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseDrawing/VC/DepartureSearchVC.swift | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift index aff79cbc..93afa451 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift @@ -149,27 +149,31 @@ extension DepartureSearchVC { DispatchQueue.global().async { [weak self] in guard let self = self else { return } - if CLLocationManager.locationServicesEnabled() { - switch authorizationStatus { - case .notDetermined ,.restricted ,.denied: - DispatchQueue.main.async { - self.presentAlertVC() - } - default: - DispatchQueue.main.async { - self.naviBar.showKeyboard() - } - } - } else { + + guard CLLocationManager.locationServicesEnabled() else { + /// 전체 위치 서비스가 꺼진 경우 DispatchQueue.main.async { self.presentServiceAlertVC() } + return + } + + switch authorizationStatus { + case .notDetermined, .restricted, .denied: + /// 러넥트 위치 서비스가 꺼진 경우 + DispatchQueue.main.async { + self.presentAlertVC() + } + default: + DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.55) { + self.naviBar.showKeyboard() + } } } } private func presentServiceAlertVC() { - let requestLocationServiceAlert = UIAlertController(title: "위치 정보 이용", message: "위치 서비스를 사용할 수 없습니다.\n디바이스의 '설정 > 개인정보 보호'에서\n위치 서비스를 먼저 켜주세요.", preferredStyle: .alert) + let requestLocationServiceAlert = UIAlertController(title: "위치 정보 이용", message: "'위치 서비스'를 사용할 수 없습니다.\n디바이스의 '설정 > 개인정보 보호'에서\n위치 서비스를 먼저 켜주세요.", preferredStyle: .alert) let cancel = UIAlertAction(title: "확인", style: .default) { [weak self] _ in self?.navigationController?.popViewController(animated: true) } From 4d6a8b3a841882197776d029ee5befa84295f2c6 Mon Sep 17 00:00:00 2001 From: SojinLee <513sojin@naver.com> Date: Mon, 11 Dec 2023 14:31:04 +0900 Subject: [PATCH 08/12] =?UTF-8?q?[Fix]=20#214=20-=20=EC=BD=94=EC=8A=A4=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20api=20=EC=88=98=EC=A0=95=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequestDto/CourseDrawingRequestDto.swift | 12 +++- .../Network/Router/CourseRouter.swift | 62 ++++++++++++++++--- .../CourseDrawing/VC/CourseDrawingVC.swift | 36 ++++++++--- 3 files changed, 93 insertions(+), 17 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/RequestDto/CourseDrawingRequestDto.swift b/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/RequestDto/CourseDrawingRequestDto.swift index c339f79c..e869f93a 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/RequestDto/CourseDrawingRequestDto.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/RequestDto/CourseDrawingRequestDto.swift @@ -11,9 +11,19 @@ import Foundation struct CourseDrawingRequestDto: Codable { let image: Data - let data: CourseDrawingRequestData + let path: [RNLocationModel] + let title: String + let distance: Float + let departureAddress, departureName: String } +//"image" : 이미지 파일, +// "path" : [{lat : 실수(double), long : 실수},{lat : 실수(double), long : 실수},{lat : 실수(double), long : 실수} ], +// "title" : "한강 공원 한 바퀴", +// "distance" : 4.4, +// "departureAddress" : "전북 익산시 삼성동 100", +// "departureName" : "보리의 집" + // MARK: - CourseDrawingRequestData struct CourseDrawingRequestData: Codable { diff --git a/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift b/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift index 3153a5b7..df3f6a92 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift @@ -66,17 +66,63 @@ extension CourseRouter: TargetType { var content = [String: Any]() var path = [[String: Any]]() + var tempPath = String() do { - for location in param.data.path { - let locationData = try location.asParameter() - path.append(locationData) +// for location in param.path { +// let locationData = try location.asParameter() +// path.append(locationData) +// } + +// + let jsonTempData = try JSONEncoder().encode(param.path) + var jsonArray = [[String: String]]() + + tempPath = "[" + if let jsonArrayData = try JSONSerialization.jsonObject(with: jsonTempData, options: []) as? [[String: Any]] { + for locationDict in jsonArrayData { + let lat = locationDict["lat"] as! Double + let long = locationDict["long"] as! Double + +// tempPath += #"{"lat" : "\#(lat)", "long" : "\#(long)"},"# + tempPath += """ + {"lat": "\(lat)", "long": "\(long)"}, + """ + } + tempPath.removeLast() } - - content["path"] = path - content["distance"] = param.data.distance - content["departureAddress"] = param.data.departureAddress - content["departureName"] = param.data.departureName + tempPath += "]" + +// tempPath = #"\#(tempPath)"# + + content["path"] = tempPath + +// if var path = content["path"] as? String { +// path = path.replacingOccurrences(of: #"\""#, with: "") +// content["path"] = path +// print(content["path"]) +// print(path) +// } + +// tempPath = tempPath.replacingOccurrences(of: "\\\"", with: "\"") +// + +// if let testJsonData = tempPath.data(using: .utf8), +// let jsonPathArray = try? JSONSerialization.jsonObject(with: testJsonData, options: []) as? [Any] { +// content["path"] = jsonPathArray +// } + +// content["path"] = tempPath + content["title"] = param.title + content["distance"] = param.distance + content["departureAddress"] = param.departureAddress + content["departureName"] = param.departureName + + print(tempPath) + + print("✅✅") + print(content) +// print(content["path"]) let jsonData = try JSONSerialization.data(withJSONObject: content) let formData = MultipartFormData(provider: .data(jsonData), name: "data", mimeType: "application/json") diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift index 2b154a26..05692eab 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift @@ -431,19 +431,30 @@ extension CourseDrawingVC { guard let imageData = image.jpegData(compressionQuality: 1.0) else { return nil } guard let departureLocationModel = self.departureLocationModel else { return nil } let path = mapView.getMarkersLatLng().map { $0.toRNLocationModel() } - let courseDrawingRequestData = CourseDrawingRequestData(path: path, - // title : self.courseName, - distance: self.distance, - departureAddress: departureLocationModel.departureAddress, - departureName: departureLocationModel.departureName) - let courseDrawingRequestDto = CourseDrawingRequestDto(image: imageData, data: courseDrawingRequestData) + let courseDrawingRequestDto = CourseDrawingRequestDto( + image: imageData, + path: path, + title: self.courseName, + distance: self.distance, + departureAddress: departureLocationModel.departureAddress, + departureName: departureLocationModel.departureName) + +// let courseDrawingRequestDto = CourseDrawingRequestDto( +// image: imageData, +// path: path, +// title: self.courseName, +// distance: 1.1, +// departureAddress: "성현마을 어쩌구", +// departureName: "어쩌구 저쩌구") return courseDrawingRequestDto } private func uploadCourseDrawing() { guard let requestDto = makecourseDrawingRequestDto() else { return } + print("🚨🚨🚨🚨🚨🚨") + print(requestDto) LoadingIndicator.showLoading() courseProvider.request(.uploadCourseDrawing(param: requestDto)) {[weak self] response in @@ -465,9 +476,18 @@ extension CourseDrawingVC { print("400 error") self.showNetworkFailureToast() } +// case .failure(let error): +// print(error.localizedDescription) +// self.showNetworkFailureToast() +// } case .failure(let error): - print(error.localizedDescription) - self.showNetworkFailureToast() + if let response = error.response { + if let responseData = String(data: response.data, encoding: .utf8) { + print(responseData) + } + } else { + print(error.localizedDescription) + } } } } From c8e7d77a1bf851a8b2c669a6a27c0db874259989 Mon Sep 17 00:00:00 2001 From: SojinLee <513sojin@naver.com> Date: Mon, 11 Dec 2023 20:13:29 +0900 Subject: [PATCH 09/12] =?UTF-8?q?[Fix]=20#214=20-=20=EC=BD=94=EC=8A=A4=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20api=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Utils/RNUtils/convertLocationObject.swift | 2 +- .../CourseDrawingModel/RNLocationModel.swift | 4 +- .../Network/Router/CourseRouter.swift | 56 ++----------------- 3 files changed, 9 insertions(+), 53 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/Utils/RNUtils/convertLocationObject.swift b/Runnect-iOS/Runnect-iOS/Global/Utils/RNUtils/convertLocationObject.swift index e06f2fe6..9d3be648 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Utils/RNUtils/convertLocationObject.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Utils/RNUtils/convertLocationObject.swift @@ -28,7 +28,7 @@ extension NMGLatLng { } func toRNLocationModel() -> RNLocationModel { - return RNLocationModel(lat: self.lat, long: self.lng) + return RNLocationModel(latitude: self.lat, longitude: self.lng) } } diff --git a/Runnect-iOS/Runnect-iOS/Network/Model/CourseDrawingModel/RNLocationModel.swift b/Runnect-iOS/Runnect-iOS/Network/Model/CourseDrawingModel/RNLocationModel.swift index 736e2712..449ef137 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Model/CourseDrawingModel/RNLocationModel.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Model/CourseDrawingModel/RNLocationModel.swift @@ -8,6 +8,6 @@ import Foundation struct RNLocationModel: Codable { - let lat: Double - let long: Double + let latitude: Double + let longitude: Double } diff --git a/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift b/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift index df3f6a92..8080844e 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Router/CourseRouter.swift @@ -29,7 +29,7 @@ extension CourseRouter: TargetType { var path: String { switch self { case .uploadCourseDrawing: - return "/course" + return "/course/v2" case .getAllPrivateCourse: return "/course/user" case .getPrivateCourseNotUploaded: @@ -69,63 +69,19 @@ extension CourseRouter: TargetType { var tempPath = String() do { -// for location in param.path { -// let locationData = try location.asParameter() -// path.append(locationData) -// } - -// - let jsonTempData = try JSONEncoder().encode(param.path) - var jsonArray = [[String: String]]() - - tempPath = "[" - if let jsonArrayData = try JSONSerialization.jsonObject(with: jsonTempData, options: []) as? [[String: Any]] { - for locationDict in jsonArrayData { - let lat = locationDict["lat"] as! Double - let long = locationDict["long"] as! Double - -// tempPath += #"{"lat" : "\#(lat)", "long" : "\#(long)"},"# - tempPath += """ - {"lat": "\(lat)", "long": "\(long)"}, - """ - } - tempPath.removeLast() + for location in param.path { + let locationData = try location.asParameter() + path.append(locationData) } - tempPath += "]" - -// tempPath = #"\#(tempPath)"# - - content["path"] = tempPath -// if var path = content["path"] as? String { -// path = path.replacingOccurrences(of: #"\""#, with: "") -// content["path"] = path -// print(content["path"]) -// print(path) -// } - -// tempPath = tempPath.replacingOccurrences(of: "\\\"", with: "\"") -// - -// if let testJsonData = tempPath.data(using: .utf8), -// let jsonPathArray = try? JSONSerialization.jsonObject(with: testJsonData, options: []) as? [Any] { -// content["path"] = jsonPathArray -// } - -// content["path"] = tempPath + content["path"] = path content["title"] = param.title content["distance"] = param.distance content["departureAddress"] = param.departureAddress content["departureName"] = param.departureName - print(tempPath) - - print("✅✅") - print(content) -// print(content["path"]) - let jsonData = try JSONSerialization.data(withJSONObject: content) - let formData = MultipartFormData(provider: .data(jsonData), name: "data", mimeType: "application/json") + let formData = MultipartFormData(provider: .data(jsonData), name: "courseCreateRequestDto", mimeType: "application/json") multipartFormData.append(formData) } catch { print(error.localizedDescription) From f8b76778ff7a6fca95221e03b4cd4023972b2cf7 Mon Sep 17 00:00:00 2001 From: SojinLee <513sojin@naver.com> Date: Fri, 15 Dec 2023 19:09:59 +0900 Subject: [PATCH 10/12] =?UTF-8?q?[Fix]=20#214=20-=20CourseDrawingResponseD?= =?UTF-8?q?ata=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ResponseDto/CourseDrawingResponseData.swift | 6 ------ .../CourseDrawing/VC/CourseDrawingVC.swift | 16 +--------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/ResponseDto/CourseDrawingResponseData.swift b/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/ResponseDto/CourseDrawingResponseData.swift index 66ec9ee9..a521079c 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/ResponseDto/CourseDrawingResponseData.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Dto/CourseDrawingDto/ResponseDto/CourseDrawingResponseData.swift @@ -10,12 +10,6 @@ import Foundation // MARK: - DataClass struct CourseDrawingResponseData: Codable { - let course: CourseDrawingResponse -} - -// MARK: - Course - -struct CourseDrawingResponse: Codable { let id: Int let createdAt: String } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift index 05692eab..b6435af8 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift @@ -440,21 +440,11 @@ extension CourseDrawingVC { departureAddress: departureLocationModel.departureAddress, departureName: departureLocationModel.departureName) -// let courseDrawingRequestDto = CourseDrawingRequestDto( -// image: imageData, -// path: path, -// title: self.courseName, -// distance: 1.1, -// departureAddress: "성현마을 어쩌구", -// departureName: "어쩌구 저쩌구") - return courseDrawingRequestDto } private func uploadCourseDrawing() { guard let requestDto = makecourseDrawingRequestDto() else { return } - print("🚨🚨🚨🚨🚨🚨") - print(requestDto) LoadingIndicator.showLoading() courseProvider.request(.uploadCourseDrawing(param: requestDto)) {[weak self] response in @@ -467,7 +457,7 @@ extension CourseDrawingVC { do { let responseDto = try result.map(BaseResponse.self) guard let data = responseDto.data else { return } - self.presentAlertVC(courseId: data.course.id) + self.presentAlertVC(courseId: data.id) } catch { print(error.localizedDescription) } @@ -476,10 +466,6 @@ extension CourseDrawingVC { print("400 error") self.showNetworkFailureToast() } -// case .failure(let error): -// print(error.localizedDescription) -// self.showNetworkFailureToast() -// } case .failure(let error): if let response = error.response { if let responseData = String(data: response.data, encoding: .utf8) { From 5981673e58a53fbc8e36d9fc2f675b6d69661499 Mon Sep 17 00:00:00 2001 From: 513sojin <513sojin@naver.com> Date: Fri, 15 Dec 2023 19:30:36 +0900 Subject: [PATCH 11/12] =?UTF-8?q?[Fix]=20#214=20-=20=EC=84=9C=EB=B2=84=20?= =?UTF-8?q?=ED=86=B5=EC=8B=A0=20=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runnect-iOS/Network/Service/NetworkProvider.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Network/Service/NetworkProvider.swift b/Runnect-iOS/Runnect-iOS/Network/Service/NetworkProvider.swift index 86beae44..77c7a813 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Service/NetworkProvider.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Service/NetworkProvider.swift @@ -7,19 +7,15 @@ import Moya -enum ResponseResult { - case success(T) -} - class NetworkProvider : MoyaProvider { - func request(target : Provider, instance : Model.Type , vc: UIViewController, completion : @escaping(ResponseResult) -> ()){ + func request(target : Provider, instance : Model.Type , vc: UIViewController, completion : @escaping(Model) -> ()){ self.request(target) { result in switch result { /// 서버 통신 성공 case .success(let response): if (200..<300).contains(response.statusCode) { if let decodeData = try? JSONDecoder().decode(instance, from: response.data) { - completion(.success(decodeData)) + completion(decodeData) } else{ /// decoding error vc.showNetworkFailureToast() From 0ca4fd681df0e4fcab604a51262975a71a13122e Mon Sep 17 00:00:00 2001 From: 513sojin <513sojin@naver.com> Date: Fri, 15 Dec 2023 19:31:08 +0900 Subject: [PATCH 12/12] =?UTF-8?q?[Fix]=20#214=20-=20=EC=BD=94=EC=8A=A4=20?= =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EA=B8=B0=20api=20=EC=97=B0=EA=B2=B0=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseDrawing/VC/CourseDrawingVC.swift | 71 +++---------------- 1 file changed, 8 insertions(+), 63 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift index 3a3f400d..f27edc7d 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift @@ -13,11 +13,8 @@ import Moya final class CourseDrawingVC: UIViewController { // MARK: - Properties - - private let courseProvider = Providers.courseProvider - private let departureSearchingProvider = Providers.departureSearchingProvider - - private let networkProvider = NetworkProvider(withAuth: false) + private let departureSearchingProvider = NetworkProvider(withAuth: false) + private let courseProvider = NetworkProvider(withAuth: true) private var departureLocationModel: DepartureLocationModel? @@ -196,8 +193,8 @@ extension CourseDrawingVC { mapView.eventSubject.sink { [weak self] arr in guard let self = self else { return } -// self.searchLocationTmapAddress(latitude: arr[0], longitude: arr[1]) - self.searchTest(latitude: arr[0], longitude: arr[1]) + self.searchLocationTmapAddress(latitude: arr[0], longitude: arr[1]) +// self.searchTest(latitude: arr[0], longitude: arr[1]) }.store(in: cancelBag) } @@ -450,68 +447,16 @@ extension CourseDrawingVC { guard let requestDto = makecourseDrawingRequestDto() else { return } LoadingIndicator.showLoading() - courseProvider.request(.uploadCourseDrawing(param: requestDto)) {[weak self] response in - guard let self = self else { return } + courseProvider.request(target: .uploadCourseDrawing(param: requestDto), instance: BaseResponse.self, vc: self) { response in LoadingIndicator.hideLoading() - switch response { - case .success(let result): - let status = result.statusCode - if 200..<300 ~= status { - do { - let responseDto = try result.map(BaseResponse.self) - guard let data = responseDto.data else { return } - self.presentAlertVC(courseId: data.id) - } catch { - print(error.localizedDescription) - } - } - if status >= 400 { - print("400 error") - self.showNetworkFailureToast() - } - case .failure(let error): - if let response = error.response { - if let responseData = String(data: response.data, encoding: .utf8) { - print(responseData) - } - } else { - print(error.localizedDescription) - } - } + guard let data = response.data else { return } + self.presentAlertVC(courseId: data.id) } } private func searchLocationTmapAddress(latitude: Double, longitude: Double) { - departureSearchingProvider - .request(.getLocationTmapAddress(latitude: latitude, longitude: longitude)) { [weak self] response in - guard let self = self else { return } - switch response { - case .success(let result): - let status = result.statusCode - if 200..<300 ~= status { - do { - let responseDto = try result.map(TmapAddressSearchingResponseDto.self) - self.updateData(model: responseDto.toDepartureLocationModel(latitude: latitude, longitude: longitude)) - } catch { - print(error.localizedDescription) - } - } - if status >= 400 { - print("400 error") - } - case .failure(let error): - print(error.localizedDescription) - self.showToast(message: "네트워크 통신 실패") - } - } - } - - private func searchTest(latitude: Double, longitude: Double) { - networkProvider.request(target: .getLocationTmapAddress(latitude: latitude, longitude: longitude), instance: TmapAddressSearchingResponseDto.self, vc: self) { result in - switch result { - case .success(let data): + departureSearchingProvider.request(target: .getLocationTmapAddress(latitude: latitude, longitude: longitude), instance: TmapAddressSearchingResponseDto.self, vc: self) { data in self.updateData(model: data.toDepartureLocationModel(latitude: latitude, longitude: longitude)) - } } } }