Skip to content

Commit

Permalink
Merge pull request Team-ShortcutsZip#527 from Team-ShortcutsZip/featu…
Browse files Browse the repository at this point in the history
…re/523-SearchView

[Feat] Team-ShortcutsZip#523 - SearchView UI 구현
  • Loading branch information
JMM00 authored Apr 20, 2024
2 parents 001928e + c09d62b commit 9eaf790
Show file tree
Hide file tree
Showing 13 changed files with 559 additions and 133 deletions.
29 changes: 20 additions & 9 deletions HappyAnding/HappyAnding.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
F9DB8EBB293986E100516CE1 /* ShareExtensionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F976E85029395B350088BBA1 /* ShareExtensionViewModel.swift */; };
F9DB8EBD293987BD00516CE1 /* ShareExtensionCustomTextEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DB8EBC293987BD00516CE1 /* ShareExtensionCustomTextEditor.swift */; };
F9DB8ED3293B4C3200516CE1 /* ShareExtensionTagTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DB8ED2293B4C3200516CE1 /* ShareExtensionTagTextField.swift */; };
F9E7073A2BC6933000319533 /* SearchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E707392BC6933000319533 /* SearchViewModel.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -359,6 +360,7 @@
F9DB8EB82939853D00516CE1 /* ShareExtensionValidationTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareExtensionValidationTextField.swift; sourceTree = "<group>"; };
F9DB8EBC293987BD00516CE1 /* ShareExtensionCustomTextEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareExtensionCustomTextEditor.swift; sourceTree = "<group>"; };
F9DB8ED2293B4C3200516CE1 /* ShareExtensionTagTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareExtensionTagTextField.swift; sourceTree = "<group>"; };
F9E707392BC6933000319533 /* SearchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewModel.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -562,6 +564,7 @@
A34BF82929AFC308009BC946 /* FeatureViews */,
87E606AE291062D300C3DA13 /* SignInViews */,
8792479A291BDF820040D5C3 /* SearchView.swift */,
F9E707392BC6933000319533 /* SearchViewModel.swift */,
3D41EE07290A4C18008BE986 /* Launch Screen.storyboard */,
F9136EB5293612310034AAB2 /* ShortcutsZipView.swift */,
);
Expand Down Expand Up @@ -687,7 +690,6 @@
F91F09DC29AE012600E04FA0 /* ShortcutGrade.swift */,
872B5D3C2A2E0FF9008DCC57 /* CurationType.swift */,
A323D3C92AEE870700DDA716 /* SuggestionForm.swift */,
F980171D2BBC2A24004F2EA7 /* ExploreShortcutSectionType.swift */,
);
path = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -1039,6 +1041,7 @@
A323D3CA2AEE870700DDA716 /* SuggestionForm.swift in Sources */,
4DF15D752A4ECE1F0014F854 /* ListCategoryShortcutViewModel.swift in Sources */,
87E99CDB29042CCA009B691F /* Category.swift in Sources */,
F9E7073A2BC6933000319533 /* SearchViewModel.swift in Sources */,
876B4F6F299E3D91009672D9 /* NavigationRouter.swift in Sources */,
F98017202BBC2A6F004F2EA7 /* ExploreCell.swift in Sources */,
A04ACB062903D0B2004A85A6 /* MyShortcutCardView.swift in Sources */,
Expand Down Expand Up @@ -1340,7 +1343,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20231113;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20240317;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand Down Expand Up @@ -1383,7 +1386,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20231113;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipProfile_Dev_20240317;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand All @@ -1398,14 +1401,16 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 7JPPWR5997;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAndingTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1418,14 +1423,16 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 7JPPWR5997;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAndingTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1437,13 +1444,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 7JPPWR5997;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAndingUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1455,13 +1464,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 7JPPWR5997;
DEVELOPMENT_TEAM = "";
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAndingUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -1492,7 +1503,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20231113;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20240317;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -1524,7 +1535,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.happyanding.HappyAnding.ShareExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20231113;
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = ShortcutsZipShareExtProfile_Dev_20240317;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down
12 changes: 10 additions & 2 deletions HappyAnding/HappyAnding/Extensions/SCZ+Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ struct GradientType {
}

