Skip to content

Commit 6f12562

Browse files
committed
[#234] NaverMap API 연결
1 parent 53ccbe4 commit 6f12562

19 files changed

+140
-39
lines changed

EATSSU/App/Sources/Presentation/Auth/ViewController/SetNickNameViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ final class SetNickNameViewController: BaseViewController {
4747
}
4848
}
4949

50-
override func setCustomNavigationBar() {
51-
super.setCustomNavigationBar()
50+
override func setESNavigationBar() {
51+
super.setESNavigationBar()
5252
navigationItem.title = TextLiteral.setNickName
5353
}
5454

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// MapsViewController.swift
3+
// EATSSU
4+
//
5+
// Created by JIWOONG CHOI on 1/28/25.
6+
//
7+
8+
import UIKit
9+
10+
import EATSSUDesign
11+
12+
import NMapsMap
13+
14+
final class MapsViewController: BaseViewController {
15+
override func viewDidLoad() {
16+
super.viewDidLoad()
17+
let mapView = NMFMapView(frame: view.frame)
18+
view.addSubview(mapView)
19+
}
20+
}

EATSSU/App/Sources/Presentation/MyPage/ViewController/CreatorViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class CreatorViewController: BaseViewController {
3737
}
3838
}
3939

40-
override func setCustomNavigationBar() {
40+
override func setESNavigationBar() {
4141
// TODO: setCustomNavigationBar에 파라미터로 title 값을 받아서 네비게이션 바를 설계하도록 변경
42-
super.setCustomNavigationBar()
42+
super.setESNavigationBar()
4343
navigationItem.title = "만든 사람들"
4444
}
4545
}

