From 70dad13613e4cbd2803078aa0f23f6168fff5135 Mon Sep 17 00:00:00 2001 From: MUKER-WON Date: Thu, 9 May 2024 17:16:41 +0900 Subject: [PATCH] =?UTF-8?q?[Design]=20NearMapView=20InformationView=20?= =?UTF-8?q?=EC=84=B8=EB=B8=8C=EB=A1=A0UI=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NearMapViewController.swift | 43 ++++++++++++++++++- .../Sources/ViewModel/NearMapViewModel.swift | 4 +- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/Projects/Feature/NearMapFeature/Sources/ViewController/NearMapViewController.swift b/Projects/Feature/NearMapFeature/Sources/ViewController/NearMapViewController.swift index f63d1856..c6f87151 100644 --- a/Projects/Feature/NearMapFeature/Sources/ViewController/NearMapViewController.swift +++ b/Projects/Feature/NearMapFeature/Sources/ViewController/NearMapViewController.swift @@ -44,6 +44,26 @@ public final class NearMapViewController: UIViewController { return view }() + private lazy var busStopInformationViewChevron: UIImageView = { + let configuration = UIImage.SymbolConfiguration( + pointSize: 16, + weight: .regular + ) + let image = UIImage( + systemName: "chevron.right", + withConfiguration: configuration + ) + var view = UIImageView(image: image) + view.tintColor = DesignSystemAsset.remainingColor.color + switch self.viewModel.viewMode { + case .normal: + break + case .focused(let busStopId): + view.isHidden = true + } + return view + }() + init(viewModel: NearMapViewModel) { self.viewModel = viewModel super.init( @@ -87,7 +107,11 @@ public final class NearMapViewController: UIViewController { private func configureUI() { view.backgroundColor = DesignSystemAsset.cellColor.color - [busStopInformationView, naverMap].forEach { + [ + busStopInformationView, + naverMap, + busStopInformationViewChevron + ].forEach { view.addSubview($0) $0.translatesAutoresizingMaskIntoConstraints = false } @@ -126,6 +150,15 @@ public final class NearMapViewController: UIViewController { equalTo: busStopInformationView.topAnchor, constant: -10 ), + + busStopInformationViewChevron.centerYAnchor.constraint( + equalTo: busStopInformationView.centerYAnchor, + constant: 10 + ), + busStopInformationViewChevron.trailingAnchor.constraint( + equalTo: busStopInformationView.trailingAnchor, + constant: -10 + ), ]) } @@ -148,7 +181,13 @@ public final class NearMapViewController: UIViewController { .withUnretained(self) .subscribe( onNext: { vc, tuple in - let (response, distance) = tuple + var (response, distance) = tuple + switch vc.viewModel.viewMode { + case .normal: + break + case .focused(let busStopId): + distance = "알수없음" + } vc.busStopInformationView.updateUI( response: response, distance: distance diff --git a/Projects/Feature/NearMapFeature/Sources/ViewModel/NearMapViewModel.swift b/Projects/Feature/NearMapFeature/Sources/ViewModel/NearMapViewModel.swift index 2be4ecc9..2b07701a 100644 --- a/Projects/Feature/NearMapFeature/Sources/ViewModel/NearMapViewModel.swift +++ b/Projects/Feature/NearMapFeature/Sources/ViewModel/NearMapViewModel.swift @@ -12,7 +12,7 @@ import NMapsMap public final class NearMapViewModel: LeafMarkerUpdater, ViewModel { @Injected(NearMapUseCase.self) var useCase: NearMapUseCase private let coordinator: NearMapCoordinator - private let viewMode: NearMapMode + private(set) var viewMode: NearMapMode private let disposeBag = DisposeBag() @@ -154,7 +154,7 @@ extension NearMapViewModel { } extension NearMapViewModel { - private enum NearMapMode { + enum NearMapMode { case normal, focused(busStopId: String) } }