struct SCZColor {
static let defaultColor = Red().light.fillGradient()
static let colors: [String: ColorProtocol] = [
"Red": Red(),
"Coral": Coral(),
Expand All @@ -71,6 +70,7 @@ struct SCZColor {
"Teal": Teal(),
"Cyan": Cyan(),
"Blue": Blue(),
"Pink": Pink(),
"Purple": Purple(),
"LightPurple": Lavendar(),
"Silver": Silver(),
Expand Down Expand Up @@ -565,7 +565,7 @@ extension SCZColor {
)
}
struct CharcoalGray {
static let color: Color = Color(hexString: "404040")
static let color = Color(hexString: "404040")
static let opacity88 = Color(hexString: "404040", opacity: 0.88)
static let opacity64 = Color(hexString: "404040", opacity: 0.64)
static let opacity48 = Color(hexString: "404040", opacity: 0.48)
Expand All @@ -574,4 +574,12 @@ extension SCZColor {
static let opacity08 = Color(hexString: "404040", opacity: 0.08)
static let opacity04 = Color(hexString: "404040", opacity: 0.04)
}

struct SCZBlue {
static let strong = Color(hexString: "3366FF")
static let opacity88 = Color(hexString: "4B78FF")
static let opacity48 = Color(hexString: "9DB6FF")
static let opacity16 = Color(hexString: "DEE7FF")
static let opacity08 = Color(hexString: "EFF3FF")
}
}
8 changes: 8 additions & 0 deletions HappyAnding/HappyAnding/Extensions/SCZColor.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// SCZColor.swift
// HappyAnding
//
// Created by JeonJimin on 4/10/24.
//

import Foundation
16 changes: 16 additions & 0 deletions HappyAnding/HappyAnding/Extensions/String/String+Date.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,20 @@ extension String {

return date
}

func getPostDateFormat() -> String? {
let inputFormatter = DateFormatter()
inputFormatter.dateFormat = "yyyyMMddHHmmss"

if let date = inputFormatter.date(from: self) {
let outputFormatter = DateFormatter()
outputFormatter.locale = Locale(identifier: "ko_KR")
outputFormatter.dateFormat = "M월 d일 a h시 m분"

let output = outputFormatter.string(from: date)
return output
} else {
return nil
}
}
}
5 changes: 0 additions & 5 deletions HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ extension View {
ListCurationView(viewModel: ListCurationViewModel(data: data as! CurationType))
case is User:
ShowProfileView(viewModel: ShowProfileViewModel(data: data as! User))
case is NavigationSearch:
SearchView()
case is Category:
ListCategoryShortcutView(viewModel: ListCategoryShortcutViewModel(data: data as! Category))
case is NavigationNicknameView:
Expand Down Expand Up @@ -141,9 +139,6 @@ struct NavigationViewModifier: ViewModifier {
.navigationDestination(for: NavigationWithdrawal.self) { _ in
WithdrawalView()
}
.navigationDestination(for: NavigationSearch.self) { _ in
SearchView()
}
.navigationDestination(for: NavigationSettingView.self) { _ in
SettingView()
}
Expand Down
8 changes: 4 additions & 4 deletions HappyAnding/HappyAnding/Model/SectionType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ enum SectionType {
case .popular:
return Image(systemName: self.icon)
.foregroundStyle(
Color(hexString: "3366FF", opacity: 0.88),
Color(hexString: "3366FF", opacity: 0.88)
SCZColor.SCZBlue.opacity88,
SCZColor.SCZBlue.opacity88
)
case .myShortcut:
return Image(systemName: "square.text.square.fill")
Expand All @@ -101,8 +101,8 @@ enum SectionType {
case .myLovingShortcut:
return Image(systemName: "heart.fill")
.foregroundStyle(
Color(hexString: "3366FF", opacity: 0.88),
Color(hexString: "3366FF", opacity: 0.88)
SCZColor.SCZBlue.opacity88,
SCZColor.SCZBlue.opacity88
)
}
}
Expand Down
12 changes: 12 additions & 0 deletions HappyAnding/HappyAnding/TextLiteral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,18 @@ enum TextLiteral {
static let searchViewRecommendedKeyword: String = "추천 검색어"
static let searchViewProposal: String = "단축어 제안하기"
static let searchViewProposalURL: String = "https://docs.google.com/forms/d/e/1FAIpQLScQc3KeYjDGCE-C2YRU-Hwy2XNy5bt89KVX1OMUzRiySaMX1Q/viewform"
static let searchViewMoreResult: String = "더 많은 검색 결과 보기"
static let searchViewRelatedShortcut: String = "관련된 단축어"
static let searchVIewRelatedPost: String = "관련된 글"
static func searchViewEmptyResult(_ searchText: String) -> String {
return "😵 \'\(searchText)\'에 관련된 단축어나 글이 없어요."
}
static func searchTextRelatedShortcutShare(_ searchText: String) -> String {
return "\'\(searchText)\' 관련 단축어 공유하기"
}
static func searchTextRelatedPost(_ searchText: String) -> String {
return "\'\(searchText)\' 관련 질문하기"
}

//MARK: - CustomShareViewController
static let customShareViewControllerSignInAlertTitle: String = "로그인을 먼저 진행해주세요"
Expand Down
4 changes: 2 additions & 2 deletions HappyAnding/HappyAnding/Views/Components/ExploreCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct OrderedCell: View {
}
.padding(12)
.frame(width: 108, height: 144, alignment: .top)
.background( SCZColor.colors[shortcut.color]?.color(for: colorScheme).fillGradient() ?? SCZColor.defaultColor)
.background( SCZColor.colors[shortcut.color]?.color(for: colorScheme).fillGradient() ?? Color.clear.toGradient())
.cornerRadius(16)
.roundedBorder(cornerRadius: 16, color: Color.white, isNormalBlend: true, opacity: 0.12)
}
Expand All @@ -66,7 +66,7 @@ struct UnorderedCell: View{
HStack {
RoundedRectangle(cornerRadius: 1)
.frame(width: 2, height: 30)
.foregroundStyle(SCZColor.colors[shortcut.color]?.color(for: colorScheme).fillGradient() ?? SCZColor.defaultColor)
.foregroundStyle(SCZColor.colors[shortcut.color]?.color(for: colorScheme).fillGradient() ?? Color.clear.toGradient())
Image(systemName: shortcut.sfSymbol)
.foregroundStyle(SCZColor.CharcoalGray.opacity88)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ShortcutIcon: View {
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 13)
.foregroundStyle(SCZColor.colors[color]?.color(for: colorScheme).fillGradient() ?? SCZColor.defaultColor)
.foregroundStyle(SCZColor.colors[color]?.color(for: colorScheme).fillGradient() ?? Color.clear.toGradient())
.roundedBorder(cornerRadius: 13, color: .white, isNormalBlend: true, opacity: 0.24)
.frame(width: size, height: size)
Image(systemName: sfSymbol)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct ExploreShortcutView: View {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 12) {
PromoteSection(items: viewModel.fetchAdminCuration())
.padding(.top, 12)
ForEach (sectionType, id: \.self) { type in
CardSection(type: type, shortcuts: viewModel.fetchShortcuts(by: type))
}
Expand All @@ -32,7 +33,6 @@ struct ExploreShortcutView: View {
withAnimation {
isSearchActivated.toggle()
}
print("검색창")
} label: {
Image(systemName: "sparkle.magnifyingglass")
.symbolRenderingMode(.palette)
Expand All @@ -52,7 +52,7 @@ struct ExploreShortcutView: View {
Image(systemName: "bell.badge.fill")
.symbolRenderingMode(.palette)
.foregroundStyle(
Color(hexString: "3366FF"),
SCZColor.SCZBlue.strong,
LinearGradient(
colors: [SCZColor.CharcoalGray.opacity88, SCZColor.CharcoalGray.opacity48],
startPoint: .top,
Expand Down
Loading

0 comments on commit 9eaf790

Please sign in to comment.