Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Keychy/Keychy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
4C25259C2F303745003CC5AD /* WidgetBundleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C25259B2F303745003CC5AD /* WidgetBundleModel.swift */; };
4C25259D2F3037CD003CC5AD /* WidgetBundleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C25259B2F303745003CC5AD /* WidgetBundleModel.swift */; };
4C25259E2F3037D6003CC5AD /* BundleImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6B5707E2EC206CD0049F969 /* BundleImageCache.swift */; };
4C2525DA2F35B2A7003CC5AD /* BundleSheetFilterBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C2525D92F35B2A7003CC5AD /* BundleSheetFilterBar.swift */; };
4C3687F72EBFA87800C64E75 /* Pretendard-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4C3687F62EBFA87800C64E75 /* Pretendard-Medium.ttf */; };
4C3687FA2EBFC0FB00C64E75 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3687F82EBFC0FB00C64E75 /* NotificationManager.swift */; };
4C3687FC2EC05E6800C64E75 /* AccountAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3687FB2EC05E6800C64E75 /* AccountAlert.swift */; };
Expand Down Expand Up @@ -362,7 +363,6 @@
AA3909462EC9F29500D87EEC /* UIApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3909452EC9F29500D87EEC /* UIApplication+Extension.swift */; };
AA39098E2ECA061700D87EEC /* GridItemSpacing.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA39098D2ECA061700D87EEC /* GridItemSpacing.swift */; };
AA390CE52ECC60A700D87EEC /* BundleRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA390CE42ECC60A700D87EEC /* BundleRoute.swift */; };
AA4B07322EB26CD2005F9227 /* BundleAddKeyringView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA4B07312EB26CD2005F9227 /* BundleAddKeyringView.swift */; };
AA6298522EC233D2001576C0 /* BundleEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA6298512EC233D2001576C0 /* BundleEditView.swift */; };
AA6298542EC39065001576C0 /* BundleCreateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA6298532EC39065001576C0 /* BundleCreateView.swift */; };
AA6298562EC3AD16001576C0 /* DraggableSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA6298552EC3AD16001576C0 /* DraggableSheet.swift */; };
Expand Down Expand Up @@ -559,6 +559,7 @@
4C004FBA2F19F1FE00D9063E /* RootViewModel+ReviewCheck.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RootViewModel+ReviewCheck.swift"; sourceTree = "<group>"; };
4C07024A2ECF10760026D6DC /* EffectSyncManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EffectSyncManager.swift; sourceTree = "<group>"; };
4C25259B2F303745003CC5AD /* WidgetBundleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetBundleModel.swift; sourceTree = "<group>"; };
4C2525D92F35B2A7003CC5AD /* BundleSheetFilterBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleSheetFilterBar.swift; sourceTree = "<group>"; };
4C3687F62EBFA87800C64E75 /* Pretendard-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Pretendard-Medium.ttf"; sourceTree = "<group>"; };
4C3687F82EBFC0FB00C64E75 /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = "<group>"; };
4C3687FB2EC05E6800C64E75 /* AccountAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountAlert.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -813,7 +814,6 @@
AA3909452EC9F29500D87EEC /* UIApplication+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Extension.swift"; sourceTree = "<group>"; };
AA39098D2ECA061700D87EEC /* GridItemSpacing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GridItemSpacing.swift; sourceTree = "<group>"; };
AA390CE42ECC60A700D87EEC /* BundleRoute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleRoute.swift; sourceTree = "<group>"; };
AA4B07312EB26CD2005F9227 /* BundleAddKeyringView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleAddKeyringView.swift; sourceTree = "<group>"; };
AA6298512EC233D2001576C0 /* BundleEditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleEditView.swift; sourceTree = "<group>"; };
AA6298532EC39065001576C0 /* BundleCreateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleCreateView.swift; sourceTree = "<group>"; };
AA6298552EC3AD16001576C0 /* DraggableSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DraggableSheet.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1794,6 +1794,7 @@
AA2146B42F15D8490048D40E /* KeyringCell.swift */,
AAA4467B2EC64C9900080AB1 /* SelectBackgroundSheet.swift */,
AAA446812EC6519700080AB1 /* SelectCarabinerSheet.swift */,
4C2525D92F35B2A7003CC5AD /* BundleSheetFilterBar.swift */,
AA9115092EB1B7930026E9BC /* AddKeyringButton.swift */,
AA6298572EC457DF001576C0 /* CarabinerPopup.swift */,
F82FD6112F9442AAAD58DB97 /* BundleSheetToggleButtons.swift */,
Expand Down Expand Up @@ -2117,7 +2118,6 @@
children = (
AA6298532EC39065001576C0 /* BundleCreateView.swift */,
AA0219DD2EB1C041006EF269 /* BundleNameInputView.swift */,
AA4B07312EB26CD2005F9227 /* BundleAddKeyringView.swift */,
);
path = Create;
sourceTree = "<group>";
Expand Down Expand Up @@ -2446,7 +2446,6 @@
files = (
C6C4028F2EB27458006B58DF /* Particle.swift in Sources */,
AA0A54B72EC053E4007B5413 /* CarabinerType.swift in Sources */,
AA4B07322EB26CD2005F9227 /* BundleAddKeyringView.swift in Sources */,
4CEC61E52EAE08C00099ECEE /* KeyringBundle.swift in Sources */,
4C004FAD2F177F2600D9063E /* BundleDetailView+VideoGen.swift in Sources */,
386102462F10F9CE0045C529 /* KeyringReceiveView+Alerts.swift in Sources */,
Expand Down Expand Up @@ -2740,6 +2739,7 @@
4CEC627F2EAE08DF0099ECEE /* CollectionView.swift in Sources */,
AA0A54B92EC05C41007B5413 /* BundleRingComponent.swift in Sources */,
C6C361422ED44EE4009642F4 /* Showcase25BoardView+Sheet.swift in Sources */,
4C2525DA2F35B2A7003CC5AD /* BundleSheetFilterBar.swift in Sources */,
3828F5452EC4CC0A00F1B040 /* CollectionViewModel+Filter.swift in Sources */,
38C3C28A2EC1D879003C5DE1 /* UnpackPopup.swift in Sources */,
C6C361E42ED4AF48009642F4 /* Showcase25BoardView+Grid.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ struct BackToolbarButton: View {
// MARK: - Next Toolbar Button
struct NextToolbarButton: View {
let title: String
let isDisabled: Bool
let action: () -> Void

init(
title: String = "다음",
isDisabled: Bool = false,
action: @escaping () -> Void
) {
self.title = title
self.isDisabled = isDisabled
self.action = action
}

Expand All @@ -41,10 +44,11 @@ struct NextToolbarButton: View {
Text(title)
.typography(.suit17B)
.padding(4)
.foregroundStyle(.black100)
.foregroundStyle(isDisabled ? .gray300 : .black100)
}
.frame(width: 62, height: 44)
.glassEffect(.regular.interactive(), in: .capsule)
.disabled(isDisabled)
}
}

Expand Down
30 changes: 17 additions & 13 deletions Keychy/Keychy/Core/Components/View/Popup/BundleSwitchPopup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,28 @@ struct BundleSwitchPopup: View {
}

var body: some View {
VStack(alignment: .leading, spacing: 0) {
// 대표 섹션
if let main = mainBundle {
mainSection(bundle: main)
}
ScrollView(showsIndicators: false) {
VStack(alignment: .leading, spacing: 0) {
// 대표 섹션
if let main = mainBundle {
mainSection(bundle: main)
}

// 구분선
Rectangle()
.fill(.gray100)
.frame(height: 1)
.padding(.horizontal, 18)
// 구분선
Rectangle()
.fill(.gray100)
.frame(height: 1)
.padding(.horizontal, 18)

// 선택 섹션
if !selectableBundles.isEmpty {
selectSection(bundles: selectableBundles)
// 선택 섹션
if !selectableBundles.isEmpty {
selectSection(bundles: selectableBundles)
}
}
}
.scrollBounceBehavior(.basedOnSize)
.frame(width: 196)
.frame(maxHeight: 270)
.padding(.vertical, 5)
.glassEffect(.regular.interactive(), in: .rect(cornerRadius: 34))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct Typography {
static let nanum17EB = Typography(font: .custom(.nanumExtraBold, size: 17), lineSpacing: 0)
static let nanum16EB = Typography(font: .custom(.nanumExtraBold, size: 16), lineSpacing: 0)
static let nanum12EB = Typography(font: .custom(.nanumExtraBold, size: 12), lineSpacing: 0)
static let nanum13EB = Typography(font: .custom(.nanumExtraBold, size: 13), lineSpacing: 0)

static let nanum15EB25 = Typography(font: .custom(.nanumExtraBold, size: 15), lineSpacing: 10)
static let nanum15B25 = Typography(font: .custom(.nanumBold, size: 15), lineSpacing: 10)
Expand Down
1 change: 0 additions & 1 deletion Keychy/Keychy/Core/Navigation/Routes/BundleRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ protocol BundleRoute: Hashable {
static var bundleInventoryView: Self { get }
static var bundleDetailView: Self { get }
static var bundleCreateView: Self { get }
static var bundleAddKeyringView: Self { get }
static var bundleNameInputView: Self { get }
static var bundleNameEditView: Self { get }
static var bundleEditView: Self { get }
Expand Down
1 change: 0 additions & 1 deletion Keychy/Keychy/Core/Navigation/Routes/CollectionRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ enum CollectionRoute: Hashable, BundleRoute {
case bundleInventoryView
case bundleDetailView
case bundleCreateView
case bundleAddKeyringView
case bundleNameInputView
case bundleNameEditView
case bundleEditView
Expand Down
1 change: 0 additions & 1 deletion Keychy/Keychy/Core/Navigation/Routes/HomeRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ enum HomeRoute: Hashable, BundleRoute {
case bundleInventoryView
case bundleDetailView
case bundleCreateView
case bundleAddKeyringView
case bundleNameInputView
case bundleNameEditView
case bundleEditView
Expand Down
1 change: 0 additions & 1 deletion Keychy/Keychy/Core/Navigation/Routes/WorkshopRoute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ enum WorkshopRoute: Hashable, BundleRoute {
case bundleInventoryView
case bundleDetailView
case bundleCreateView
case bundleAddKeyringView
case bundleNameInputView
case bundleNameEditView
case bundleEditView
Expand Down
50 changes: 50 additions & 0 deletions Keychy/Keychy/Presentation/Bundle/ViewModels/BundleViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,56 @@ class BundleViewModel {
var isLoading = false
var isPurchasing = false

// MARK: - 시트 필터/정렬 상태

var sheetSortOrder: String = "최신순"
var sheetShowFreeOnly: Bool = false
var sheetShowOwnedOnly: Bool = false
var showSheetSortSheet: Bool = false

/// 시트 필터/정렬 상태 초기화
func resetSheetFilterState() {
sheetSortOrder = "최신순"
sheetShowFreeOnly = false
sheetShowOwnedOnly = false
showSheetSortSheet = false
}

/// 편집 화면 상태 초기화 (편집 화면 나갈 때 호출)
func resetEditState() {
newSelectedBackground = nil
newSelectedCarabiner = nil
selectedKeyrings = [:]
keyringOrder = []
selectedKeyringPosition = 0
}

/// 현재 선택 상태를 UserDefaults에 임시 저장 (코인 충전 등 화면 이동 전)
func saveCurrentSelection() {
if let bg = newSelectedBackground {
UserDefaults.standard.set(bg.background.id, forKey: "tempSelectedBackgroundId")
}
if let cb = newSelectedCarabiner {
UserDefaults.standard.set(cb.carabiner.id, forKey: "tempSelectedCarabinerId")
}
}

/// UserDefaults에서 선택 상태 복원 (복원 후 삭제)
func restoreSelectionIfNeeded() {
if let savedBackgroundId = UserDefaults.standard.string(forKey: "tempSelectedBackgroundId") {
if let restoredBackground = backgroundViewData.first(where: { $0.background.id == savedBackgroundId }) {
newSelectedBackground = restoredBackground
}
UserDefaults.standard.removeObject(forKey: "tempSelectedBackgroundId")
}
if let savedCarabinerId = UserDefaults.standard.string(forKey: "tempSelectedCarabinerId") {
if let restoredCarabiner = carabinerViewData.first(where: { $0.carabiner.id == savedCarabinerId }) {
newSelectedCarabiner = restoredCarabiner
}
UserDefaults.standard.removeObject(forKey: "tempSelectedCarabinerId")
}
}

// MARK: - 편집 화면용 데이터

var newSelectedBackground: BackgroundViewData?
Expand Down
Loading