EATSSU/App/Sources/Presentation/MyPage/ViewController/MyPageViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ final class MyPageViewController: BaseViewController {
4646

4747
// MARK: - Functions
4848

49-
override func setCustomNavigationBar() {
50-
super.setCustomNavigationBar()
49+
override func setESNavigationBar() {
50+
super.setESNavigationBar()
5151
navigationItem.title = TextLiteral.MyPage.myPage
5252
}
5353

EATSSU/App/Sources/Presentation/MyPage/ViewController/MyReviewViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ final class MyReviewViewController: BaseViewController {
4949

5050
// MARK: - Functions
5151

52-
override func setCustomNavigationBar() {
53-
super.setCustomNavigationBar()
52+
override func setESNavigationBar() {
53+
super.setESNavigationBar()
5454
navigationItem.title = TextLiteral.MyPage.myReview
5555
}
5656

EATSSU/App/Sources/Presentation/MyPage/ViewController/ProvisionViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ final class ProvisionViewController: BaseViewController {
3333

3434
// MARK: - Functions
3535

36-
override func setCustomNavigationBar() {
37-
super.setCustomNavigationBar()
36+
override func setESNavigationBar() {
37+
super.setESNavigationBar()
3838
navigationItem.title = navigationTitle
3939
}
4040

EATSSU/App/Sources/Presentation/MyPage/ViewController/UserWithdrawViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ final class UserWithdrawViewController: BaseViewController {
6464
}
6565
}
6666

67-
override func setCustomNavigationBar() {
68-
super.setCustomNavigationBar()
67+
override func setESNavigationBar() {
68+
super.setESNavigationBar()
6969
navigationItem.title = "탈퇴하기"
7070
}
7171

EATSSU/App/Sources/Presentation/Review/ViewController/ChoiceMenuViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ final class ChoiceMenuViewController: BaseViewController {
104104
nextButton.addTarget(self, action: #selector(nextButtonTapped), for: .touchUpInside)
105105
}
106106

107-
override func setCustomNavigationBar() {
108-
super.setCustomNavigationBar()
107+
override func setESNavigationBar() {
108+
super.setESNavigationBar()
109109
navigationItem.title = "리뷰 남기기"
110110
}
111111

EATSSU/App/Sources/Presentation/Review/ViewController/FormerReportViewController.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ final class FormerReportViewController: BaseViewController {
165165
setDelegate()
166166
addArray()
167167
setButtonEvent()
168-
setCustomNavigationBar()
168+
setESNavigationBar()
169169
}
170170

171171
override func viewWillAppear(_: Bool) {
@@ -230,8 +230,8 @@ final class FormerReportViewController: BaseViewController {
230230
sendButton.addTarget(self, action: #selector(sendButtonIsTapped), for: .touchUpInside)
231231
}
232232

233-
override func setCustomNavigationBar() {
234-
super.setCustomNavigationBar()
233+
override func setESNavigationBar() {
234+
super.setESNavigationBar()
235235
title = "신고하기"
236236

237237
let navBarApperance = UINavigationBarAppearance()

EATSSU/App/Sources/Presentation/Review/ViewController/ReportViewController.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class ReportViewController: BaseViewController {
4343
setDelegate()
4444
addArray()
4545
setButtonEvent()
46-
setCustomNavigationBar()
46+
setESNavigationBar()
4747
}
4848

4949
override func viewWillDisappear(_: Bool) {
@@ -98,8 +98,8 @@ final class ReportViewController: BaseViewController {
9898
self.reviewID = reviewID
9999
}
100100

101-
override func setCustomNavigationBar() {
102-
super.setCustomNavigationBar()
101+
override func setESNavigationBar() {
102+
super.setESNavigationBar()
103103
title = "신고하기"
104104

105105
let navBarApperance = UINavigationBarAppearance()

EATSSU/App/Sources/Presentation/Review/ViewController/ReviewViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ final class ReviewViewController: BaseViewController {
8989
}
9090
}
9191

92-
override func setCustomNavigationBar() {
93-
super.setCustomNavigationBar()
92+
override func setESNavigationBar() {
93+
super.setESNavigationBar()
9494
navigationItem.title = "리뷰"
9595
}
9696

EATSSU/App/Sources/Presentation/Review/ViewController/SetRateViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ final class SetRateViewController: BaseViewController {
284284
nextButton.addTarget(self, action: #selector(tappedNextButton), for: .touchUpInside)
285285
}
286286

287-
override func setCustomNavigationBar() {
288-
super.setCustomNavigationBar()
287+
override func setESNavigationBar() {
288+
super.setESNavigationBar()
289289
if reviewId != nil {
290290
navigationItem.title = "리뷰 수정하기"
291291
} else {

EATSSU/App/Sources/Presentation/Review/ViewController/WriteReviewViewController.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class WriteReviewViewController: BaseViewController, UIImagePickerControllerDele
9999

100100
override func viewDidLoad() {
101101
super.viewDidLoad()
102-
setCustomNavigationBar()
102+
setESNavigationBar()
103103
setStarButtons()
104104

105105
userReviewTextView.delegate = self
@@ -182,8 +182,8 @@ class WriteReviewViewController: BaseViewController, UIImagePickerControllerDele
182182
userReviewTextView.resignFirstResponder()
183183
}
184184

185-
override func setCustomNavigationBar() {
186-
super.setCustomNavigationBar()
185+
override func setESNavigationBar() {
186+
super.setESNavigationBar()
187187
navigationItem.title = "리뷰 남기기"
188188
}
189189

EATSSU/App/Sources/Presentation/TabBar/RootTabBarViewController.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class RootTabBarViewController: UITabBarController {
1616

1717
private func setupTabBar() {
1818
let homeViewController = HomeViewController()
19-
let searchViewController = HomeViewController()
19+
let searchViewController = MapsViewController()
2020
let settingsViewController = MyPageViewController()
2121

2222
// 각 뷰컨트롤러를 네비게이션 컨트롤러로 래핑
@@ -26,7 +26,7 @@ class RootTabBarViewController: UITabBarController {
2626

2727
// 탭바 아이템 설정
2828
homeNav.tabBarItem = UITabBarItem(title: "Home", image: UIImage(systemName: "house.fill"), tag: 0)
29-
searchNav.tabBarItem = UITabBarItem(title: "Search", image: UIImage(systemName: "magnifyingglass"), tag: 1)
29+
searchNav.tabBarItem = UITabBarItem(title: "Search", image: UIImage(systemName: "map.fill"), tag: 1)
3030
settingsNav.tabBarItem = UITabBarItem(title: "Settings", image: UIImage(systemName: "gearshape.fill"), tag: 2)
3131

3232
// 탭바 컨트롤러에 뷰컨트롤러 추가

EATSSU/App/Sources/Utility/Base/BaseViewController.swift

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//
22
// BaseViewController.swift
3-
// EatSSU-iOS
3+
// EATSSU
44
//
5-
// Created by 박윤빈 on 2023/03/15.
5+
// Edited by Jiwoong CHOI on 01/28/2025.
66
//
77

88
// TODO: BaseViewController 코드 Utility 모듈로 모듈화 간 재정비
@@ -20,7 +20,7 @@ import SnapKit
2020
/// - configureUI
2121
/// - setLayout
2222
/// - setButtonEvent
23-
/// - setCustomnavigationBar
23+
/// - setESnavigationBar
2424
///
2525
/// - Important: configureUI와 setLayout 메소드는 필수로 오버라이딩 해야 합니다.
2626
/// 오버라이딩 하지 않으면 런타임 에러가 발생합니다.
@@ -40,9 +40,10 @@ class BaseViewController: UIViewController {
4040
fatalError("init(coder:) has not been implemented")
4141
}
4242

43-
// TODO: deinit 메소드의 목적이 무엇인지 알아보기
4443
deinit {
45-
print("DEINIT: \(className)")
44+
#if DEBUG
45+
print("메모리 해제 ViewController: \(className)")
46+
#endif
4647
}
4748

4849
override func viewDidLoad() {
@@ -51,15 +52,17 @@ class BaseViewController: UIViewController {
5152
configureUI()
5253
setLayout()
5354
setButtonEvent()
54-
setCustomNavigationBar()
55+
setESNavigationBar()
5556
view.backgroundColor = .systemBackground
5657
}
5758

5859
override func viewWillAppear(_ animated: Bool) {
5960
super.viewWillAppear(animated)
6061

6162
if !NetworkMonitor.shared.isConnected {
62-
print("네트워크 오류")
63+
#if DEBUG
64+
print("네트워크 오류")
65+
#endif
6366
showAlertController(title: "오류", message: "네트워크를 확인해주세요", style: .destructive)
6467
}
6568
}
@@ -114,7 +117,7 @@ class BaseViewController: UIViewController {
114117
///
115118
/// # 네비게이션 백버튼 속성
116119
/// - `gray500`으로 백버튼 색상을 설정합니다.
117-
func setCustomNavigationBar() {
120+
func setESNavigationBar() {
118121
// 네비게이션 바 타이틀 속성
119122
navigationController?.navigationBar.titleTextAttributes = [
120123
.foregroundColor: EATSSUDesignAsset.Color.GrayScale.gray700.color,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//
2+
// BaseViewControllerProtocol.swift
3+
// EATSSU
4+
//
5+
// Created by JIWOONG CHOI on 1/28/25.
6+
//
7+
8+
import UIKit
9+
10+
/// EATSSU 앱에서 UIViewController의 공통 인터페이스를 정의하는 프로토콜입니다.
11+
protocol BaseViewControllerProtocol: AnyObject {
12+
// MARK: - Required Methods
13+
14+
/// UIViewController에서 사용 중인 UIView를 연결합니다.
15+
///
16+
/// # Example
17+
/// ```swift
18+
/// func configureUI() {
19+
/// view.addSubview(rootView)
20+
/// }
21+
/// ```
22+
func configureUI()
23+
24+
/// 연결된 UIView 클래스의 레이아웃을 UIViewController의 View 프로퍼티를 기준으로 레이아웃을 조정합니다.
25+
///
26+
/// # Example
27+
/// ```swift
28+
/// func setLayout() {
29+
/// rootView.snp.makeConstraints { make in
30+
/// make.edges.equalToSuperview()
31+
/// }
32+
/// }
33+
/// ```
34+
func setLayout()
35+
36+
// MARK: - Optional Methods
37+
38+
/// UIViewController에서 버튼이 있다면 버튼 액션을 연결합니다.
39+
///
40+
/// 버튼이 없다면 기본적으로 비워둡니다.
41+
func setButtonEvent()
42+
43+
/// EATSSU 앱에서 사용하고 있는 네비게이션 바의 속성을 정의합니다.
44+
func setESNavigationBar()
45+
}
46+
47+
// MARK: - Default Implementation
48+
49+
extension BaseViewControllerProtocol {
50+
func setButtonEvent() {}
51+
func setESNavigationBar() {}
52+
}

EATSSU/Project.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import ProjectDescription
22

33
let appInfoPlist: InfoPlist = .extendingDefault(with: [
4-
"UILaunchStoryboardName": "LaunchScreen",
4+
// API Keys Settings
55
"BASE_URL": "https://$(BASE_URL)",
66
"KAKAO API KEY": "$(KAKAO_API_KEY)",
7+
"NMFClientId": "$(NMAP_CLIENT_ID)",
78
"GADApplicationIdentifier": "$(GADApplicationIdentifier)",
9+
"UILaunchStoryboardName": "LaunchScreen",
810
"CFBundleURLTypes": [
911
[
1012
"CFBundleTypeRole": "Editor",
@@ -102,6 +104,7 @@ let project = Project(
102104
.external(name: "KakaoSDKCommon"),
103105
.external(name: "KakaoSDKTalk"),
104106
.external(name: "GoogleMobileAds"),
107+
.external(name: "NMapsMap"),
105108

106109
// EATSSU 내장 라이브러리
107110
.project(target: "EATSSUDesign", path: .relativeToRoot("../EATSSUDesign"), condition: .none),
@@ -139,6 +142,7 @@ let project = Project(
139142
.external(name: "KakaoSDKCommon"),
140143
.external(name: "KakaoSDKTalk"),
141144
.external(name: "GoogleMobileAds"),
145+
.external(name: "NMapsMap"),
142146

143147
// EATSSU 내장 라이브러리
144148
.project(target: "EATSSUDesign", path: .relativeToRoot("../EATSSUDesign"), condition: .none),

Tuist/Package.resolved

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"originHash" : "927f3970054f96b698bb1f4d42eec10f20bdcf37978d07047fc3af226ed8ed97",
2+
"originHash" : "f7acbf13d8ff28deccedf1b13d9163bb3548128ddcdec705eab977fbd5b1c7f0",
33
"pins" : [
44
{
55
"identity" : "abseil-cpp-binary",
@@ -208,6 +208,24 @@
208208
"version" : "5.7.1"
209209
}
210210
},
211+
{
212+
"identity" : "spm-nmapsgeometry",
213+
"kind" : "remoteSourceControl",
214+
"location" : "https://github.com/navermaps/SPM-NMapsGeometry.git",
215+
"state" : {
216+
"revision" : "436d5e2e684f557faf5ef5862fd6633a42d7af11",
217+
"version" : "1.0.2"
218+
}
219+
},
220+
{
221+
"identity" : "spm-nmapsmap",
222+
"kind" : "remoteSourceControl",
223+
"location" : "https://github.com/navermaps/SPM-NMapsMap",
224+
"state" : {
225+
"revision" : "606cb2df9bcffcf6df62ba00d0322965a4c730e9",
226+
"version" : "3.20.0"
227+
}
228+
},
211229
{
212230
"identity" : "swift-package-manager-google-mobile-ads",
213231
"kind" : "remoteSourceControl",

Tuist/Package.swift

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import PackageDescription
3636

3737
// RxSwift
3838
"RxSwift": .framework,
39+
40+
// Naver Maps
41+
"NMapsMap": .framework,
3942
]
4043
)
4144
#endif
@@ -55,5 +58,6 @@ let package = Package(
5558
.package(url: "https://github.com/realm/realm-swift", from: "20.0.0"),
5659
.package(url: "https://github.com/ReactiveX/RxSwift", from: "6.7.1"),
5760
.package(url: "https://github.com/googleads/swift-package-manager-google-mobile-ads.git", from: "11.0.0"),
61+
.package(url: "https://github.com/navermaps/SPM-NMapsMap", from: "3.20.0"),
5862
]
5963
)

0 commit comments

Comments
 (0)