From 4cd1af2694afe993cdf09ef444e8cf02300a0efa Mon Sep 17 00:00:00 2001 From: JIWON1923 Date: Wed, 9 Nov 2022 22:37:25 +0900 Subject: [PATCH 01/11] [Feat] #235 - create SearchView UI --- .../HappyAnding.xcodeproj/project.pbxproj | 4 ++ .../HappyAnding/Views/SearchView.swift | 69 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 HappyAnding/HappyAnding/Views/SearchView.swift diff --git a/HappyAnding/HappyAnding.xcodeproj/project.pbxproj b/HappyAnding/HappyAnding.xcodeproj/project.pbxproj index 88243f4f..7d851faa 100644 --- a/HappyAnding/HappyAnding.xcodeproj/project.pbxproj +++ b/HappyAnding/HappyAnding.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 4D778A34290A53BA00C15AC4 /* Application+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D778A33290A53BA00C15AC4 /* Application+Extension.swift */; }; 872A7D8F2918393B004A05B8 /* PrivacyPolicyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 872A7D8E2918393B004A05B8 /* PrivacyPolicyView.swift */; }; 8792478D2918CE450040D5C3 /* UINavigationContoller+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8792478C2918CE450040D5C3 /* UINavigationContoller+Extension.swift */; }; + 8792479B291BDF820040D5C3 /* SearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8792479A291BDF820040D5C3 /* SearchView.swift */; }; 87E606B0291062F900C3DA13 /* AppleAuthCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E606AF291062F900C3DA13 /* AppleAuthCoordinator.swift */; }; 87E606B22910649B00C3DA13 /* SignInWithAppleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E606B12910649B00C3DA13 /* SignInWithAppleView.swift */; }; 87E606B629114F7D00C3DA13 /* WriteNicknameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E606B529114F7D00C3DA13 /* WriteNicknameView.swift */; }; @@ -106,6 +107,7 @@ 4D778A33290A53BA00C15AC4 /* Application+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Application+Extension.swift"; sourceTree = ""; }; 872A7D8E2918393B004A05B8 /* PrivacyPolicyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyPolicyView.swift; sourceTree = ""; }; 8792478C2918CE450040D5C3 /* UINavigationContoller+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationContoller+Extension.swift"; sourceTree = ""; }; + 8792479A291BDF820040D5C3 /* SearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchView.swift; sourceTree = ""; }; 87E606AD2910623C00C3DA13 /* HappyAnding.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HappyAnding.entitlements; sourceTree = ""; }; 87E606AF291062F900C3DA13 /* AppleAuthCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleAuthCoordinator.swift; sourceTree = ""; }; 87E606B12910649B00C3DA13 /* SignInWithAppleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInWithAppleView.swift; sourceTree = ""; }; @@ -307,6 +309,7 @@ 87E606AE291062D300C3DA13 /* SignInViews */, F956C9F82903F87200C17621 /* ShortcutTestModel.swift */, F9914527290850370046986E /* TestUserCurationListView.swift */, + 8792479A291BDF820040D5C3 /* SearchView.swift */, 3D41EE07290A4C18008BE986 /* Launch Screen.storyboard */, ); path = Views; @@ -608,6 +611,7 @@ 87E99CC429014572009B691F /* Color+Extension.swift in Sources */, 87E99CD929042536009B691F /* SectionType.swift in Sources */, 872A7D8F2918393B004A05B8 /* PrivacyPolicyView.swift in Sources */, + 8792479B291BDF820040D5C3 /* SearchView.swift in Sources */, 4D778A34290A53BA00C15AC4 /* Application+Extension.swift in Sources */, 87E99CBF28FFF2AB009B691F /* WriteShortcutTagView.swift in Sources */, A3766B232904330300708F83 /* ReadUserCurationView.swift in Sources */, diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift new file mode 100644 index 00000000..b4bcf5e1 --- /dev/null +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -0,0 +1,69 @@ +// +// SearchView.swift +// HappyAnding +// +// Created by 이지원 on 2022/11/09. +// + +import SwiftUI + +struct SearchView: View { + + @State var searchText: String = "" + + let result = ["result1", "result2", "ressult3"] + + var body: some View { + VStack { + searchBar + searchResultList + } + } + + + // MARK: - 검색 바 + + var searchBar: some View { + HStack { + Image(systemName: "magnifyingglass") + + TextField("단축어 이름, 앱 이름으로 검색해보세요", text: $searchText) + .onSubmit { + + // TODO: Firebase 함수 연결 + + print("Firebase 함수 호출") + } + + if !searchText.isEmpty { + Image(systemName: "xmark.circle.fill") + .onTapGesture { + withAnimation { + self.searchText = "" + } + } + } + + } + .padding(.horizontal, 16) + } + + + // MARK: - 검색 결과 + var searchResultList: some View { + List { + ForEach(result, id: \.self) { shortcut in + + Text(shortcut) + + } + } + } + +} + +struct SearchView_Previews: PreviewProvider { + static var previews: some View { + SearchView() + } +} From e5aa41b32dc6e0f6b882cd1d2823083e302bd3a6 Mon Sep 17 00:00:00 2001 From: otoolz Date: Fri, 11 Nov 2022 12:29:17 +0900 Subject: [PATCH 02/11] [feat] searchBar UI searchBar UI --- .../HappyAnding/Views/SearchView.swift | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index b4bcf5e1..e5ca1bda 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -11,19 +11,33 @@ struct SearchView: View { @State var searchText: String = "" - let result = ["result1", "result2", "ressult3"] - var body: some View { - VStack { - searchBar - searchResultList + NavigationStack { + ScrollView { + VStack { + + } + } + .searchable(text: $searchText) { + + } + .onSubmit(of: .search, runSearch) + + // searchBar + // searchResultList } } + private func runSearch() { + Task { + } + } + /* // MARK: - 검색 바 var searchBar: some View { + HStack { Image(systemName: "magnifyingglass") @@ -59,6 +73,7 @@ struct SearchView: View { } } } + */ } From 3803ee2c2cdbfc42ac8f19553ba02582fc3b1485 Mon Sep 17 00:00:00 2001 From: otoolz Date: Fri, 11 Nov 2022 13:25:27 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[feat]=20=EC=84=9C=EC=B9=98=EB=B7=B0=20?= =?UTF-8?q?=EC=B6=94=EC=B2=9C=EA=B2=80=EC=83=89=EC=96=B4=20=ED=8C=8C?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서치뷰 추천검색어 파트 추가 --- .../HappyAnding/Views/SearchView.swift | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index e5ca1bda..8e447846 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -10,21 +10,25 @@ import SwiftUI struct SearchView: View { @State var searchText: String = "" + @State var searchResult: [Shortcuts] = [] + + let keywords: [String] = ["단축어", "갓생", "포항꿀주먹"] var body: some View { NavigationStack { ScrollView { - VStack { - + if searchText == "" && searchResult.count == 0 { + recommendKeword + } else { + VStack { + Text("hi") + } } } .searchable(text: $searchText) { } .onSubmit(of: .search, runSearch) - - // searchBar - // searchResultList } } @@ -33,6 +37,30 @@ struct SearchView: View { } } + var recommendKeword: some View { + VStack(alignment: .leading) { + Text("추천 검색어") + .padding(.leading, 16) + + ScrollView(.horizontal) { + HStack { + // TODO: 선택된 텍스트 검색하는 기능 + ForEach(keywords, id: \.self) { keyword in + Text(keyword) + .Body2() + .foregroundColor(Color.Gray4) + .padding(10) + .overlay( + RoundedRectangle(cornerRadius: 12) + .stroke(Color.Gray4, lineWidth: 1) + ) + } + } + .padding(.leading, 16) + } + } + } + /* // MARK: - 검색 바 From 59f835c84580b138d96f4551ce3785a09f67456c Mon Sep 17 00:00:00 2001 From: otoolz Date: Fri, 11 Nov 2022 14:27:58 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[Feat]=20=EA=B2=B0=EA=B3=BC=20=EC=85=80?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 결과 셀 수정 --- HappyAnding/HappyAnding/Views/SearchView.swift | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index 8e447846..cb18feca 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -9,24 +9,31 @@ import SwiftUI struct SearchView: View { + @State var isSearched: Bool = false @State var searchText: String = "" - @State var searchResult: [Shortcuts] = [] + @State var searchResults: [Shortcuts] = [] + + let test = Shortcuts(sfSymbol: "leaf", color: "Blue", title: "hihi", subtitle: "hihi", description: "hihi", category: ["lifestyle"], requiredApp: [], numberOfLike: 10, numberOfDownload: 10, author: "hongki", shortcutRequirements: "", downloadLink: ["lasdkfjl"], curationIDs: ["aslkfjaklsdjfk"]) let keywords: [String] = ["단축어", "갓생", "포항꿀주먹"] var body: some View { NavigationStack { ScrollView { - if searchText == "" && searchResult.count == 0 { + if !isSearched { recommendKeword } else { VStack { - Text("hi") + ForEach(searchResults, id: \.self) { result in + ShortcutCell(shortcut: result) + .listRowInsets(EdgeInsets()) + .listRowSeparator(.hidden) + } } } } .searchable(text: $searchText) { - + recommendKeword } .onSubmit(of: .search, runSearch) } @@ -34,6 +41,8 @@ struct SearchView: View { private func runSearch() { Task { + isSearched = true + searchResults.append(test) } } From 2a85684d9eee90b9da43f84078045b13dcdf95eb Mon Sep 17 00:00:00 2001 From: otoolz Date: Fri, 11 Nov 2022 14:57:19 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[feat]=20=EC=84=9C=EC=B9=98=EB=B7=B0=20?= =?UTF-8?q?=EB=82=B4=EC=97=90=20proposeView=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서치뷰 내에 proposeView 추가 --- .../HappyAnding/Views/SearchView.swift | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index cb18feca..1a5cfda4 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -5,10 +5,15 @@ // Created by 이지원 on 2022/11/09. // +import MessageUI import SwiftUI struct SearchView: View { + @State var result: Result? = nil + @State var isShowingMailView = false + @State var isTappedLogOutButton = false + @State var isSearched: Bool = false @State var searchText: String = "" @State var searchResults: [Shortcuts] = [] @@ -23,11 +28,15 @@ struct SearchView: View { if !isSearched { recommendKeword } else { - VStack { - ForEach(searchResults, id: \.self) { result in - ShortcutCell(shortcut: result) - .listRowInsets(EdgeInsets()) - .listRowSeparator(.hidden) + if searchResults.count == 0 { + proposeView + } else { + VStack { + ForEach(searchResults, id: \.self) { result in + ShortcutCell(shortcut: result) + .listRowInsets(EdgeInsets()) + .listRowSeparator(.hidden) + } } } } @@ -42,7 +51,7 @@ struct SearchView: View { private func runSearch() { Task { isSearched = true - searchResults.append(test) + // searchResults.append(test) } } @@ -70,6 +79,43 @@ struct SearchView: View { } } + + + var proposeView: some View { + VStack(alignment: .center) { + Text("\(searchText)의 결과가 없어요.\n원하는 단축어를 제안해보는건 어떠세요?").multilineTextAlignment(.center) + .Body1() + .foregroundColor(Color.Gray4) + + Button { + + } label: { + Text("단축어 제안하기") + .padding(.horizontal, 30) + .padding(.vertical, 8) + }.buttonStyle(.borderedProminent) + .padding(16) + /* + Button(action : { + if MFMailComposeViewController.canSendMail() { + self.isShowingMailView.toggle() + } + }) { + if MFMailComposeViewController.canSendMail() { + SettingCell(title: "개발자에게 연락하기") + } + else { + SettingCell(title: "문의사항은 shortcutszip@gmail.com 으로 메일 주세요") + .multilineTextAlignment(.leading) + } + } + .sheet(isPresented: $isShowingMailView) { + MailView(isShowing: self.$isShowingMailView, result: self.$result) + }*/ + + } + } + /* // MARK: - 검색 바 From 54e3fa41b9937e8a66064d957ca061d0ab843fd1 Mon Sep 17 00:00:00 2001 From: otoolz Date: Fri, 11 Nov 2022 15:31:26 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[feat]=20=EC=84=9C=EC=B9=98=20=EB=B7=B0?= =?UTF-8?q?=20=EB=82=B4=EB=B6=80=20=EB=A1=9C=EC=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서치 뷰 내부 로직 --- .../HappyAnding/Views/SearchView.swift | 73 ++----------------- 1 file changed, 5 insertions(+), 68 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index 1a5cfda4..4155797c 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -10,10 +10,6 @@ import SwiftUI struct SearchView: View { - @State var result: Result? = nil - @State var isShowingMailView = false - @State var isTappedLogOutButton = false - @State var isSearched: Bool = false @State var searchText: String = "" @State var searchResults: [Shortcuts] = [] @@ -24,14 +20,16 @@ struct SearchView: View { var body: some View { NavigationStack { - ScrollView { + + VStack { if !isSearched { recommendKeword + Spacer() } else { if searchResults.count == 0 { proposeView } else { - VStack { + ScrollView { ForEach(searchResults, id: \.self) { result in ShortcutCell(shortcut: result) .listRowInsets(EdgeInsets()) @@ -51,7 +49,7 @@ struct SearchView: View { private func runSearch() { Task { isSearched = true - // searchResults.append(test) + // firebase 검색 기능 추가해서 searchResults에 넣기 } } @@ -95,69 +93,8 @@ struct SearchView: View { .padding(.vertical, 8) }.buttonStyle(.borderedProminent) .padding(16) - /* - Button(action : { - if MFMailComposeViewController.canSendMail() { - self.isShowingMailView.toggle() - } - }) { - if MFMailComposeViewController.canSendMail() { - SettingCell(title: "개발자에게 연락하기") - } - else { - SettingCell(title: "문의사항은 shortcutszip@gmail.com 으로 메일 주세요") - .multilineTextAlignment(.leading) - } - } - .sheet(isPresented: $isShowingMailView) { - MailView(isShowing: self.$isShowingMailView, result: self.$result) - }*/ - - } - } - - /* - // MARK: - 검색 바 - - var searchBar: some View { - - HStack { - Image(systemName: "magnifyingglass") - - TextField("단축어 이름, 앱 이름으로 검색해보세요", text: $searchText) - .onSubmit { - - // TODO: Firebase 함수 연결 - - print("Firebase 함수 호출") - } - - if !searchText.isEmpty { - Image(systemName: "xmark.circle.fill") - .onTapGesture { - withAnimation { - self.searchText = "" - } - } - } - } - .padding(.horizontal, 16) } - - - // MARK: - 검색 결과 - var searchResultList: some View { - List { - ForEach(result, id: \.self) { shortcut in - - Text(shortcut) - - } - } - } - */ - } struct SearchView_Previews: PreviewProvider { From c98405c323f33b8e63b1f59235349696da122cd6 Mon Sep 17 00:00:00 2001 From: otoolz Date: Fri, 11 Nov 2022 16:31:05 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[feat]=20=EC=84=9C=EC=B9=98=EB=B0=94=20?= =?UTF-8?q?=EC=97=B0=EA=B2=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서치바 연결 추가 --- .../ExploreShortcutView/ExploreShortcutView.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView/ExploreShortcutView.swift b/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView/ExploreShortcutView.swift index ad36f393..f1616020 100644 --- a/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView/ExploreShortcutView.swift +++ b/HappyAnding/HappyAnding/Views/ExploreShortcutViews/ExploreShortcutView/ExploreShortcutView.swift @@ -29,12 +29,22 @@ struct ExploreShortcutView: View { .navigationBarTitleDisplayMode(.large) .scrollIndicators(.hidden) .background(Color.Background) + .toolbar { + ToolbarItem { + NavigationLink(destination: SearchView()) { + Image(systemName: "magnifyingglass") + .Headline() + .foregroundColor(.Gray5) + } + } + } } } } - +/* struct ExploreShortcutView_Previews: PreviewProvider { static var previews: some View { ExploreShortcutView() } } +*/ From 872ae73ab039369faa368a527c22e6bbbfc260e7 Mon Sep 17 00:00:00 2001 From: otoolz Date: Sat, 12 Nov 2022 10:24:42 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[feat]=20=EC=84=9C=EC=B9=98=20=EC=B7=A8?= =?UTF-8?q?=EC=86=8C=20=EB=B2=84=ED=8A=BC=20=EB=88=8C=EB=A0=80=EC=9D=84=20?= =?UTF-8?q?=EB=95=8C=20=EC=84=9C=EC=B9=98=20=EC=B4=88=EA=B8=B0=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EB=B7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서치 취소 버튼 눌렀을 때 서치 초기화면 뷰 --- .../HappyAnding/Views/SearchView.swift | 60 ++++++++++++------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index 4155797c..f23544f2 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -9,41 +9,44 @@ import MessageUI import SwiftUI struct SearchView: View { + @Environment(\.isSearching) private var isSearching: Bool + @Environment(\.dismissSearch) private var dismissSearch @State var isSearched: Bool = false @State var searchText: String = "" @State var searchResults: [Shortcuts] = [] - let test = Shortcuts(sfSymbol: "leaf", color: "Blue", title: "hihi", subtitle: "hihi", description: "hihi", category: ["lifestyle"], requiredApp: [], numberOfLike: 10, numberOfDownload: 10, author: "hongki", shortcutRequirements: "", downloadLink: ["lasdkfjl"], curationIDs: ["aslkfjaklsdjfk"]) - let keywords: [String] = ["단축어", "갓생", "포항꿀주먹"] var body: some View { - NavigationStack { - - VStack { - if !isSearched { - recommendKeword - Spacer() + VStack { + if !isSearched { + recommendKeword + Spacer() + } else { + if searchResults.count == 0 { + proposeView } else { - if searchResults.count == 0 { - proposeView - } else { - ScrollView { - ForEach(searchResults, id: \.self) { result in - ShortcutCell(shortcut: result) - .listRowInsets(EdgeInsets()) - .listRowSeparator(.hidden) - } + ScrollView { + ForEach(searchResults, id: \.self) { result in + ShortcutCell(shortcut: result) + .listRowInsets(EdgeInsets()) + .listRowSeparator(.hidden) } } - } + } } - .searchable(text: $searchText) { - recommendKeword - } - .onSubmit(of: .search, runSearch) } + .searchable(text: $searchText) + .onSubmit(of: .search, runSearch) + .onChange(of: searchText) { value in + if searchText.isEmpty && !isSearching { + // Search cancelled here + print("canceled") + searchResults.removeAll() + isSearched = false + } + } .navigationBarTitleDisplayMode(.inline) } private func runSearch() { @@ -97,6 +100,19 @@ struct SearchView: View { } } +struct CheckSearchView: View { + @Environment(\.isSearching) var isSearching + let content: (Bool) -> Content + + var body: some View { + content(isSearching) + } + + init(@ViewBuilder content: @escaping (Bool) -> Content) { + self.content = content + } +} + struct SearchView_Previews: PreviewProvider { static var previews: some View { SearchView() From 8140a9f9ae56fe031548cd373ba346c1a86dd5e0 Mon Sep 17 00:00:00 2001 From: otoolz Date: Sat, 12 Nov 2022 10:29:29 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[feat]=20=EC=85=80=20=EB=84=A4=EB=B9=84?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=EC=85=98=EB=A7=81=ED=81=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 셀 네비게이션링크 추가 --- HappyAnding/HappyAnding/Views/SearchView.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index f23544f2..cc7dd9c3 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -29,9 +29,11 @@ struct SearchView: View { } else { ScrollView { ForEach(searchResults, id: \.self) { result in - ShortcutCell(shortcut: result) - .listRowInsets(EdgeInsets()) - .listRowSeparator(.hidden) + NavigationLink(destination: ReadShortcutView(shortcutID: result.id)) { + ShortcutCell(shortcut: result) + .listRowInsets(EdgeInsets()) + .listRowSeparator(.hidden) + } } } } From 8d3bb7d9c79bf2b69e9e4317cc93db8cd1236310 Mon Sep 17 00:00:00 2001 From: otoolz <91725382+otoolz@users.noreply.github.com> Date: Sat, 12 Nov 2022 20:19:24 +0900 Subject: [PATCH 10/11] Update HappyAnding/HappyAnding/Views/SearchView.swift Co-authored-by: Elie (Jeon Jimin) <41153398+JMM00@users.noreply.github.com> --- HappyAnding/HappyAnding/Views/SearchView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index cc7dd9c3..7d48b901 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -91,7 +91,7 @@ struct SearchView: View { .foregroundColor(Color.Gray4) Button { - + //TODO: 버튼 클릭 시 단축어 제안하는 페이지 연결 } label: { Text("단축어 제안하기") .padding(.horizontal, 30) From 5df2ddd9b270a6e1c00257dad0c64c0c413f0896 Mon Sep 17 00:00:00 2001 From: otoolz Date: Mon, 14 Nov 2022 17:11:23 +0900 Subject: [PATCH 11/11] =?UTF-8?q?[feat]=20PR=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR 수정 요청 사항 반영 --- .../HappyAnding/Views/SearchView.swift | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/HappyAnding/HappyAnding/Views/SearchView.swift b/HappyAnding/HappyAnding/Views/SearchView.swift index cc7dd9c3..c0175426 100644 --- a/HappyAnding/HappyAnding/Views/SearchView.swift +++ b/HappyAnding/HappyAnding/Views/SearchView.swift @@ -49,6 +49,7 @@ struct SearchView: View { isSearched = false } } .navigationBarTitleDisplayMode(.inline) + .background(Color.Background) } private func runSearch() { @@ -77,13 +78,11 @@ struct SearchView: View { ) } } - .padding(.leading, 16) + .padding(.leading, 12) } } } - - var proposeView: some View { VStack(alignment: .center) { Text("\(searchText)의 결과가 없어요.\n원하는 단축어를 제안해보는건 어떠세요?").multilineTextAlignment(.center) @@ -94,24 +93,13 @@ struct SearchView: View { } label: { Text("단축어 제안하기") - .padding(.horizontal, 30) + .padding(.horizontal, 28) .padding(.vertical, 8) }.buttonStyle(.borderedProminent) .padding(16) } - } -} - -struct CheckSearchView: View { - @Environment(\.isSearching) var isSearching - let content: (Bool) -> Content - - var body: some View { - content(isSearching) - } - - init(@ViewBuilder content: @escaping (Bool) -> Content) { - self.content = content + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background(Color.Background) } }