Skip to content

Commit

Permalink
[Design] NearMapView InformationView 세브론UI 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
MUKER-WON committed May 9, 2024
1 parent 2a0cf9f commit 70dad13
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
),
])
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -154,7 +154,7 @@ extension NearMapViewModel {
}

extension NearMapViewModel {
private enum NearMapMode {
enum NearMapMode {
case normal, focused(busStopId: String)
}
}

0 comments on commit 70dad13

Please sign in to comment.