From 82075efecc4833372fe67a64d1176dd3510f3b63 Mon Sep 17 00:00:00 2001 From: Mijin Jeon Date: Wed, 6 Mar 2019 00:32:42 +0900 Subject: [PATCH] Feat: Location search and show markers #71 - Show markers (within 2km nearby marts) but takes 10 sec or more - Add ErrorAlertMessage for message of UIAlertController --- MartHoliday/MartHoliday.xcodeproj/project.pbxproj | 6 +++++- MartHoliday/MartHoliday/Utility/Extensions.swift | 7 +++++++ MartHoliday/MartHoliday/Utility/Keywords.swift | 4 ++++ .../ViewController/LocationSearchViewController.swift | 4 ++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/MartHoliday/MartHoliday.xcodeproj/project.pbxproj b/MartHoliday/MartHoliday.xcodeproj/project.pbxproj index 956c94f..b78a124 100644 --- a/MartHoliday/MartHoliday.xcodeproj/project.pbxproj +++ b/MartHoliday/MartHoliday.xcodeproj/project.pbxproj @@ -31,7 +31,7 @@ FD2E513B2171E059006E15A6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = FDB26C5D2170711400313A02 /* InfoPlist.strings */; }; FD3B64242121BEAA003C1332 /* ApiGatewayMac.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD3B64232121BEAA003C1332 /* ApiGatewayMac.framework */; }; FD3B64252121BEAA003C1332 /* ApiGatewayMac.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FD3B64232121BEAA003C1332 /* ApiGatewayMac.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - FD3B64292121BEDD003C1332 /* NMapViewerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD3B64282121BEDD003C1332 /* NMapViewerSDK.framework */; }; + FD3B64292121BEDD003C1332 /* NMapViewerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD3B64282121BEDD003C1332 /* NMapViewerSDK.framework */; settings = {ATTRIBUTES = (Required, ); }; }; FD3B642F2122A4FF003C1332 /* NMapViewResources.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD3B642E2122A4FF003C1332 /* NMapViewResources.swift */; }; FD4850F2212843FB0064747A /* SlideMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4850F1212843FB0064747A /* SlideMenuView.swift */; }; FD4850F4212869AF0064747A /* SlideMenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD4850F3212869AF0064747A /* SlideMenuCell.swift */; }; @@ -70,6 +70,7 @@ FD9654D1217259D800C17D76 /* IndicatorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9654D0217259D800C17D76 /* IndicatorViewController.swift */; }; FD9F409C211EBFAF007D7F1B /* BranchRawData.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9F409B211EBFAF007D7F1B /* BranchRawData.swift */; }; FD9F40A0211EC5EA007D7F1B /* Mart.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9F409F211EC5EA007D7F1B /* Mart.swift */; }; + FDA27AF3222E624800610B09 /* POIData.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA27AF2222E624800610B09 /* POIData.swift */; }; FDA311A9214C141800A7E94B /* BranchRawData.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9F409B211EBFAF007D7F1B /* BranchRawData.swift */; }; FDA311B2214C14CA00A7E94B /* StarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD86712221458FCB00273B3C /* StarButton.swift */; }; FDA311B5214C150100A7E94B /* Mart.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9F409F211EC5EA007D7F1B /* Mart.swift */; }; @@ -215,6 +216,7 @@ FD9654D0217259D800C17D76 /* IndicatorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IndicatorViewController.swift; sourceTree = ""; }; FD9F409B211EBFAF007D7F1B /* BranchRawData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BranchRawData.swift; sourceTree = ""; }; FD9F409F211EC5EA007D7F1B /* Mart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mart.swift; sourceTree = ""; }; + FDA27AF2222E624800610B09 /* POIData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = POIData.swift; sourceTree = ""; }; FDAF601B21273E880006B68A /* NanumSquareRoundOTFL.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = NanumSquareRoundOTFL.otf; sourceTree = ""; }; FDAF601C21273E880006B68A /* NanumSquareRoundOTFB.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = NanumSquareRoundOTFB.otf; sourceTree = ""; }; FDAF601D21273E880006B68A /* NanumSquareRoundOTFR.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = NanumSquareRoundOTFR.otf; sourceTree = ""; }; @@ -372,6 +374,7 @@ FD9F40A1211ECAE2007D7F1B /* Model */ = { isa = PBXGroup; children = ( + FDA27AF2222E624800610B09 /* POIData.swift */, FD9F409F211EC5EA007D7F1B /* Mart.swift */, FD780D76212F185600B569B3 /* SlideMenuManager.swift */, FD228F372142EB1A0062B75F /* BranchList.swift */, @@ -753,6 +756,7 @@ FDC3461D2136708400F6D6FF /* AddressDatum.swift in Sources */, FD7087DF216B427700A2A16F /* FavoriteData.swift in Sources */, FDB4BE24211D6BAD00D3B264 /* MartSelectViewController.swift in Sources */, + FDA27AF3222E624800610B09 /* POIData.swift in Sources */, FDF8ABC4215B76B400DA74C9 /* MainTableViewHeader.swift in Sources */, FD1B4F232126BBD200946311 /* SlideTopView.swift in Sources */, FDC5A7432167CD66009F0B0C /* TodayViewController.swift in Sources */, diff --git a/MartHoliday/MartHoliday/Utility/Extensions.swift b/MartHoliday/MartHoliday/Utility/Extensions.swift index c069c47..f57e23e 100644 --- a/MartHoliday/MartHoliday/Utility/Extensions.swift +++ b/MartHoliday/MartHoliday/Utility/Extensions.swift @@ -52,6 +52,13 @@ extension UIAlertController { return alert } + class func locationErrorAlert() -> UIAlertController { + let alert = UIAlertController(title: ErrorAlertMessage.disableNearbyMarts.title, + message: ErrorAlertMessage.disableNearbyMarts.body, + preferredStyle: .alert) + return alert + } + } extension UIColor { diff --git a/MartHoliday/MartHoliday/Utility/Keywords.swift b/MartHoliday/MartHoliday/Utility/Keywords.swift index 768a61f..93938cc 100644 --- a/MartHoliday/MartHoliday/Utility/Keywords.swift +++ b/MartHoliday/MartHoliday/Utility/Keywords.swift @@ -30,3 +30,7 @@ enum ProgramDescription: String { case sorryErrorTitle = "죄송합니다😰" case networkTimeoutMsg = "서버에 문제가 발생했습니다.\n잠시 후 다시 시도해주세요." } + +struct ErrorAlertMessage { + static let disableNearbyMarts = (title:"위치 검색", body: "마트 위치검색에 문제가 발생했습니다.\n잠시 후 다시 시도해주세요.") +} diff --git a/MartHoliday/MartHoliday/ViewController/LocationSearchViewController.swift b/MartHoliday/MartHoliday/ViewController/LocationSearchViewController.swift index f0b9a2e..63d7854 100644 --- a/MartHoliday/MartHoliday/ViewController/LocationSearchViewController.swift +++ b/MartHoliday/MartHoliday/ViewController/LocationSearchViewController.swift @@ -60,7 +60,7 @@ class LocationSearchViewController: IndicatorViewController, NMapPOIdataOverlayD mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight] - currentState = .tracking +// currentState = .tracking locationTrackingStateButton = setLocationTrackingButton() enableLocationUpdate() @@ -193,7 +193,7 @@ class LocationSearchViewController: IndicatorViewController, NMapPOIdataOverlayD mapView?.setMapCenter(userLocation) // self.fetchNearMarts(from: userLocation) // self.flag = false - self.toggleTrackingMode() +// self.toggleTrackingMode() self.userLocation = userLocation }