diff --git a/Whidy-iOS.xcodeproj/project.pbxproj b/Whidy-iOS.xcodeproj/project.pbxproj index 81beaeb..4cae9f2 100644 --- a/Whidy-iOS.xcodeproj/project.pbxproj +++ b/Whidy-iOS.xcodeproj/project.pbxproj @@ -125,6 +125,8 @@ 6BF2D87E2D4A66A300252A43 /* AuthInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BF2D87D2D4A66A300252A43 /* AuthInterceptor.swift */; }; 6BF2D8802D4A6FD700252A43 /* OnboardingCoordinatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BF2D87F2D4A6FD700252A43 /* OnboardingCoordinatorView.swift */; }; 6BF2D8822D4C51E600252A43 /* SearchView+ChildView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BF2D8812D4C51E600252A43 /* SearchView+ChildView.swift */; }; + 6BF2D9302D4DD51D00252A43 /* InfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BF2D92F2D4DD51D00252A43 /* InfoView.swift */; }; + 6BF2D94B2D4E696900252A43 /* InfoDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BF2D94A2D4E696900252A43 /* InfoDetailView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -249,6 +251,8 @@ 6BF2D87D2D4A66A300252A43 /* AuthInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthInterceptor.swift; sourceTree = ""; }; 6BF2D87F2D4A6FD700252A43 /* OnboardingCoordinatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCoordinatorView.swift; sourceTree = ""; }; 6BF2D8812D4C51E600252A43 /* SearchView+ChildView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SearchView+ChildView.swift"; sourceTree = ""; }; + 6BF2D92F2D4DD51D00252A43 /* InfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoView.swift; sourceTree = ""; }; + 6BF2D94A2D4E696900252A43 /* InfoDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoDetailView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -298,6 +302,7 @@ 6B6220732D37AA6C00C5F2C8 /* View */ = { isa = PBXGroup; children = ( + 6BF2D92E2D4DD50600252A43 /* Info */, 6BF2D85D2D49ECFC00252A43 /* StudyMap */, 6BF2D85E2D49ED0400252A43 /* Search */, ); @@ -780,6 +785,15 @@ path = Search; sourceTree = ""; }; + 6BF2D92E2D4DD50600252A43 /* Info */ = { + isa = PBXGroup; + children = ( + 6BF2D92F2D4DD51D00252A43 /* InfoView.swift */, + 6BF2D94A2D4E696900252A43 /* InfoDetailView.swift */, + ); + path = Info; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -883,6 +897,7 @@ 6B6275E62D35EFE200843C9E /* Logger.swift in Sources */, 6B6275E72D35EFE200843C9E /* LoginType.swift in Sources */, 6B6276922D35FFF100843C9E /* EmptyResponseModel.swift in Sources */, + 6BF2D9302D4DD51D00252A43 /* InfoView.swift in Sources */, 6B6220912D3882C300C5F2C8 /* ScrapView.swift in Sources */, 6B6276932D35FFF100843C9E /* AppVersionResponse.swift in Sources */, 6B6276942D35FFF100843C9E /* ErrorResponse.swift in Sources */, @@ -932,6 +947,7 @@ 6B62763A2D35EFFB00843C9E /* ProfileImageModifier.swift in Sources */, 6B62763B2D35EFFB00843C9E /* TextToButtonModifier.swift in Sources */, 6B62763C2D35EFFB00843C9E /* NormalTextFieldModifier.swift in Sources */, + 6BF2D94B2D4E696900252A43 /* InfoDetailView.swift in Sources */, 6B6220CA2D39F56A00C5F2C8 /* SignUpRequest.swift in Sources */, 6B6276892D35FDD000843C9E /* Color.swift in Sources */, 6B62763D2D35EFFB00843C9E /* DateFormatUtil.swift in Sources */, @@ -1133,7 +1149,7 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 16.1; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 15.1; @@ -1179,7 +1195,7 @@ "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - IPHONEOS_DEPLOYMENT_TARGET = 16.1; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 15.1; diff --git a/Whidy-iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Whidy-iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 7cf7ee8..1a0a161 100644 --- a/Whidy-iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Whidy-iOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "b2bab2be8a84f0ba5753afaf70ee181b5bd28f00053e05fd444658fe753afe3c", + "originHash" : "bc170e0b56adcad178b53c3e71684a751fcdee4a481c44253c77cbe9163640a5", "pins" : [ { "identity" : "alamofire", diff --git a/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapCoordinator.swift b/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapCoordinator.swift index 59e3949..2830172 100644 --- a/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapCoordinator.swift +++ b/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapCoordinator.swift @@ -19,6 +19,8 @@ struct StudyMapCoordinatorView : View { StudyMapView(store: store) case let .search(store): SearchView(store: store) + case let .infoDetail(store): + InfoDetailView(store: store) } } } @@ -45,11 +47,16 @@ struct StudyMapCoordinator { case .router(.routeAction(id: .studyMap, action: .studyMap(.viewTransition(.goToSearch)))): state.routes.push(.search(.init())) + case .router(.routeAction(id: .studyMap, action: .studyMap(.viewTransition(.goToInfoDetail)))): + state.routes.presentCover(.infoDetail(.init())) + case .router(.routeAction(id: .search, action: .search(.viewTransition(.goToBack)))): - state.routes.goBack() + state.routes.goBackTo(id: .studyMap) - case let .router(.routeAction(id: .search, action: .search(.viewTransition(.goToResultLocation(location))))): + case .router(.routeAction(id: .infoDetail, action: .infoDetail(.viewTransition(.dismiss)))): + state.routes.goBackTo(id: .studyMap) + case let .router(.routeAction(id: .search, action: .search(.viewTransition(.goToResultLocation(location))))): state.routes.goBackTo(id: .studyMap) naverMapManager.moveToSpecificLocation(location: location) diff --git a/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen+Identifiable.swift b/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen+Identifiable.swift index 4db59e5..319bc5a 100644 --- a/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen+Identifiable.swift +++ b/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen+Identifiable.swift @@ -12,12 +12,15 @@ extension StudyMapScreen.State : Identifiable { .studyMap case .search: .search + case .infoDetail: + .infoDetail } } enum ID : Identifiable { case studyMap case search + case infoDetail var id: ID { self } } } diff --git a/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen.swift b/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen.swift index 68dccbb..a973ff7 100644 --- a/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen.swift +++ b/Whidy-iOS/Presentation/Main/StudyMap/Coordinator/StudyMapScreen.swift @@ -12,4 +12,5 @@ import ComposableArchitecture enum StudyMapScreen { case studyMap(StudyMapFeature) case search(SearchFeature) + case infoDetail(InfoDetailFeature) } diff --git a/Whidy-iOS/Presentation/Main/StudyMap/View/Info/InfoDetailView.swift b/Whidy-iOS/Presentation/Main/StudyMap/View/Info/InfoDetailView.swift new file mode 100644 index 0000000..72aebed --- /dev/null +++ b/Whidy-iOS/Presentation/Main/StudyMap/View/Info/InfoDetailView.swift @@ -0,0 +1,111 @@ +// +// InfoDetailView.swift +// Whidy-iOS +// +// Created by JinwooLee on 2/1/25. +// + +import SwiftUI + +struct InfoDetailView: View { + @Perception.Bindable var store: StoreOf + @State private var scrollOffset: CGFloat = 0 + @State private var dragOffset: CGFloat = 0 + + var body: some View { + VStack { + ScrollView { + VStack(spacing: 20) { + ForEach(0..<50) { index in + Text("Item \(index)") + .frame(maxWidth: .infinity) + .padding() + .background(Color.gray.opacity(0.2)) + .cornerRadius(8) + } + } + .background(GeometryReader { geometry in + Color.clear + .preference( + key: ScrollOffsetKey.self, + value: geometry.frame(in: .named("scrollView")).origin.y + ) + }) + } + .coordinateSpace(name: "scrollView") + .onPreferenceChange(ScrollOffsetKey.self) { value in + scrollOffset = value // ScrollView의 오프셋 업데이트 + Logger.debug("scrollOffset: \(scrollOffset)") + + if scrollOffset >= 120 { + store.send(.viewTransition(.dismiss)) + } + } + } + .background(Color.white) + .edgesIgnoringSafeArea(.all) + } +} + +// ScrollView의 오프셋을 감지하기 위한 PreferenceKey +struct ScrollOffsetKey: PreferenceKey { + static var defaultValue: CGFloat = 0 + + static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { + value += nextValue() + } +} + +import ComposableArchitecture + +@Reducer +struct InfoDetailFeature { + @ObservableState + struct State : Equatable { + let id = UUID() + + } + + enum Action : BindableAction { + case binding(BindingAction) + case networkResponse(NetworkReponse) + case buttonTapped(ButtonTapped) + case viewTransition(ViewTransition) + case anyAction(AnyAction) + } + + enum ViewTransition { + case onAppear + case dismiss + } + + enum NetworkReponse { + + } + + enum ButtonTapped { + + } + + + enum AnyAction { + + } + + @Dependency(\.networkManager) var networkManager + + var body : some ReducerOf { + + BindingReducer() + + Reduce { state, action in + switch action { + + + default : + break + } + return .none + } + } +} diff --git a/Whidy-iOS/Presentation/Main/StudyMap/View/Info/InfoView.swift b/Whidy-iOS/Presentation/Main/StudyMap/View/Info/InfoView.swift new file mode 100644 index 0000000..84bdee1 --- /dev/null +++ b/Whidy-iOS/Presentation/Main/StudyMap/View/Info/InfoView.swift @@ -0,0 +1,18 @@ +// +// InfoView.swift +// Whidy-iOS +// +// Created by JinwooLee on 2/1/25. +// + +import SwiftUI + +struct InfoView: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + InfoView() +}