diff --git a/ACON-iOS/ACON-iOS.xcodeproj/project.pbxproj b/ACON-iOS/ACON-iOS.xcodeproj/project.pbxproj index 37b9988d..759022c4 100644 --- a/ACON-iOS/ACON-iOS.xcodeproj/project.pbxproj +++ b/ACON-iOS/ACON-iOS.xcodeproj/project.pbxproj @@ -58,9 +58,6 @@ 741E689A2D3D43FF00DF99EF /* EmptyResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741E68992D3D43FA00DF99EF /* EmptyResponse.swift */; }; 741E68A02D3D5BD400DF99EF /* TargetType+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741E689F2D3D5BCE00DF99EF /* TargetType+.swift */; }; 741E68A22D3D5FA200DF99EF /* ACService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741E68A12D3D5F9700DF99EF /* ACService.swift */; }; - 741E68A62D3D61FA00DF99EF /* TestTargetType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741E68A52D3D61F000DF99EF /* TestTargetType.swift */; }; - 741E68A82D3D620700DF99EF /* TestService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741E68A72D3D620300DF99EF /* TestService.swift */; }; - 741E68AA2D3D625E00DF99EF /* TestResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741E68A92D3D625A00DF99EF /* TestResponse.swift */; }; 741E68AC2D3D6DA800DF99EF /* HeaderType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 741E68AB2D3D6DA400DF99EF /* HeaderType.swift */; }; 74205D2F2D40351700D11557 /* SocialType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74205D2E2D40351400D11557 /* SocialType.swift */; }; 74220DD42D34363B000684BF /* SpotUploadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74220DD32D343633000684BF /* SpotUploadViewController.swift */; }; @@ -127,7 +124,6 @@ 748D6F8F2D2BD340007690B4 /* UIButton+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 748D6F8E2D2BD33D007690B4 /* UIButton+.swift */; }; 748D6F912D2BD450007690B4 /* UILabel+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 748D6F902D2BD44C007690B4 /* UILabel+.swift */; }; 748D6F952D2BD4DB007690B4 /* UICollectionViewCell+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 748D6F942D2BD4D6007690B4 /* UICollectionViewCell+.swift */; }; - 748D6F972D2BD544007690B4 /* DummyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 748D6F962D2BD53F007690B4 /* DummyType.swift */; }; 748D6F992D2BD54E007690B4 /* DummyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 748D6F982D2BD549007690B4 /* DummyProtocol.swift */; }; 748D6F9B2D2BD638007690B4 /* Pretendard-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 748D6F9A2D2BD638007690B4 /* Pretendard-Bold.otf */; }; 748D6F9D2D2BD641007690B4 /* Pretendard-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 748D6F9C2D2BD641007690B4 /* Pretendard-SemiBold.otf */; }; @@ -246,9 +242,6 @@ 741E68992D3D43FA00DF99EF /* EmptyResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyResponse.swift; sourceTree = ""; }; 741E689F2D3D5BCE00DF99EF /* TargetType+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TargetType+.swift"; sourceTree = ""; }; 741E68A12D3D5F9700DF99EF /* ACService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ACService.swift; sourceTree = ""; }; - 741E68A52D3D61F000DF99EF /* TestTargetType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestTargetType.swift; sourceTree = ""; }; - 741E68A72D3D620300DF99EF /* TestService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestService.swift; sourceTree = ""; }; - 741E68A92D3D625A00DF99EF /* TestResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestResponse.swift; sourceTree = ""; }; 741E68AB2D3D6DA400DF99EF /* HeaderType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderType.swift; sourceTree = ""; }; 74205D2E2D40351400D11557 /* SocialType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocialType.swift; sourceTree = ""; }; 74220DD32D343633000684BF /* SpotUploadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotUploadViewController.swift; sourceTree = ""; }; @@ -310,7 +303,6 @@ 748D6F8E2D2BD33D007690B4 /* UIButton+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+.swift"; sourceTree = ""; }; 748D6F902D2BD44C007690B4 /* UILabel+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+.swift"; sourceTree = ""; }; 748D6F942D2BD4D6007690B4 /* UICollectionViewCell+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UICollectionViewCell+.swift"; sourceTree = ""; }; - 748D6F962D2BD53F007690B4 /* DummyType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyType.swift; sourceTree = ""; }; 748D6F982D2BD549007690B4 /* DummyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyProtocol.swift; sourceTree = ""; }; 748D6F9A2D2BD638007690B4 /* Pretendard-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Bold.otf"; sourceTree = ""; }; 748D6F9C2D2BD641007690B4 /* Pretendard-SemiBold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-SemiBold.otf"; sourceTree = ""; }; @@ -596,24 +588,6 @@ path = Pods; sourceTree = ""; }; - 741E68A32D3D616200DF99EF /* Test */ = { - isa = PBXGroup; - children = ( - 741E68A42D3D617400DF99EF /* DTO */, - 741E68A72D3D620300DF99EF /* TestService.swift */, - 741E68A52D3D61F000DF99EF /* TestTargetType.swift */, - ); - path = Test; - sourceTree = ""; - }; - 741E68A42D3D617400DF99EF /* DTO */ = { - isa = PBXGroup; - children = ( - 741E68A92D3D625A00DF99EF /* TestResponse.swift */, - ); - path = DTO; - sourceTree = ""; - }; 74220DD12D34361E000684BF /* Upload */ = { isa = PBXGroup; children = ( @@ -857,7 +831,6 @@ 746F15B42D3E2041003EA031 /* LocalVerification */, 746261602D3E9F6000A4E84F /* Upload */, D6AF15612D3E8A3700289683 /* Onboarding */, - 741E68A32D3D616200DF99EF /* Test */, 743069872D3D2EDA0033178C /* Base */, 15CD25752D3FE2D800320006 /* SpotList */, ); @@ -959,7 +932,6 @@ 746261702D3EA50700A4E84F /* SpotCategoryType.swift */, 741E68AB2D3D6DA400DF99EF /* HeaderType.swift */, 74CDCE532D310A1100E3A21A /* ACFontStyleType.swift */, - 748D6F962D2BD53F007690B4 /* DummyType.swift */, ); path = Enums; sourceTree = ""; @@ -1440,7 +1412,6 @@ 1547A8852D3595B600E96616 /* SpotListFilterModel.swift in Sources */, 748D6F8B2D2BD31B007690B4 /* UIStackView+.swift in Sources */, 748D6F912D2BD450007690B4 /* UILabel+.swift in Sources */, - 741E68AA2D3D625E00DF99EF /* TestResponse.swift in Sources */, 746261772D3EA88700A4E84F /* GetAcornCountResponse.swift in Sources */, D61917E92D3E4410001BF0EE /* OnboardingTargetType.swift in Sources */, 742544062D413CCD004F950F /* SpotListCollectionViewFooter.swift in Sources */, @@ -1449,7 +1420,6 @@ 748ECA6B2D31918D00BBC981 /* LoginView.swift in Sources */, D6EA38152D42B88F002B68B9 /* SearchEmptyView.swift in Sources */, 1547A6F22D33AD4500E96616 /* SpotModel.swift in Sources */, - 748D6F972D2BD544007690B4 /* DummyType.swift in Sources */, 746261732D3EA78700A4E84F /* GetReiviewVerificationRequest.swift in Sources */, 74BF92022D385D8700B923E3 /* MenuCollectionViewCell.swift in Sources */, 74220DD42D34363B000684BF /* SpotUploadViewController.swift in Sources */, @@ -1462,7 +1432,6 @@ 745C7E042D3599DF0074DBDB /* SpotSearchViewController.swift in Sources */, 74B25C2C2D2FEE8E008BDCB7 /* Config.swift in Sources */, 74054ECA2D32534200D1CDE4 /* MultitaskDelegate.swift in Sources */, - 741E68A62D3D61FA00DF99EF /* TestTargetType.swift in Sources */, 748D6F8F2D2BD340007690B4 /* UIButton+.swift in Sources */, 746261792D3EA8DF00A4E84F /* UploadTargetType.swift in Sources */, 741A07572D3558FE00778219 /* ReviewFinishedView.swift in Sources */, @@ -1542,7 +1511,6 @@ 745C7E152D35AEC10074DBDB /* SpotSearchViewModel.swift in Sources */, D6E452932D3AA47500CBED02 /* ProfileView.swift in Sources */, D6E452942D3AA47500CBED02 /* ProfileViewController.swift in Sources */, - 741E68A82D3D620700DF99EF /* TestService.swift in Sources */, 748D6F6B2D2BCA1C007690B4 /* ViewController.swift in Sources */, 15A3F6A82D36D5B900577E16 /* FilterTagButtonStackLineType.swift in Sources */, ); @@ -1572,7 +1540,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = KX5Q77JSUF; GENERATE_INFOPLIST_FILE = YES; @@ -1609,7 +1577,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 5; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = KX5Q77JSUF; GENERATE_INFOPLIST_FILE = YES; diff --git a/ACON-iOS/ACON-iOS/Global/Utils/ACLocationManager.swift b/ACON-iOS/ACON-iOS/Global/Utils/ACLocationManager.swift index 24bdf25a..dfa4e94a 100644 --- a/ACON-iOS/ACON-iOS/Global/Utils/ACLocationManager.swift +++ b/ACON-iOS/ACON-iOS/Global/Utils/ACLocationManager.swift @@ -68,7 +68,7 @@ class ACLocationManager: NSObject { } func checkUserDeviceLocationServiceAuthorization() { - // Execute on background thread to prevent UI blocking + // NOTE: - Execute on background thread to prevent UI blocking ?? DispatchQueue.global().async { [weak self] in guard CLLocationManager.locationServicesEnabled() else { DispatchQueue.main.async { diff --git a/ACON-iOS/ACON-iOS/Global/Utils/Enums/DummyType.swift b/ACON-iOS/ACON-iOS/Global/Utils/Enums/DummyType.swift deleted file mode 100644 index f617db54..00000000 --- a/ACON-iOS/ACON-iOS/Global/Utils/Enums/DummyType.swift +++ /dev/null @@ -1,7 +0,0 @@ -// -// DummyType.swift -// ACON-iOS -// -// Created by 이수민 on 1/6/25. -// - diff --git a/ACON-iOS/ACON-iOS/Network/Base/ACService.swift b/ACON-iOS/ACON-iOS/Network/Base/ACService.swift index 052f4ebf..3920d7d2 100644 --- a/ACON-iOS/ACON-iOS/Network/Base/ACService.swift +++ b/ACON-iOS/ACON-iOS/Network/Base/ACService.swift @@ -15,8 +15,6 @@ final class ACService { private init() {} - lazy var testService: TestService = TestService() - lazy var authService: AuthService = AuthService() lazy var spotDetailService: SpotDetailService = SpotDetailService() diff --git a/ACON-iOS/ACON-iOS/Network/Test/DTO/TestResponse.swift b/ACON-iOS/ACON-iOS/Network/Test/DTO/TestResponse.swift deleted file mode 100644 index 14fc4d30..00000000 --- a/ACON-iOS/ACON-iOS/Network/Test/DTO/TestResponse.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// TestResponse.swift -// ACON-iOS -// -// Created by 이수민 on 1/20/25. -// - -import Foundation - - -struct TestResponse: Codable { - - let menuList: [MenuInfo] - -} - -struct MenuInfo: Codable { - - let id: Int64 - - let name: String - - let price: Int - - let image: String - -} diff --git a/ACON-iOS/ACON-iOS/Network/Test/TestService.swift b/ACON-iOS/ACON-iOS/Network/Test/TestService.swift deleted file mode 100644 index 4dd4da5a..00000000 --- a/ACON-iOS/ACON-iOS/Network/Test/TestService.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TestService.swift -// ACON-iOS -// -// Created by 이수민 on 1/20/25. -// - -import Foundation - -import Moya - -protocol TestServiceProtocol { - - func getMenuList(spotID: Int, completion: @escaping (NetworkResult) -> Void) - -} - -final class TestService: BaseService, TestServiceProtocol { - - let service = BaseService() - - func getMenuList(spotID: Int, completion: @escaping (NetworkResult) -> Void) { - service.provider.request(.getMenuList(spotID: spotID)) { result in - switch result { - case .success(let response): - let networkResult: NetworkResult = self.judgeStatus(statusCode: response.statusCode, data: response.data, type: TestResponse.self) - completion(networkResult) - case .failure(let errorResponse): - print(errorResponse) - } - } - } - -} diff --git a/ACON-iOS/ACON-iOS/Network/Test/TestTargetType.swift b/ACON-iOS/ACON-iOS/Network/Test/TestTargetType.swift deleted file mode 100644 index a6f7da3d..00000000 --- a/ACON-iOS/ACON-iOS/Network/Test/TestTargetType.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// TestTargetType.swift -// ACON-iOS -// -// Created by 이수민 on 1/20/25. -// - -import Foundation - -import Moya - -enum TestTargetType { - - case getMenuList(spotID: Int) - -} - -extension TestTargetType: TargetType { - - var method: Moya.Method { - switch self { - case .getMenuList: - return .get - } - } - - var path: String { - switch self { - case .getMenuList(let spotID): - return utilPath + "spot/\(spotID)/menus" - } - } - - var parameter: [String : Any]? { - switch self { -// NOTE: 파라미터 있으면 이렇게 처리 -// case .getMenuInfo(let id): -// return ["id" : id] - default: - return .none - } - } - - var task: Task { - return .requestPlain - // NOTE: 파라미터 있으면 이렇게 처리 -// if let parameter = parameter { -// return .requestParameters(parameters: parameter, encoding: URLEncoding.default) -// } else { -// return .requestPlain -// } - } - - var headers: [String : String]? { - // NOTE: header type 볼 것 - // NOTE: accessToken은 다음과 같이 부르면 됨 -> 현재 토큰 설정을 안 해서 오류 뜨는 게 당연함!!!!!!!! - // let token = UserDefaults.standard.string(forKey: StringLiterals.Network.accessToken) ?? "" - // let headers = HeaderType.headerWithToken(token: "Bearer " + token) - let headers = HeaderType.noHeader - return headers - } - -} diff --git a/ACON-iOS/ACON-iOS/Presentation/SpotDetail/View/SpotDetailView.swift b/ACON-iOS/ACON-iOS/Presentation/SpotDetail/View/SpotDetailView.swift index b764fef7..f0ecf126 100644 --- a/ACON-iOS/ACON-iOS/Presentation/SpotDetail/View/SpotDetailView.swift +++ b/ACON-iOS/ACON-iOS/Presentation/SpotDetail/View/SpotDetailView.swift @@ -143,6 +143,7 @@ final class SpotDetailView: BaseView { addressLabel.snp.makeConstraints { $0.top.equalToSuperview().inset(ScreenUtils.heightRatio*342 + navViewHeight) $0.leading.equalToSuperview().inset(ScreenUtils.widthRatio*38) + $0.trailing.equalToSuperview().inset(ScreenUtils.widthRatio*20) $0.height.equalTo(18) } diff --git a/ACON-iOS/ACON-iOS/Presentation/Upload/View/SpotSearchViewController.swift b/ACON-iOS/ACON-iOS/Presentation/Upload/View/SpotSearchViewController.swift index 0dffd7f3..92a07396 100644 --- a/ACON-iOS/ACON-iOS/Presentation/Upload/View/SpotSearchViewController.swift +++ b/ACON-iOS/ACON-iOS/Presentation/Upload/View/SpotSearchViewController.swift @@ -82,7 +82,7 @@ class SpotSearchViewController: BaseViewController { override func setHierarchy() { super.setHierarchy() - self.view.addSubviews(spotSearchView,emptyStateView) + self.view.addSubviews(spotSearchView, emptyStateView) } override func setLayout() { @@ -107,7 +107,6 @@ class SpotSearchViewController: BaseViewController { emptyStateView.do { $0.isHidden = true } - } func addTarget() { @@ -133,11 +132,13 @@ private extension SpotSearchViewController { spotSearchViewModel.getSearchSuggestion() spotSearchView.searchSuggestionStackView.isHidden = false spotSearchView.searchKeywordCollectionView.isHidden = true + emptyStateView.isHidden = true } @objc func searchTextFieldDidChange(_ textField: UITextField) { if let text = textField.text { + emptyStateView.isHidden = text == "" spotSearchView.searchSuggestionStackView.isHidden = text != "" spotSearchView.searchKeywordCollectionView.isHidden = text == "" } @@ -166,9 +167,9 @@ private extension SpotSearchViewController { DispatchQueue.main.async { if data.count == 0 { - // TODO: - 엠티뷰 처리 + self?.emptyStateView.isHidden = self?.spotSearchView.searchTextField.text == "" self?.spotSearchView.searchKeywordCollectionView.isHidden = true - self?.emptyStateView.isHidden = false + self?.spotSearchView.searchKeywordCollectionView.reloadData() } else { self?.emptyStateView.isHidden = true self?.spotSearchView.searchKeywordCollectionView.isHidden = false @@ -176,6 +177,21 @@ private extension SpotSearchViewController { } } } + + self.spotSearchViewModel.onSuccessGetReviewVerification.bind { [weak self] onSuccess in + guard let onSuccess, let data = self?.spotSearchViewModel.reviewVerification.value else { return } + if onSuccess { + if data { + self?.hasCompletedSelection = true + self?.dismiss(animated: true) + } else { + let alertHandler = AlertHandler() + alertHandler.showLocationAccessFailImageAlert(from: self!) + } + self?.spotSearchViewModel.reviewVerification.value = nil + } + } + } } @@ -200,10 +216,7 @@ private extension SpotSearchViewController { guard let spotName = sender.currentAttributedTitle?.string else { return } selectedSpotId = sender.spotID selectedSpotName = spotName - DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in - self?.hasCompletedSelection = true - self?.dismiss(animated: true) - } + spotSearchViewModel.getReviewVerification(spotId: selectedSpotId) } } @@ -244,22 +257,6 @@ extension SpotSearchViewController: UICollectionViewDelegateFlowLayout { spotSearchView.searchTextField.text = selectedSpotName self.dismissKeyboard() spotSearchViewModel.getReviewVerification(spotId: selectedSpotId) - self.spotSearchViewModel.onSuccessGetReviewVerification.bind { [weak self] onSuccess in - guard let onSuccess, let data = self?.spotSearchViewModel.reviewVerification.value else { return } - if onSuccess { - if data { - self?.hasCompletedSelection = true - self?.dismiss(animated: true) - } else { - let alertHandler = AlertHandler() - alertHandler.showLocationAccessFailImageAlert(from: self!) - } - self?.spotSearchViewModel.reviewVerification.value = nil - } - } -// self.dismissKeyboard() -// hasCompletedSelection = true -// dismiss(animated: true) } }