From 3a176babe72b9347637f7ac6c766d809d67254a1 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: Wed, 11 May 2022 21:35:16 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=85[CHORE]=20#119=20-=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=EA=B2=B0=EA=B3=BC=EA=B0=80=20=EB=B9=84=EC=97=88?= =?UTF-8?q?=EC=9D=84=20=EB=95=8C=20=ED=99=94=EB=A9=B4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/Assets+Generated.swift | 1 + .../StudioMapSearchViewController.swift | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Fillin-iOS/Fillin-iOS/Resources/Constants/Assets+Generated.swift b/Fillin-iOS/Fillin-iOS/Resources/Constants/Assets+Generated.swift index d904b70..df1fe38 100644 --- a/Fillin-iOS/Fillin-iOS/Resources/Constants/Assets+Generated.swift +++ b/Fillin-iOS/Fillin-iOS/Resources/Constants/Assets+Generated.swift @@ -80,6 +80,7 @@ internal enum Asset { internal static let iosStatusbar = ImageAsset(name: "iosStatusbar") internal static let loginLogo = ImageAsset(name: "loginLogo") internal static let logo = ImageAsset(name: "logo") + internal static let noSearch = ImageAsset(name: "noSearch") internal static let photoInsert = ImageAsset(name: "photo_insert") internal static let profile = ImageAsset(name: "profile") } diff --git a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapSearchViewController/StudioMapSearchViewController.swift b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapSearchViewController/StudioMapSearchViewController.swift index b89805c..11c334a 100644 --- a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapSearchViewController/StudioMapSearchViewController.swift +++ b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/StudioMapSearchViewController/StudioMapSearchViewController.swift @@ -16,6 +16,7 @@ class StudioMapSearchViewController: UIViewController { let searchPlaceTextField = UITextField() // searchBar let tableView = UITableView() let dividerView = UIView() + let noSearchImageView = UIImageView() let navigationBar = FilinNavigationBar() let searchController = UISearchController(searchResultsController: nil) @@ -133,12 +134,27 @@ class StudioMapSearchViewController: UIViewController { func setUpTextField() { /// 수정 searchPlaceTextField.becomeFirstResponder() } + + func changeEmptySearchView() { + print("call") + view.add(noSearchImageView) { + $0.image = UIImage(named: "noSearch") + $0.snp.makeConstraints { + $0.top.equalTo(self.searchPlaceTextField.snp.bottom).offset(135) + $0.centerX.equalTo(self.view.snp.centerX) + $0.height.equalTo(223) + $0.width.equalTo(246) + } + } + } + override func touchesBegan(_ touches: Set, with event: UIEvent?) { self.view.endEditing(true) } @objc func touchSearchButton(_ sender: UIButton) { self.view.endEditing(true) + changeEmptySearchView() /// (임시로 실행) 토큰 나오면 이 줄 삭제하기 searchStudiosWithAPI(keyword: searchPlaceTextField.text ?? "") } } @@ -199,7 +215,11 @@ extension StudioMapSearchViewController { case .success(let data): if let search = data as? StudioSearchResponse { self.serverSearchStudios = search - self.tableView.reloadData() + if ((self.serverSearchStudios?.studios.isEmpty) != nil) { + self.changeEmptySearchView() + } else { + self.tableView.reloadData() + } } case .requestErr(let message): print("searchStudioWithAPI - requestErr: \(message)")