Skip to content

Commit

Permalink
Merge pull request #305 from Team-Hankki/hotfix/#304
Browse files Browse the repository at this point in the history
[Hotfix] #304 - error hotfix
  • Loading branch information
mcrkgus authored Nov 27, 2024
2 parents a2c4148 + b0229e4 commit a4522b5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 28 deletions.
9 changes: 4 additions & 5 deletions Hankkijogbo/Hankkijogbo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,6 @@
A240EA242C412759000FF458 /* UICollectionView+.swift in Sources */,
86880C1C2C47A0DC00CAEF58 /* SplashViewController.swift in Sources */,
8336B5222CBACDC90034474E /* NetworkResultDelegate.swift in Sources */,
864FA90E2C3D20FF0051EA36 /* MypageZipCollectionViewCell.swift in Sources */,
8302855B2C4565A90004D9F7 /* GetHankkiListResponseDTO.swift in Sources */,
83DBED962C2564AC0042BA48 /* HomeViewController.swift in Sources */,
A2EC33B72C4716A000809840 /* ReportAPIService.swift in Sources */,
Expand Down Expand Up @@ -2187,7 +2186,7 @@
CODE_SIGN_ENTITLEMENTS = Hankkijogbo/Hankkijogbo.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2024112401;
DEVELOPMENT_TEAM = KT2Q6HC762;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -2205,7 +2204,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = shop.hankki.dev.hankki;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -2226,7 +2225,7 @@
CODE_SIGN_ENTITLEMENTS = Hankkijogbo/Hankkijogbo.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2024112401;
DEVELOPMENT_TEAM = KT2Q6HC762;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -2244,7 +2243,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = shop.hankki.dev.hankki;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ extension HomeViewController: CLLocationManagerDelegate {
self.rootView.targetButton.isHidden = false
UIView.animate(withDuration: 0.3, delay: 0, options: .curveLinear, animations: {
self.rootView.targetButton.snp.remakeConstraints {
$0.bottom.equalTo(self.markerInfoCardView!.snp.top).offset(-12)
$0.trailing.equalToSuperview().inset(22)
$0.bottom.equalTo(self.markerInfoCardView!.snp.top).offset(-10)
$0.trailing.equalToSuperview().inset(12)
}
self.view.layoutIfNeeded()
})
Expand All @@ -144,12 +144,12 @@ extension HomeViewController: CLLocationManagerDelegate {
func showTargetButtonAtBottomSheet() {
self.rootView.targetButton.isHidden = false
UIView.animate(withDuration: 0.3, delay: 0, options: .curveLinear, animations: {
if self.rootView.bottomSheetView.isExpanded {
if self.rootView.bottomSheetView.isExpanded && self.rootView.bottomSheetView.isBottomSheetUp {
self.rootView.targetButton.isHidden = true
} else {
self.rootView.targetButton.snp.remakeConstraints {
$0.bottom.equalTo(self.rootView.bottomSheetView.snp.top).offset(-12)
$0.trailing.equalToSuperview().inset(22)
$0.bottom.equalTo(self.rootView.bottomSheetView.snp.top).offset(-10)
$0.trailing.equalToSuperview().inset(12)
}
}
self.view.layoutIfNeeded()
Expand Down Expand Up @@ -180,20 +180,21 @@ extension HomeViewController {
self?.rootView.mapView.moveCamera(NMFCameraUpdate(scrollTo: initialPosition, zoomTo: 14.0))
}

self?.clearMarkers()

for (index, location) in markers.enumerated() {
let marker = NMFMarker()
marker.iconImage = NMFOverlayImage(image: .icPin)
marker.position = NMGLatLng(lat: location.latitude, lng: location.longitude)
marker.mapView = self?.rootView.mapView
marker.touchHandler = { [weak self] _ in
self?.rootView.bottomSheetView.viewLayoutIfNeededWithHiddenAnimation()
self?.showMarkerInfoCard(at: index, pinId: location.id)
return true
}
self?.markers.append(marker)
}
self?.setupPosition(with: markers)
// self?.clearMarkers()
//
// for (index, location) in markers.enumerated() {
// let marker = NMFMarker()
// marker.iconImage = NMFOverlayImage(image: .icPin)
// marker.position = NMGLatLng(lat: location.latitude, lng: location.longitude)
// marker.mapView = self?.rootView.mapView
// marker.touchHandler = { [weak self] _ in
// self?.rootView.bottomSheetView.viewLayoutIfNeededWithHiddenAnimation()
// self?.showMarkerInfoCard(at: index, pinId: location.id)
// return true
// }
// self?.markers.append(marker)
// }
})
}

Expand Down Expand Up @@ -221,6 +222,16 @@ extension HomeViewController {
}
}

// 선택된 식당 핀만 노출
private func setupSelectPosition(latitude: Double, longitude: Double) {
clearMarkers()
let marker = NMFMarker()
marker.iconImage = NMFOverlayImage(image: .icPin)
marker.position = NMGLatLng(lat: latitude, lng: longitude)
marker.mapView = rootView.mapView
markers.append(marker)
}

// 지도 핀 삭제
private func clearMarkers() {
markers.forEach { $0.mapView = nil }
Expand All @@ -232,6 +243,10 @@ extension HomeViewController {
guard selectedMarkerIndex != index else { return }
selectedMarkerIndex = index

if let location = hankkiPins.first(where: { $0.id == pinId }) {
setupSelectPosition(latitude: location.latitude, longitude: location.longitude)
}

if markerInfoCardView == nil {
markerInfoCardView = MarkerInfoCardView()
view.addSubview(markerInfoCardView!)
Expand Down Expand Up @@ -274,6 +289,10 @@ extension HomeViewController {
self.markerInfoCardView?.removeFromSuperview()
self.markerInfoCardView = nil
self.selectedMarkerIndex = nil

// 전체 지도 핀 복원
self.clearMarkers()
self.setupPosition(with: self.hankkiPins)
})
self.showTargetButtonAtBottomSheet()
}
Expand Down
2 changes: 1 addition & 1 deletion Hankkijogbo/Hankkijogbo/Present/Home/View/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final class HomeView: BaseView {
[typeButton, priceButton, sortButton].forEach { $0.snp.makeConstraints { $0.height.equalTo(32)} }

targetButton.snp.makeConstraints {
if bottomSheetView.isExpanded {
if bottomSheetView.isExpanded && bottomSheetView.isBottomSheetUp {
targetButton.isHidden = true
} else {
$0.bottom.equalTo(bottomSheetView.snp.top).offset(-10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ private extension HomeViewController {
viewModel.updateHankkiList()

rootView.bottomSheetView.totalListCollectionView.reloadData()
hideMarkerInfoCard()
}

func handleHankkiListResult(success: Bool, isEmpty: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ extension MypageViewController {
case .option:
switch itemIndex {
case 0:
if let url = URL(string: StringLiterals.ExternalLink.Terms) {
if let url = URL(string: StringLiterals.ExternalLink.OneonOne) {
UIApplication.shared.open(url, options: [:])
}
case 1:
if let url = URL(string: StringLiterals.ExternalLink.OneonOne) {
if let url = URL(string: StringLiterals.ExternalLink.Terms) {
UIApplication.shared.open(url, options: [:])
}
case 2:
Expand Down

0 comments on commit a4522b5

Please sign in to comment.