Skip to content

Commit

Permalink
[Feat] #319 - 주소 데이터 바인딩
Browse files Browse the repository at this point in the history
  • Loading branch information
EunsuSeo01 committed Dec 30, 2024
1 parent 74671ed commit 5c8f7c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import NMapsMap

final class DetailMapView: BaseView {

// MARK: - Properties
// MARK: - UI Components

private let mapView: NMFMapView = NMFMapView()
Expand Down Expand Up @@ -104,12 +103,12 @@ final class DetailMapView: BaseView {
)
}

// TODO: - 위경도 값으로 주소 불러와야 함
addressLabel.do {
$0.attributedText = UILabel.setupAttributedText(
for: PretendardStyle.caption4,
color: .gray700
)
$0.numberOfLines = 2
}

copyButton.do {
Expand All @@ -129,8 +128,8 @@ final class DetailMapView: BaseView {

extension DetailMapView {

func bindData(latitude: Double, longitude: Double) {
addressLabel.text = "\(latitude) \(longitude)"
func bindData(latitude: Double, longitude: Double, address: String) {
addressLabel.text = address
addMapMarker(latitude: latitude, longitude: longitude)
moveMapCamera(latitude: latitude, longitude: longitude)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ private extension HankkiDetailViewController {
heartCount: String(data.heartCount),
isLiked: data.isLiked
)
detailMapView.bindData(latitude: data.latitude, longitude: data.longitude)
detailMapView.bindData(
latitude: data.latitude,
longitude: data.longitude,
address: viewModel.address ?? "-"
)

menuCollectionView.collectionView.reloadData()
}
Expand Down

0 comments on commit 5c8f7c9

Please sign in to comment.