From 2c252b7d412f43584ca7871e7d0303c459827727 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Thu, 14 Mar 2024 04:29:16 +0900 Subject: [PATCH 1/7] =?UTF-8?q?remove:=20Profile=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iBox/Sources/MyPage/MyPageView.swift | 61 +------------------ iBox/Sources/MyPage/Profile/ProfileView.swift | 12 ---- .../Profile/ProfileViewController.swift | 27 -------- 3 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 iBox/Sources/MyPage/Profile/ProfileView.swift delete mode 100644 iBox/Sources/MyPage/Profile/ProfileViewController.swift diff --git a/iBox/Sources/MyPage/MyPageView.swift b/iBox/Sources/MyPage/MyPageView.swift index 8e75fd9..86d8c5a 100644 --- a/iBox/Sources/MyPage/MyPageView.swift +++ b/iBox/Sources/MyPage/MyPageView.swift @@ -15,27 +15,6 @@ final class MyPageView: UIView { private var cancellables = Set() // MARK: - UI Components - - let profileView = UIView().then { - $0.isUserInteractionEnabled = true - } - - let profileImageView = UIImageView().then { - $0.image = UIImage(systemName: "person.crop.circle") - $0.tintColor = .box2 - } - - let profileLabel = UILabel().then { - $0.text = "예시입니당" - $0.font = .systemFont(ofSize: 17, weight: .semibold) - } - - let chevronButton = UIButton().then { - $0.configuration = .plain() - $0.configuration?.image = UIImage(systemName: "chevron.right") - $0.configuration?.preferredSymbolConfigurationForImage = .init(pointSize: 10, weight: .bold) - $0.tintColor = .systemGray3 - } let tableView = UITableView().then { $0.register(MyPageItemCell.self, forCellReuseIdentifier: MyPageItemCell.reuseIdentifier) @@ -62,49 +41,15 @@ final class MyPageView: UIView { private func setupProperty() { tableView.delegate = self tableView.dataSource = self - - profileView.addGestureRecognizer( - UITapGestureRecognizer( - target: self, - action: #selector(profileViewTapped) - ) - ) } private func setupHierarchy() { - addSubview(profileView) - profileView.addSubview(profileImageView) - profileView.addSubview(profileLabel) - profileView.addSubview(chevronButton) addSubview(tableView) } private func setupLayout() { - profileView.snp.makeConstraints { make in - make.leading.top.trailing.equalToSuperview() - make.height.equalTo(90) - } - - profileImageView.snp.makeConstraints { make in - make.leading.equalToSuperview().inset(20) - make.centerY.equalToSuperview() - make.width.height.equalTo(50) - } - - profileLabel.snp.makeConstraints { make in - make.leading.equalTo(profileImageView.snp.trailing).offset(10) - make.centerY.equalToSuperview() - } - - chevronButton.snp.makeConstraints { make in - make.trailing.equalToSuperview().inset(30) - make.centerY.equalToSuperview() - make.width.height.equalTo(20) - } - tableView.snp.makeConstraints { make in - make.top.equalTo(profileView.snp.bottom).offset(10) - make.leading.bottom.trailing.equalToSuperview() + make.edges.equalToSuperview() } } @@ -124,10 +69,6 @@ final class MyPageView: UIView { // MARK: - Action Functions - @objc private func profileViewTapped() { - delegate?.pushViewController(ProfileViewController()) - } - @objc private func handleSwitchControlTap(_ controlSwitch: UISwitch) { guard let viewModel = viewModel else { return } viewModel.input.send(.setPreload(controlSwitch.isOn)) diff --git a/iBox/Sources/MyPage/Profile/ProfileView.swift b/iBox/Sources/MyPage/Profile/ProfileView.swift deleted file mode 100644 index c209b83..0000000 --- a/iBox/Sources/MyPage/Profile/ProfileView.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// ProfileView.swift -// iBox -// -// Created by jiyeon on 1/3/24. -// - -import UIKit - -class ProfileView: UIView { - -} diff --git a/iBox/Sources/MyPage/Profile/ProfileViewController.swift b/iBox/Sources/MyPage/Profile/ProfileViewController.swift deleted file mode 100644 index a60cdef..0000000 --- a/iBox/Sources/MyPage/Profile/ProfileViewController.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ProfileViewController.swift -// iBox -// -// Created by jiyeon on 1/3/24. -// - -import UIKit - -class ProfileViewController: BaseViewController, BaseViewControllerProtocol { - - // MARK: - Life Cycle - - override func viewDidLoad() { - super.viewDidLoad() - setupNavigationBar() - } - - // MARK: - BaseViewControllerProtocol - - func setupNavigationBar() { - setNavigationBarTitleLabelText("내 정보 수정하기") - setNavigationBarTitleLabelFont(.systemFont(ofSize: 17, weight: .semibold)) - setNavigationBarBackButtonHidden(false) - } - -} From 728edbf78664ff4a2971f5f2f8e74321bed27642 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Thu, 14 Mar 2024 04:30:12 +0900 Subject: [PATCH 2/7] =?UTF-8?q?chore:=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=AF=B8=EB=A6=AC=20=EB=A1=9C=EB=93=9C=20->=20=EC=A6=90?= =?UTF-8?q?=EA=B2=A8=EC=B0=BE=EA=B8=B0=20=EB=AF=B8=EB=A6=AC=20=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=EB=A1=9C=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iBox/Sources/Model/MyPageItem.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iBox/Sources/Model/MyPageItem.swift b/iBox/Sources/Model/MyPageItem.swift index 790c1c1..3f16d71 100644 --- a/iBox/Sources/Model/MyPageItem.swift +++ b/iBox/Sources/Model/MyPageItem.swift @@ -19,7 +19,7 @@ enum MyPageType { switch self { case .theme: "테마" case .homeTab: "홈화면" - case .preload: "페이지 미리 로드" + case .preload: "즐겨찾기 미리 로드" case .guide: "이용 가이드" case .feedback: "앱 피드백" case .developer: "개발자 정보" From 723daaf85de41cd1c2fc8f0b8c561f3551fa92f0 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Thu, 14 Mar 2024 04:42:43 +0900 Subject: [PATCH 3/7] =?UTF-8?q?chore:=20MyPage=20->=20Settings=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../42flip/42flip_01.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_010.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_011.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_02.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_03.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_04.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_05.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_06.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_07.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_08.imageset/Contents.json | 28 +++++++++-------- .../42flip/42flip_09.imageset/Contents.json | 28 +++++++++-------- .../cat/cat_page0.imageset/Contents.json | 28 +++++++++-------- .../cat/cat_page1.imageset/Contents.json | 28 +++++++++-------- .../cat/cat_page2.imageset/Contents.json | 28 +++++++++-------- .../cat/cat_page3.imageset/Contents.json | 28 +++++++++-------- .../cat/cat_page4.imageset/Contents.json | 28 +++++++++-------- .../fox/fox_page0.imageset/Contents.json | 28 +++++++++-------- .../fox/fox_page1.imageset/Contents.json | 28 +++++++++-------- .../fox/fox_page2.imageset/Contents.json | 28 +++++++++-------- .../fox/fox_page3.imageset/Contents.json | 28 +++++++++-------- .../fox/fox_page4.imageset/Contents.json | 28 +++++++++-------- iBox/Sources/Main/MainTabBarController.swift | 2 +- .../{MyPageItem.swift => SettingsItem.swift} | 8 ++--- iBox/Sources/MyPage/MyPageCellViewModel.swift | 30 ------------------- .../MyPage/MyPageSectionViewModel.swift | 18 ----------- .../HomeTab/HomeTabSelectorCell.swift | 0 .../HomeTab/HomeTabSelectorView.swift | 0 .../HomeTabSelectorViewController.swift | 0 .../HomeTab/HomeTabSelectorViewModel.swift | 0 .../MyPageViewModel.swift | 22 +++++++------- .../Settings/SettingsCellViewModel.swift | 30 +++++++++++++++++++ .../SettingsItemCell.swift} | 10 +++---- .../Settings/SettingsSectionViewModel.swift | 18 +++++++++++ .../SettingsView.swift} | 26 ++++++++-------- .../SettingsViewController.swift} | 18 +++++------ .../Theme/ThemeCell.swift | 0 .../Theme/ThemeView.swift | 0 .../Theme/ThemeViewController.swift | 0 .../Theme/ThemeViewModel.swift | 0 39 files changed, 427 insertions(+), 343 deletions(-) rename iBox/Sources/Model/{MyPageItem.swift => SettingsItem.swift} (85%) delete mode 100644 iBox/Sources/MyPage/MyPageCellViewModel.swift delete mode 100644 iBox/Sources/MyPage/MyPageSectionViewModel.swift rename iBox/Sources/{MyPage => Settings}/HomeTab/HomeTabSelectorCell.swift (100%) rename iBox/Sources/{MyPage => Settings}/HomeTab/HomeTabSelectorView.swift (100%) rename iBox/Sources/{MyPage => Settings}/HomeTab/HomeTabSelectorViewController.swift (100%) rename iBox/Sources/{MyPage => Settings}/HomeTab/HomeTabSelectorViewModel.swift (100%) rename iBox/Sources/{MyPage => Settings}/MyPageViewModel.swift (56%) create mode 100644 iBox/Sources/Settings/SettingsCellViewModel.swift rename iBox/Sources/{MyPage/MyPageItemCell.swift => Settings/SettingsItemCell.swift} (92%) create mode 100644 iBox/Sources/Settings/SettingsSectionViewModel.swift rename iBox/Sources/{MyPage/MyPageView.swift => Settings/SettingsView.swift} (81%) rename iBox/Sources/{MyPage/MyPageViewController.swift => Settings/SettingsViewController.swift} (72%) rename iBox/Sources/{MyPage => Settings}/Theme/ThemeCell.swift (100%) rename iBox/Sources/{MyPage => Settings}/Theme/ThemeView.swift (100%) rename iBox/Sources/{MyPage => Settings}/Theme/ThemeViewController.swift (100%) rename iBox/Sources/{MyPage => Settings}/Theme/ThemeViewModel.swift (100%) diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_01.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_01.imageset/Contents.json index c3f3e0f..e720717 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_01.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_01.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_01.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_01.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_010.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_010.imageset/Contents.json index decba56..1adb61c 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_010.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_010.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_010.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_010.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_011.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_011.imageset/Contents.json index 8b7a961..9c275c2 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_011.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_011.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_011.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_011.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_02.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_02.imageset/Contents.json index 2f3ab5c..29b6d7a 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_02.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_02.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_02.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_02.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_03.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_03.imageset/Contents.json index 1bb5447..f2cd717 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_03.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_03.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_03.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_03.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_04.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_04.imageset/Contents.json index ebcc599..5b409df 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_04.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_04.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_04.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_04.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_05.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_05.imageset/Contents.json index 94ea571..36d8b0f 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_05.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_05.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_05.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_05.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_06.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_06.imageset/Contents.json index a5e0bd3..7bffe60 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_06.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_06.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_06.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_06.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_07.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_07.imageset/Contents.json index 44ffa40..aa07899 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_07.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_07.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_07.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_07.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_08.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_08.imageset/Contents.json index 68d2e68..8b2281e 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_08.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_08.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_08.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_08.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_09.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_09.imageset/Contents.json index 73c69c8..3a859c1 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_09.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/42flip/42flip/42flip_09.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "42flip_09.png", - "idiom": "universal", - "scale": "2x" + "filename" : "42flip_09.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page0.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page0.imageset/Contents.json index 2e12dbe..f43efda 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page0.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page0.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "cat0.png", - "idiom": "universal", - "scale": "2x" + "filename" : "cat0.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page1.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page1.imageset/Contents.json index 1c2d433..2ae8956 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page1.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page1.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "cat1.png", - "idiom": "universal", - "scale": "2x" + "filename" : "cat1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page2.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page2.imageset/Contents.json index 5a36dbe..643ddc8 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page2.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page2.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "cat2.png", - "idiom": "universal", - "scale": "2x" + "filename" : "cat2.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page3.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page3.imageset/Contents.json index 59c27aa..e09cac4 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page3.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page3.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "cat3.png", - "idiom": "universal", - "scale": "2x" + "filename" : "cat3.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page4.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page4.imageset/Contents.json index fa18c78..7dfe11e 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page4.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/cat/cat_page4.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "cat4.png", - "idiom": "universal", - "scale": "2x" + "filename" : "cat4.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page0.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page0.imageset/Contents.json index 9d2d8fb..de4782f 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page0.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page0.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "fox0.png", - "idiom": "universal", - "scale": "2x" + "filename" : "fox0.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page1.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page1.imageset/Contents.json index 28696dd..3efa561 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page1.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page1.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "fox1.png", - "idiom": "universal", - "scale": "2x" + "filename" : "fox1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page2.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page2.imageset/Contents.json index 9054a45..9e46b91 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page2.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page2.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "fox2.png", - "idiom": "universal", - "scale": "2x" + "filename" : "fox2.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page3.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page3.imageset/Contents.json index c5f7545..ea3a111 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page3.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page3.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "fox3.png", - "idiom": "universal", - "scale": "2x" + "filename" : "fox3.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page4.imageset/Contents.json b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page4.imageset/Contents.json index db0dfe4..a772154 100644 --- a/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page4.imageset/Contents.json +++ b/iBox/Resources/Assets.xcassets/42pack_icon/fox/fox_page4.imageset/Contents.json @@ -1,20 +1,24 @@ { - "images": [ + "images" : [ { - "idiom": "universal", - "scale": "1x" + "idiom" : "universal", + "scale" : "1x" }, { - "filename": "fox4.png", - "idiom": "universal", - "scale": "2x" + "filename" : "fox4.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], - "info": { - "author": "xcode", - "version": 1 + "info" : { + "author" : "xcode", + "version" : 1 }, - "properties": { - "template-rendering-intent": "template" + "properties" : { + "template-rendering-intent" : "template" } -} \ No newline at end of file +} diff --git a/iBox/Sources/Main/MainTabBarController.swift b/iBox/Sources/Main/MainTabBarController.swift index 6f6404b..b94f3b8 100644 --- a/iBox/Sources/Main/MainTabBarController.swift +++ b/iBox/Sources/Main/MainTabBarController.swift @@ -28,7 +28,7 @@ class MainTabBarController: UITabBarController { viewControllers = [ setupViewController(viewController: BoxListViewController(), image: UIImage(systemName: "square.grid.2x2.fill")), setupViewController(viewController: FavoriteViewController(), image: UIImage(systemName: "heart.fill")), - setupViewController(viewController: MyPageViewController(), image: UIImage(systemName: "person.fill")) + setupViewController(viewController: SettingsViewController(), image: UIImage(systemName: "person.fill")) ] tabBar.tintColor = .box tabBar.backgroundColor = .backgroundColor diff --git a/iBox/Sources/Model/MyPageItem.swift b/iBox/Sources/Model/SettingsItem.swift similarity index 85% rename from iBox/Sources/Model/MyPageItem.swift rename to iBox/Sources/Model/SettingsItem.swift index 3f16d71..eac4362 100644 --- a/iBox/Sources/Model/MyPageItem.swift +++ b/iBox/Sources/Model/SettingsItem.swift @@ -1,5 +1,5 @@ // -// MyPageItem.swift +// SettingsItem.swift // iBox // // Created by jiyeon on 1/3/24. @@ -7,7 +7,7 @@ import Foundation -enum MyPageType { +enum SettingsType { case theme case homeTab case preload @@ -28,8 +28,8 @@ enum MyPageType { } -struct MyPageItem { - var type: MyPageType +struct SettingsItem { + var type: SettingsType var description: String? var flag: Bool? } diff --git a/iBox/Sources/MyPage/MyPageCellViewModel.swift b/iBox/Sources/MyPage/MyPageCellViewModel.swift deleted file mode 100644 index 77a77c4..0000000 --- a/iBox/Sources/MyPage/MyPageCellViewModel.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// MyPageCellViewModel.swift -// iBox -// -// Created by jiyeon on 2/22/24. -// - -import Foundation - -class MyPageCellViewModel { - - let myPageItem: MyPageItem - - init(_ myPageItem: MyPageItem) { - self.myPageItem = myPageItem - } - - var title: String { - myPageItem.type.toString() - } - - var flag: Bool? { - myPageItem.flag - } - - var description: String? { - myPageItem.description - } - -} diff --git a/iBox/Sources/MyPage/MyPageSectionViewModel.swift b/iBox/Sources/MyPage/MyPageSectionViewModel.swift deleted file mode 100644 index 53b2a81..0000000 --- a/iBox/Sources/MyPage/MyPageSectionViewModel.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// MyPageSectionViewModel.swift -// iBox -// -// Created by jiyeon on 2/22/24. -// - -import Foundation - -class MyPageSectionViewModel { - - let cellViewModels: [MyPageCellViewModel] - - init(cellViewModels: [MyPageCellViewModel]) { - self.cellViewModels = cellViewModels - } - -} diff --git a/iBox/Sources/MyPage/HomeTab/HomeTabSelectorCell.swift b/iBox/Sources/Settings/HomeTab/HomeTabSelectorCell.swift similarity index 100% rename from iBox/Sources/MyPage/HomeTab/HomeTabSelectorCell.swift rename to iBox/Sources/Settings/HomeTab/HomeTabSelectorCell.swift diff --git a/iBox/Sources/MyPage/HomeTab/HomeTabSelectorView.swift b/iBox/Sources/Settings/HomeTab/HomeTabSelectorView.swift similarity index 100% rename from iBox/Sources/MyPage/HomeTab/HomeTabSelectorView.swift rename to iBox/Sources/Settings/HomeTab/HomeTabSelectorView.swift diff --git a/iBox/Sources/MyPage/HomeTab/HomeTabSelectorViewController.swift b/iBox/Sources/Settings/HomeTab/HomeTabSelectorViewController.swift similarity index 100% rename from iBox/Sources/MyPage/HomeTab/HomeTabSelectorViewController.swift rename to iBox/Sources/Settings/HomeTab/HomeTabSelectorViewController.swift diff --git a/iBox/Sources/MyPage/HomeTab/HomeTabSelectorViewModel.swift b/iBox/Sources/Settings/HomeTab/HomeTabSelectorViewModel.swift similarity index 100% rename from iBox/Sources/MyPage/HomeTab/HomeTabSelectorViewModel.swift rename to iBox/Sources/Settings/HomeTab/HomeTabSelectorViewModel.swift diff --git a/iBox/Sources/MyPage/MyPageViewModel.swift b/iBox/Sources/Settings/MyPageViewModel.swift similarity index 56% rename from iBox/Sources/MyPage/MyPageViewModel.swift rename to iBox/Sources/Settings/MyPageViewModel.swift index f388ac2..be71ace 100644 --- a/iBox/Sources/MyPage/MyPageViewModel.swift +++ b/iBox/Sources/Settings/MyPageViewModel.swift @@ -1,5 +1,5 @@ // -// MyPageViewModel.swift +// SettingsViewModel.swift // iBox // // Created by jiyeon on 2/22/24. @@ -8,7 +8,7 @@ import Combine import Foundation -class MyPageViewModel { +class SettingsViewModel { enum Input { case viewWillAppear @@ -24,7 +24,7 @@ class MyPageViewModel { let input = PassthroughSubject() private let output = PassthroughSubject() private var cancellables = Set() - var sectionViewModels = [MyPageSectionViewModel]() + var sectionViewModels = [SettingsSectionViewModel]() func transform(input: AnyPublisher) -> AnyPublisher { input.sink { [weak self] event in @@ -41,15 +41,15 @@ class MyPageViewModel { } private func updateSectionViewModels() { - sectionViewModels.append(MyPageSectionViewModel(cellViewModels: [ - MyPageCellViewModel(MyPageItem(type: .theme, description: UserDefaultsManager.theme.toString())), - MyPageCellViewModel(MyPageItem(type: .homeTab, description: HomeTabType.allCases[UserDefaultsManager.homeTabIndex].toString())), - MyPageCellViewModel(MyPageItem(type: .preload, flag: UserDefaultsManager.isPreload)) + sectionViewModels.append(SettingsSectionViewModel(cellViewModels: [ + SettingsCellViewModel(SettingsItem(type: .theme, description: UserDefaultsManager.theme.toString())), + SettingsCellViewModel(SettingsItem(type: .homeTab, description: HomeTabType.allCases[UserDefaultsManager.homeTabIndex].toString())), + SettingsCellViewModel(SettingsItem(type: .preload, flag: UserDefaultsManager.isPreload)) ])) - sectionViewModels.append(MyPageSectionViewModel(cellViewModels: [ - MyPageCellViewModel(MyPageItem(type: .guide)), - MyPageCellViewModel(MyPageItem(type: .feedback)), - MyPageCellViewModel(MyPageItem(type: .developer)) + sectionViewModels.append(SettingsSectionViewModel(cellViewModels: [ + SettingsCellViewModel(SettingsItem(type: .guide)), + SettingsCellViewModel(SettingsItem(type: .feedback)), + SettingsCellViewModel(SettingsItem(type: .developer)) ])) } diff --git a/iBox/Sources/Settings/SettingsCellViewModel.swift b/iBox/Sources/Settings/SettingsCellViewModel.swift new file mode 100644 index 0000000..bd39065 --- /dev/null +++ b/iBox/Sources/Settings/SettingsCellViewModel.swift @@ -0,0 +1,30 @@ +// +// SettingsCellViewModel.swift +// iBox +// +// Created by jiyeon on 2/22/24. +// + +import Foundation + +class SettingsCellViewModel { + + let settingsItem: SettingsItem + + init(_ settingsItem: SettingsItem) { + self.settingsItem = settingsItem + } + + var title: String { + settingsItem.type.toString() + } + + var flag: Bool? { + settingsItem.flag + } + + var description: String? { + settingsItem.description + } + +} diff --git a/iBox/Sources/MyPage/MyPageItemCell.swift b/iBox/Sources/Settings/SettingsItemCell.swift similarity index 92% rename from iBox/Sources/MyPage/MyPageItemCell.swift rename to iBox/Sources/Settings/SettingsItemCell.swift index a8d29ad..b60df42 100644 --- a/iBox/Sources/MyPage/MyPageItemCell.swift +++ b/iBox/Sources/Settings/SettingsItemCell.swift @@ -1,5 +1,5 @@ // -// MyPageItemCell.swift +// SettingsItemCell.swift // iBox // // Created by jiyeon on 1/3/24. @@ -9,10 +9,10 @@ import UIKit import SnapKit -class MyPageItemCell: UITableViewCell { +class SettingsItemCell: UITableViewCell { - static let reuseIdentifier = "MyPageItemCell" - private var viewModel: MyPageCellViewModel? + static let reuseIdentifier = "SettingsItemCell" + private var viewModel: SettingsCellViewModel? // MARK: - UI Components @@ -87,7 +87,7 @@ class MyPageItemCell: UITableViewCell { // MARK: - Bind ViewModel - func bindViewModel(_ viewModel: MyPageCellViewModel) { + func bindViewModel(_ viewModel: SettingsCellViewModel) { self.viewModel = viewModel titleLabel.text = viewModel.title diff --git a/iBox/Sources/Settings/SettingsSectionViewModel.swift b/iBox/Sources/Settings/SettingsSectionViewModel.swift new file mode 100644 index 0000000..63efe2f --- /dev/null +++ b/iBox/Sources/Settings/SettingsSectionViewModel.swift @@ -0,0 +1,18 @@ +// +// SettingsSectionViewModel.swift +// iBox +// +// Created by jiyeon on 2/22/24. +// + +import Foundation + +class SettingsSectionViewModel { + + let cellViewModels: [SettingsCellViewModel] + + init(cellViewModels: [SettingsCellViewModel]) { + self.cellViewModels = cellViewModels + } + +} diff --git a/iBox/Sources/MyPage/MyPageView.swift b/iBox/Sources/Settings/SettingsView.swift similarity index 81% rename from iBox/Sources/MyPage/MyPageView.swift rename to iBox/Sources/Settings/SettingsView.swift index 86d8c5a..e1fe94c 100644 --- a/iBox/Sources/MyPage/MyPageView.swift +++ b/iBox/Sources/Settings/SettingsView.swift @@ -1,5 +1,5 @@ // -// ProfileView.swift +// SettingsView.swift // iBox // // Created by jiyeon on 1/3/24. @@ -8,16 +8,16 @@ import Combine import UIKit -final class MyPageView: UIView { +final class SettingsView: UIView { - var delegate: MyPageViewDelegate? - private var viewModel: MyPageViewModel? + var delegate: SettingsViewDelegate? + private var viewModel: SettingsViewModel? private var cancellables = Set() // MARK: - UI Components let tableView = UITableView().then { - $0.register(MyPageItemCell.self, forCellReuseIdentifier: MyPageItemCell.reuseIdentifier) + $0.register(SettingsItemCell.self, forCellReuseIdentifier: SettingsItemCell.reuseIdentifier) $0.separatorStyle = .none $0.sectionHeaderTopPadding = 0 $0.backgroundColor = .clear @@ -55,7 +55,7 @@ final class MyPageView: UIView { // MARK: - Bind ViewModel - func bindViewModel(_ viewModel: MyPageViewModel) { + func bindViewModel(_ viewModel: SettingsViewModel) { self.viewModel = viewModel viewModel.transform(input: viewModel.input.eraseToAnyPublisher()) .receive(on: RunLoop.main) @@ -76,7 +76,7 @@ final class MyPageView: UIView { } -extension MyPageView: UITableViewDelegate { +extension SettingsView: UITableViewDelegate { func numberOfSections(in tableView: UITableView) -> Int { guard let viewModel = viewModel else { return 0 } @@ -99,15 +99,15 @@ extension MyPageView: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { guard let viewModel = viewModel else { return } - let myPageItem = viewModel.sectionViewModels[indexPath.section].cellViewModels[indexPath.row].myPageItem - if (myPageItem.type != MyPageType.preload) { - delegate?.pushViewController(myPageItem.type) + let settingsItem = viewModel.sectionViewModels[indexPath.section].cellViewModels[indexPath.row].settingsItem + if (settingsItem.type != SettingsType.preload) { + delegate?.pushViewController(settingsItem.type) } } } -extension MyPageView: UITableViewDataSource { +extension SettingsView: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { guard let viewModel = viewModel else { return 0 } @@ -116,8 +116,8 @@ extension MyPageView: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let viewModel = viewModel, - let cell = tableView.dequeueReusableCell(withIdentifier: MyPageItemCell.reuseIdentifier) - as? MyPageItemCell else { return UITableViewCell() } + let cell = tableView.dequeueReusableCell(withIdentifier: SettingsItemCell.reuseIdentifier) + as? SettingsItemCell else { return UITableViewCell() } let cellViewModel = viewModel.sectionViewModels[indexPath.section].cellViewModels[indexPath.row] cell.bindViewModel(cellViewModel) if cellViewModel.flag != nil { diff --git a/iBox/Sources/MyPage/MyPageViewController.swift b/iBox/Sources/Settings/SettingsViewController.swift similarity index 72% rename from iBox/Sources/MyPage/MyPageViewController.swift rename to iBox/Sources/Settings/SettingsViewController.swift index 6b8e56c..b56bee7 100644 --- a/iBox/Sources/MyPage/MyPageViewController.swift +++ b/iBox/Sources/Settings/SettingsViewController.swift @@ -1,5 +1,5 @@ // -// MyPageViewController.swift +// SettingsViewController.swift // iBox // // Created by 이지현 on 12/27/23. @@ -7,14 +7,14 @@ import UIKit -protocol MyPageViewDelegate { - func pushViewController(_ type: MyPageType) +protocol SettingsViewDelegate { + func pushViewController(_ type: SettingsType) func pushViewController(_ viewController: UIViewController) } -final class MyPageViewController: BaseViewController, BaseViewControllerProtocol { +final class SettingsViewController: BaseViewController, BaseViewControllerProtocol { - private let viewModel = MyPageViewModel() + private let viewModel = SettingsViewModel() // MARK: - Life Cycle @@ -22,7 +22,7 @@ final class MyPageViewController: BaseViewController, BaseViewContro super.viewDidLoad() setupNavigationBar() - guard let contentView = contentView as? MyPageView else { return } + guard let contentView = contentView as? SettingsView else { return } contentView.delegate = self contentView.bindViewModel(viewModel) } @@ -35,14 +35,14 @@ final class MyPageViewController: BaseViewController, BaseViewContro // MARK: - BaseViewControllerProtocol func setupNavigationBar() { - setNavigationBarTitleLabelText("마이 페이지") + setNavigationBarTitleLabelText("설정") } } -extension MyPageViewController: MyPageViewDelegate { +extension SettingsViewController: SettingsViewDelegate { - func pushViewController(_ type: MyPageType) { + func pushViewController(_ type: SettingsType) { switch type { case .theme: navigationController?.pushViewController(ThemeViewController(), animated: true) diff --git a/iBox/Sources/MyPage/Theme/ThemeCell.swift b/iBox/Sources/Settings/Theme/ThemeCell.swift similarity index 100% rename from iBox/Sources/MyPage/Theme/ThemeCell.swift rename to iBox/Sources/Settings/Theme/ThemeCell.swift diff --git a/iBox/Sources/MyPage/Theme/ThemeView.swift b/iBox/Sources/Settings/Theme/ThemeView.swift similarity index 100% rename from iBox/Sources/MyPage/Theme/ThemeView.swift rename to iBox/Sources/Settings/Theme/ThemeView.swift diff --git a/iBox/Sources/MyPage/Theme/ThemeViewController.swift b/iBox/Sources/Settings/Theme/ThemeViewController.swift similarity index 100% rename from iBox/Sources/MyPage/Theme/ThemeViewController.swift rename to iBox/Sources/Settings/Theme/ThemeViewController.swift diff --git a/iBox/Sources/MyPage/Theme/ThemeViewModel.swift b/iBox/Sources/Settings/Theme/ThemeViewModel.swift similarity index 100% rename from iBox/Sources/MyPage/Theme/ThemeViewModel.swift rename to iBox/Sources/Settings/Theme/ThemeViewModel.swift From 94a221f4f59c9c2a8f7187a00fd209ef79195727 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Thu, 14 Mar 2024 05:18:39 +0900 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iBox/Sources/Model/SettingsItem.swift | 6 +- iBox/Sources/Settings/Reset/ResetView.swift | 73 +++++++++++++++++++ .../Settings/Reset/ResetViewController.swift | 58 +++++++++++++++ .../Settings/SettingsViewController.swift | 6 +- ...iewModel.swift => SettingsViewModel.swift} | 4 +- 5 files changed, 139 insertions(+), 8 deletions(-) create mode 100644 iBox/Sources/Settings/Reset/ResetView.swift create mode 100644 iBox/Sources/Settings/Reset/ResetViewController.swift rename iBox/Sources/Settings/{MyPageViewModel.swift => SettingsViewModel.swift} (96%) diff --git a/iBox/Sources/Model/SettingsItem.swift b/iBox/Sources/Model/SettingsItem.swift index eac4362..d725301 100644 --- a/iBox/Sources/Model/SettingsItem.swift +++ b/iBox/Sources/Model/SettingsItem.swift @@ -11,18 +11,18 @@ enum SettingsType { case theme case homeTab case preload + case reset case guide case feedback - case developer func toString() -> String { switch self { case .theme: "테마" case .homeTab: "홈화면" case .preload: "즐겨찾기 미리 로드" - case .guide: "이용 가이드" + case .reset: "데이터 초기화" + case .guide: "앱 소개" case .feedback: "앱 피드백" - case .developer: "개발자 정보" } } diff --git a/iBox/Sources/Settings/Reset/ResetView.swift b/iBox/Sources/Settings/Reset/ResetView.swift new file mode 100644 index 0000000..811053c --- /dev/null +++ b/iBox/Sources/Settings/Reset/ResetView.swift @@ -0,0 +1,73 @@ +// +// ResetView.swift +// iBox +// +// Created by jiyeon on 3/14/24. +// + +import UIKit + +import SnapKit + +class ResetView: UIView { + + var delegate: ResetViewDelegate? + + // MARK: - UI Components + + let label = UILabel().then { + $0.text = "경고: 이 작업을 진행하면 모든 폴더 및 북마크 정보가 영구적으로 삭제됩니다. 한번 초기화된 데이터는 복구할 수 없으니, 진행하기 전에 중요한 정보가 없는지 다시 한번 확인해 주시기 바랍니다." + $0.numberOfLines = 0 + $0.font = .systemFont(ofSize: 15) + } + + let resetButton = UIButton().then { + $0.configuration = .plain() + $0.configuration?.attributedTitle = .init("초기화", attributes: .init([.font: UIFont.boldSystemFont(ofSize: 15)])) + $0.tintColor = .white + $0.backgroundColor = .box + $0.clipsToBounds = true + $0.layer.cornerRadius = 5 + } + + // MARK: - Initializer + + override init(frame: CGRect) { + super.init(frame: frame) + setupProperty() + setupHierarchy() + setupLayout() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Setup Methods + + private func setupProperty() { + resetButton.addTarget(self, action: #selector(handleResetButtonTap), for: .touchUpInside) + } + + private func setupHierarchy() { + addSubview(label) + addSubview(resetButton) + } + + private func setupLayout() { + label.snp.makeConstraints { make in + make.top.leading.trailing.equalToSuperview().inset(20) + } + + resetButton.snp.makeConstraints { make in + make.top.equalTo(label.snp.bottom).offset(20) + make.trailing.leading.equalToSuperview().inset(20) + make.height.equalTo(44) + } + } + + @objc private func handleResetButtonTap() { + delegate?.showAlert() + } + +} diff --git a/iBox/Sources/Settings/Reset/ResetViewController.swift b/iBox/Sources/Settings/Reset/ResetViewController.swift new file mode 100644 index 0000000..d593220 --- /dev/null +++ b/iBox/Sources/Settings/Reset/ResetViewController.swift @@ -0,0 +1,58 @@ +// +// ResetViewController.swift +// iBox +// +// Created by jiyeon on 3/14/24. +// + +import UIKit + +protocol ResetViewDelegate { + func showAlert() +} + +class ResetViewController: BaseViewController, BaseViewControllerProtocol { + + // MARK: - Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setupNavigationBar() + + guard let contentView = contentView as? ResetView else { return } + contentView.delegate = self + } + + // MARK: - BaseViewControllerProtocol + + func setupNavigationBar() { + setNavigationBarTitleLabelText("데이터 초기화") + setNavigationBarTitleLabelFont(.systemFont(ofSize: 17, weight: .semibold)) + setNavigationBarBackButtonHidden(false) + } + +} + +extension ResetViewController: ResetViewDelegate { + + func showAlert() { + let alertController = UIAlertController(title: "경고", message: "이 작업은 되돌릴 수 없습니다. 계속하려면 \"iBox\"라고 입력해 주세요.", preferredStyle: .alert) + alertController.addTextField() + + let cancelAction = UIAlertAction(title: "취소", style: .cancel, handler: nil) + alertController.addAction(cancelAction) + + let confirmAction = UIAlertAction(title: "확인", style: .default) { _ in + if let textField = alertController.textFields?.first, let text = textField.text, text == "iBox" { + print("정말로 초기화를 해버렷당") + self.navigationController?.popViewController(animated: true) + } else { + self.showAlert() + } + } + alertController.addAction(confirmAction) + + self.present(alertController, animated: true, completion: nil) + } + +} diff --git a/iBox/Sources/Settings/SettingsViewController.swift b/iBox/Sources/Settings/SettingsViewController.swift index b56bee7..bd753ad 100644 --- a/iBox/Sources/Settings/SettingsViewController.swift +++ b/iBox/Sources/Settings/SettingsViewController.swift @@ -48,12 +48,12 @@ extension SettingsViewController: SettingsViewDelegate { navigationController?.pushViewController(ThemeViewController(), animated: true) case .homeTab: navigationController?.pushViewController(HomeTabSelectorViewController(), animated: true) + case .reset: + navigationController?.pushViewController(ResetViewController(), animated: true) case .guide: - print("이용 가이드 탭 !") + print("앱 소개 탭 !") case .feedback: print("앱 피드백 탭 !") - case .developer: - print("개발자 정보 탭 !") default: break } } diff --git a/iBox/Sources/Settings/MyPageViewModel.swift b/iBox/Sources/Settings/SettingsViewModel.swift similarity index 96% rename from iBox/Sources/Settings/MyPageViewModel.swift rename to iBox/Sources/Settings/SettingsViewModel.swift index be71ace..a6fbda4 100644 --- a/iBox/Sources/Settings/MyPageViewModel.swift +++ b/iBox/Sources/Settings/SettingsViewModel.swift @@ -47,9 +47,9 @@ class SettingsViewModel { SettingsCellViewModel(SettingsItem(type: .preload, flag: UserDefaultsManager.isPreload)) ])) sectionViewModels.append(SettingsSectionViewModel(cellViewModels: [ + SettingsCellViewModel(SettingsItem(type: .reset)), SettingsCellViewModel(SettingsItem(type: .guide)), - SettingsCellViewModel(SettingsItem(type: .feedback)), - SettingsCellViewModel(SettingsItem(type: .developer)) + SettingsCellViewModel(SettingsItem(type: .feedback)) ])) } From 7f48608e68ec40f088bc688845f7ccd25ff44fb7 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Thu, 14 Mar 2024 05:28:55 +0900 Subject: [PATCH 5/7] =?UTF-8?q?feat:=20=EC=84=A4=EC=A0=95=20=ED=83=AD=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EC=8B=9C=20=ED=83=AD=EB=B0=94=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=ED=85=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=9B=80?= =?UTF-8?q?=EC=A7=81=EC=9D=B4=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iBox/Sources/Main/MainTabBarController.swift | 35 ++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/iBox/Sources/Main/MainTabBarController.swift b/iBox/Sources/Main/MainTabBarController.swift index b94f3b8..ca3ff23 100644 --- a/iBox/Sources/Main/MainTabBarController.swift +++ b/iBox/Sources/Main/MainTabBarController.swift @@ -10,6 +10,8 @@ import UIKit class MainTabBarController: UITabBarController { var previousTabIndex = 0 + var imageChangeTimer: Timer? + var currentImageIndex = 0 // MARK: - Life Cycle @@ -28,7 +30,7 @@ class MainTabBarController: UITabBarController { viewControllers = [ setupViewController(viewController: BoxListViewController(), image: UIImage(systemName: "square.grid.2x2.fill")), setupViewController(viewController: FavoriteViewController(), image: UIImage(systemName: "heart.fill")), - setupViewController(viewController: SettingsViewController(), image: UIImage(systemName: "person.fill")) + setupViewController(viewController: SettingsViewController(), image: UIImage(named: "sitting_fox0")) ] tabBar.tintColor = .box tabBar.backgroundColor = .backgroundColor @@ -46,14 +48,43 @@ class MainTabBarController: UITabBarController { appearance.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.clear], for: .normal) appearance.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.clear], for: .selected) } - + } extension MainTabBarController: UITabBarControllerDelegate { + func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { if tabBarController.selectedIndex == 1 && previousTabIndex == 1 { WebViewPreloader.shared.resetFavoriteView() } previousTabIndex = tabBarController.selectedIndex + + if tabBarController.selectedIndex == 2 { + startImageRotation() + } else { + stopImageRotation() + } + } + + private func startImageRotation() { + stopImageRotation() // 현재 진행 중인 타이머가 있다면 중지 + imageChangeTimer = Timer.scheduledTimer(timeInterval: 0.3, target: self, selector: #selector(updateTabBarImage), userInfo: nil, repeats: true) } + + private func stopImageRotation() { + imageChangeTimer?.invalidate() + imageChangeTimer = nil + } + + @objc private func updateTabBarImage() { + if let viewControllers = viewControllers, viewControllers.count > 2 { + let settingsViewController = viewControllers[2] + let imageName = "sitting_fox\(currentImageIndex)" + settingsViewController.tabBarItem.image = UIImage(named: imageName) + + currentImageIndex += 1 + if currentImageIndex > 3 { currentImageIndex = 0 } + } + } + } From c1c21e751903d57c2b1a3d7892d740c0a2c015d4 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Thu, 14 Mar 2024 09:22:04 +0900 Subject: [PATCH 6/7] =?UTF-8?q?chore:=20=ED=83=80=EC=9D=B4=EB=A8=B8=20?= =?UTF-8?q?=EA=B0=84=EA=B2=A9=20=EB=8A=98=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iBox/Sources/Main/MainTabBarController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iBox/Sources/Main/MainTabBarController.swift b/iBox/Sources/Main/MainTabBarController.swift index ca3ff23..f000bff 100644 --- a/iBox/Sources/Main/MainTabBarController.swift +++ b/iBox/Sources/Main/MainTabBarController.swift @@ -68,7 +68,7 @@ extension MainTabBarController: UITabBarControllerDelegate { private func startImageRotation() { stopImageRotation() // 현재 진행 중인 타이머가 있다면 중지 - imageChangeTimer = Timer.scheduledTimer(timeInterval: 0.3, target: self, selector: #selector(updateTabBarImage), userInfo: nil, repeats: true) + imageChangeTimer = Timer.scheduledTimer(timeInterval: 0.5, target: self, selector: #selector(updateTabBarImage), userInfo: nil, repeats: true) } private func stopImageRotation() { From 6f41d935ca59d85c530aa12dbfa69ff89b515719 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Thu, 14 Mar 2024 14:20:50 +0900 Subject: [PATCH 7/7] =?UTF-8?q?:lipstick:=20design:=20=ED=83=AD=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=EC=BD=98=20=EA=B8=B0=EC=96=B4=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iBox/Sources/Main/MainTabBarController.swift | 31 +------------------- iBox/Sources/Settings/Reset/ResetView.swift | 2 +- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/iBox/Sources/Main/MainTabBarController.swift b/iBox/Sources/Main/MainTabBarController.swift index f000bff..625d21d 100644 --- a/iBox/Sources/Main/MainTabBarController.swift +++ b/iBox/Sources/Main/MainTabBarController.swift @@ -10,8 +10,6 @@ import UIKit class MainTabBarController: UITabBarController { var previousTabIndex = 0 - var imageChangeTimer: Timer? - var currentImageIndex = 0 // MARK: - Life Cycle @@ -30,7 +28,7 @@ class MainTabBarController: UITabBarController { viewControllers = [ setupViewController(viewController: BoxListViewController(), image: UIImage(systemName: "square.grid.2x2.fill")), setupViewController(viewController: FavoriteViewController(), image: UIImage(systemName: "heart.fill")), - setupViewController(viewController: SettingsViewController(), image: UIImage(named: "sitting_fox0")) + setupViewController(viewController: SettingsViewController(), image: UIImage(systemName: "gearshape.fill")) ] tabBar.tintColor = .box tabBar.backgroundColor = .backgroundColor @@ -58,33 +56,6 @@ extension MainTabBarController: UITabBarControllerDelegate { WebViewPreloader.shared.resetFavoriteView() } previousTabIndex = tabBarController.selectedIndex - - if tabBarController.selectedIndex == 2 { - startImageRotation() - } else { - stopImageRotation() - } - } - - private func startImageRotation() { - stopImageRotation() // 현재 진행 중인 타이머가 있다면 중지 - imageChangeTimer = Timer.scheduledTimer(timeInterval: 0.5, target: self, selector: #selector(updateTabBarImage), userInfo: nil, repeats: true) - } - - private func stopImageRotation() { - imageChangeTimer?.invalidate() - imageChangeTimer = nil - } - - @objc private func updateTabBarImage() { - if let viewControllers = viewControllers, viewControllers.count > 2 { - let settingsViewController = viewControllers[2] - let imageName = "sitting_fox\(currentImageIndex)" - settingsViewController.tabBarItem.image = UIImage(named: imageName) - - currentImageIndex += 1 - if currentImageIndex > 3 { currentImageIndex = 0 } - } } } diff --git a/iBox/Sources/Settings/Reset/ResetView.swift b/iBox/Sources/Settings/Reset/ResetView.swift index 811053c..9f18044 100644 --- a/iBox/Sources/Settings/Reset/ResetView.swift +++ b/iBox/Sources/Settings/Reset/ResetView.swift @@ -16,7 +16,7 @@ class ResetView: UIView { // MARK: - UI Components let label = UILabel().then { - $0.text = "경고: 이 작업을 진행하면 모든 폴더 및 북마크 정보가 영구적으로 삭제됩니다. 한번 초기화된 데이터는 복구할 수 없으니, 진행하기 전에 중요한 정보가 없는지 다시 한번 확인해 주시기 바랍니다." + $0.text = "경고: 이 작업을 진행하면 저장하신 모든 폴더 및 북마크 정보가 영구적으로 삭제되고 기본값으로 초기화됩니다. 진행하기 전에 중요한 정보가 없는지 다시 한번 확인해 주시기 바랍니다." $0.numberOfLines = 0 $0.font = .systemFont(ofSize: 15) }