From 84c61b043dbd7680b416a62134736a99b2953e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=AE=E1=84=86?= =?UTF-8?q?=E1=85=B5=E1=86=AB?= Date: Thu, 3 Mar 2022 22:21:53 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A8[FIX]=20#129=20-=20SplashViewCo?= =?UTF-8?q?ntroller=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SplashViewController/SplashViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/SplashViewController/SplashViewController.swift b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/SplashViewController/SplashViewController.swift index 03f07bc..34f07b4 100644 --- a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/SplashViewController/SplashViewController.swift +++ b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/SplashViewController/SplashViewController.swift @@ -52,7 +52,7 @@ extension SplashViewController { } private func presentToOnboarding() { - let onboardingNavigationController = UINavigationController(rootViewController: OnboardingFirstViewController()) + let onboardingNavigationController = UINavigationController(rootViewController: OnboardingViewController()) onboardingNavigationController.modalPresentationStyle = .fullScreen onboardingNavigationController.modalTransitionStyle = .crossDissolve self.present(onboardingNavigationController, animated: true, completion: nil) From 914c13e15a27c85bb8e7255662f32ed3c2d17f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=AE=E1=84=86?= =?UTF-8?q?=E1=85=B5=E1=86=AB?= Date: Thu, 3 Mar 2022 23:22:41 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=94=A8[FIX]=20#129=20-=20=ED=98=84?= =?UTF-8?q?=EC=83=81=EC=86=8C=20=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=ED=81=B4=EB=A6=AD=20=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StudioMapViewController.swift | 97 ++++++++++++------- 1 file changed, 61 insertions(+), 36 deletions(-) diff --git a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift index 06082ba..756a83e 100644 --- a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift +++ b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift @@ -86,16 +86,12 @@ class StudioMapViewController: UIViewController { layoutMyLocationButton() layoutSearchView() layoutNavigaionBar() + getBottomSheetInfo() totalStudioWithAPI() setLatLngNotification() - showtmpStudioMarker() + tmpSetupMarker() setupBottomSheetUI() setupBottomSheetGestureRecognizer() - getBottomSheetInfo() - } - - override func viewDidAppear(_ animated: Bool) { - getBottomSheetInfo() } // MARK: - init @@ -113,26 +109,55 @@ class StudioMapViewController: UIViewController { extension StudioMapViewController { /// 서버 부활되기 전까지 현상소 관련 기능 테스트할 임시 함수 (네이버 그린팩토리에 현상소 표시해줌) - func showtmpStudioMarker() { + func tmpSetupMarker() { let markertmp = NMFMarker(position: NMGLatLng(lat: 37.35940010181669, lng: 127.10475679570187)) markertmp.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) markertmp.mapView = self.mapView.mapView - /// 클릭 시 이벤트 설정 - markertmp.touchHandler = { [weak self] (overlay: NMFOverlay) -> Bool in - if self?.clickCount == 1 { /// 이미 마커가 클릭된 경우 (중복 클릭 허용안함) - self?.clickCount = 0 - markertmp.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) - self?.hideBottomSheetAndGoBack() + let secondMarkertmp = NMFMarker(position: NMGLatLng(lat: 37.36161841308457, lng: 127.10566240106306)) + secondMarkertmp.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + secondMarkertmp.mapView = self.mapView.mapView + + secondMarkertmp.touchHandler = { [weak self] (overlay: NMFOverlay) -> Bool in + if self?.selectedMarker == nil { /// 클릭했던 현상소가 없는 경우 (지도뷰 처음 들어올 떄) + self?.selectedMarker = secondMarkertmp + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) + self?.showBottomSheet() } else { - self?.clickCount = 1 - markertmp.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) + if self?.selectedMarker == secondMarkertmp { /// 클릭했던 현상소를 다시 클릭하는 경우 + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self?.hideBottomSheetAndGoBack() + } else { /// 다른 현상소 클릭 + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self?.selectedMarker = secondMarkertmp + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) + self?.showBottomSheet() + } + } + return true + } + + markertmp.touchHandler = { [weak self] (overlay: NMFOverlay) -> Bool in + if self?.selectedMarker == nil { /// 클릭했던 현상소가 없는 경우 (지도뷰 처음 들어올 떄) + self?.selectedMarker = markertmp + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) self?.showBottomSheet() + } else { + if self?.selectedMarker == markertmp { /// 클릭했던 현상소를 다시 클릭하는 경우 + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self?.selectedMarker = nil + self?.hideBottomSheetAndGoBack() + } else { /// 다른 현상소 클릭 + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self?.selectedMarker = markertmp + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) + self?.showBottomSheet() + } } return true } } - + private func setUpMapView() { view.addSubview(mapView) let locationOverlay = mapView.mapView.locationOverlay @@ -157,16 +182,26 @@ extension StudioMapViewController { marker.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) marker.touchHandler = { [weak self] (overlay: NMFOverlay) -> Bool in - if self?.clickCount == 1 { /// 이미 마커가 클릭된 경우 (중복 클릭 허용안함) - self?.clickCount = 0 - self?.hideBottomSheetAndGoBack() - marker.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) - } else { - self?.clickCount = 1 + if self?.selectedMarker == nil { /// 클릭했던 현상소가 없는 경우 (지도뷰 처음 들어올 떄) self?.selectedMarker = marker + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) + self?.showBottomSheet() self?.selectedMarkerInfo = markerInfo StudioMapViewController.selectedMarkerID = markerInfo.id self?.studioInfoWithAPI(studioID: markerInfo.id) + // TODO: - 카메라 이동 (통신 필요) + } else { + if self?.selectedMarker == marker { /// 클릭했던 현상소를 다시 클릭하는 경우 + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self?.selectedMarker = nil + self?.hideBottomSheetAndGoBack() + } else { /// 다른 현상소 클릭 + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self?.selectedMarker = marker + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) + self?.showBottomSheet() + // TODO: - 카메라 이동 (통신 필요) + } } return true } @@ -177,9 +212,9 @@ extension StudioMapViewController { func getBottomSheetInfo() { StudioMapViewController.name = "필린 현상소" StudioMapViewController.address = "솝트시 앱잼구 필린동 아요로 12번길 13" - StudioMapViewController.time = "open 10:00-21:00" + StudioMapViewController.time = "open 00:00-24:00" StudioMapViewController.tel = "010-1234-5678" - StudioMapViewController.price = "컬러 5000원" + StudioMapViewController.price = "컬러 5000000000원" StudioMapViewController.site = "" // StudioMapViewController.name = self.serverStudioInfo?.studio.name @@ -264,12 +299,6 @@ extension StudioMapViewController { newVC.modalPresentationStyle = .fullScreen self.present(newVC, animated: true, completion: nil) } - - @objc func changeMarkerObserver(_ notification: Notification) { - selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnPlaceBig.image) - selectedMarker = nil - clickCount = 0 - } @objc func touchLocationButton(_ sender: UIButton) { sender.isSelected = !sender.isSelected @@ -444,6 +473,8 @@ extension StudioMapViewController { func hideBottomSheetAndGoBack() { let safeAreaHeight = view.safeAreaLayoutGuide.layoutFrame.height let bottomPadding = view.safeAreaInsets.bottom + self.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self.selectedMarker = nil bottomSheetViewTopConstraint.constant = safeAreaHeight + bottomPadding UIView.animate(withDuration: 0.2, delay: 0, options: .curveEaseOut, animations: { self.view.layoutIfNeeded() @@ -455,10 +486,6 @@ extension StudioMapViewController { else { return number } return nearestVal } - - func setNotification() { - NotificationCenter.default.post(name: NSNotification.Name.changeMarker, object: nil, userInfo: nil) - } func changeScrollEnabled() { let contentVC = children.first as? StudioMapContentViewController @@ -495,7 +522,6 @@ extension StudioMapViewController { } case .ended: if velocity.y > 1500 { - setNotification() hideBottomSheetAndGoBack() return } @@ -508,7 +534,6 @@ extension StudioMapViewController { } else if nearestValue == defaultPadding { showBottomSheet(atState: .normal) } else { - setNotification() hideBottomSheetAndGoBack() } default: From f945bbf8201c5d5fc733cf177a0b2443d3985527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=B5=E1=86=B7=E1=84=8C=E1=85=AE=E1=84=86?= =?UTF-8?q?=E1=85=B5=E1=86=AB?= Date: Thu, 3 Mar 2022 23:44:05 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A8[FIX]=20#129=20-=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=9C=EC=84=9C=20=EB=B3=80=EA=B2=BD,=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StudioMapViewController.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift index 756a83e..aeb253e 100644 --- a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift +++ b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapViewController/StudioMapViewController.swift @@ -181,26 +181,25 @@ extension StudioMapViewController { let markerInfo = Studio(id: $0.id, lati: $0.lati, long: $0.long) marker.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) + self.selectedMarkerInfo = markerInfo + StudioMapViewController.selectedMarkerID = markerInfo.id + self.studioInfoWithAPI(studioID: markerInfo.id) + marker.touchHandler = { [weak self] (overlay: NMFOverlay) -> Bool in if self?.selectedMarker == nil { /// 클릭했던 현상소가 없는 경우 (지도뷰 처음 들어올 떄) self?.selectedMarker = marker self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) self?.showBottomSheet() - self?.selectedMarkerInfo = markerInfo - StudioMapViewController.selectedMarkerID = markerInfo.id - self?.studioInfoWithAPI(studioID: markerInfo.id) - // TODO: - 카메라 이동 (통신 필요) } else { if self?.selectedMarker == marker { /// 클릭했던 현상소를 다시 클릭하는 경우 - self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) self?.selectedMarker = nil + self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) self?.hideBottomSheetAndGoBack() } else { /// 다른 현상소 클릭 self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudio.image) self?.selectedMarker = marker self?.selectedMarker?.iconImage = NMFOverlayImage(image: Asset.icnStudioSelected.image) self?.showBottomSheet() - // TODO: - 카메라 이동 (통신 필요) } } return true