From 927f775309ddbb95909b0503f3def367189c5a46 Mon Sep 17 00:00:00 2001 From: Young June Park Date: Thu, 15 Dec 2022 11:01:28 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=AA=A9=EB=A1=9D=20=EC=A0=95=EB=A0=AC?= =?UTF-8?q?=20=EB=B0=94=20=EB=B2=84=ED=8A=BC=20=EC=88=98=EC=A0=95=20(#121)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SpaceCapsule.xcodeproj/project.pbxproj | 4 ++++ .../TabBar/CapsuleList/CapsuleListView.swift | 2 +- .../CapsuleListViewController.swift | 18 +++++++++--------- .../CapsuleList/Components/SortButton.swift | 15 +++++++++++++++ 4 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/Components/SortButton.swift diff --git a/SpaceCapsule/SpaceCapsule.xcodeproj/project.pbxproj b/SpaceCapsule/SpaceCapsule.xcodeproj/project.pbxproj index c2feb1e..babc739 100644 --- a/SpaceCapsule/SpaceCapsule.xcodeproj/project.pbxproj +++ b/SpaceCapsule/SpaceCapsule.xcodeproj/project.pbxproj @@ -145,6 +145,7 @@ 28C8C980292DC382005615BB /* SortPolicySelectionCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28C8C97F292DC382005615BB /* SortPolicySelectionCoordinator.swift */; }; 28C8C982292DEECD005615BB /* SortPolicyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28C8C981292DEECD005615BB /* SortPolicyCell.swift */; }; 28C8C984292DF4EA005615BB /* SortPolicyHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28C8C983292DF4EA005615BB /* SortPolicyHeaderView.swift */; }; + 28E68BE0294AB58C009D608E /* SortButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28E68BDF294AB58C009D608E /* SortButton.swift */; }; 4A05D0EC2924C04200A2EF50 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4A05D0EB2924C04200A2EF50 /* GoogleService-Info.plist */; }; 4A05D1052925CF2A00A2EF50 /* NetworkError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A05D1042925CF2A00A2EF50 /* NetworkError.swift */; }; 4A1D1BBD2940260800F47ACB /* CapsuleSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1D1BBC2940260800F47ACB /* CapsuleSettingsViewController.swift */; }; @@ -333,6 +334,7 @@ 28C8C97F292DC382005615BB /* SortPolicySelectionCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortPolicySelectionCoordinator.swift; sourceTree = ""; }; 28C8C981292DEECD005615BB /* SortPolicyCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortPolicyCell.swift; sourceTree = ""; }; 28C8C983292DF4EA005615BB /* SortPolicyHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortPolicyHeaderView.swift; sourceTree = ""; }; + 28E68BDF294AB58C009D608E /* SortButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortButton.swift; sourceTree = ""; }; 4A05D0EB2924C04200A2EF50 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 4A05D1042925CF2A00A2EF50 /* NetworkError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkError.swift; sourceTree = ""; }; 4A1D1BBC2940260800F47ACB /* CapsuleSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapsuleSettingsViewController.swift; sourceTree = ""; }; @@ -602,6 +604,7 @@ 2807BC0A292C658000288A5D /* ListCapsuleCell.swift */, 2800F979292F1F060069EE7F /* ListCapsuleCellItem.swift */, 28245561293B17B100DE03A1 /* UnOpenable.swift */, + 28E68BDF294AB58C009D608E /* SortButton.swift */, ); path = Components; sourceTree = ""; @@ -1181,6 +1184,7 @@ 288A8EA929235AFC000229D2 /* NicknameCoordinator.swift in Sources */, 288A8EE629235FD5000229D2 /* CapsuleCloseView.swift in Sources */, 0D752DB12944A643004A704C /* NSCache+subscript.swift in Sources */, + 28E68BE0294AB58C009D608E /* SortButton.swift in Sources */, 0D90DAF7292397CF000DCC84 /* UIColor+.swift in Sources */, 599C1A4B292CC99A00517E93 /* NoneImageCache.swift in Sources */, 28049CE729237B2B002389BD /* BaseViewController.swift in Sources */, diff --git a/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListView.swift b/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListView.swift index ff4e0c4..fbe8ee2 100644 --- a/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListView.swift +++ b/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListView.swift @@ -12,7 +12,7 @@ final class CapsuleListView: UIView, BaseView, Refreshable { var refreshButton = RefreshButton() let sortBarButtonItem = { - let button = UIButton() + let button = SortButton() button.titleLabel?.font = .themeFont(ofSize: FrameResource.fontSize80) button.setTitle(SortPolicy.nearest.description, for: .normal) button.setTitleColor(.themeBlack, for: .normal) diff --git a/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListViewController.swift b/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListViewController.swift index e7fc276..0bc49c9 100644 --- a/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListViewController.swift +++ b/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/CapsuleListViewController.swift @@ -23,19 +23,19 @@ final class CapsuleListViewController: UIViewController, BaseViewController { override func viewDidLoad() { super.viewDidLoad() - + configureView() addSortBarButton() configureCollectionView() bind() bindViewModel() } - + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) viewModel?.input.viewWillAppear.onNext(()) } - + private func configureView() { view.backgroundColor = .themeBackground } @@ -46,15 +46,15 @@ final class CapsuleListViewController: UIViewController, BaseViewController { return } view.addSubview(emptyView) - + emptyView.snp.makeConstraints { $0.edges.equalToSuperview() } } - + private func showCollectionView() { view.addSubview(capsuleListView) - + capsuleListView.snp.makeConstraints { $0.top.leading.trailing.equalToSuperview() $0.bottom.equalTo(view.safeAreaLayoutGuide) @@ -72,7 +72,7 @@ final class CapsuleListViewController: UIViewController, BaseViewController { }) .bind(onNext: {}) .disposed(by: disposeBag) - + capsuleListView.collectionView.rx.itemHighlighted .withUnretained(self) .subscribe( @@ -89,7 +89,7 @@ final class CapsuleListViewController: UIViewController, BaseViewController { ) } }).disposed(by: disposeBag) - + capsuleListView.collectionView.rx.itemUnhighlighted .withUnretained(self) .subscribe( @@ -106,7 +106,7 @@ final class CapsuleListViewController: UIViewController, BaseViewController { ) } }).disposed(by: disposeBag) - + capsuleListView.sortBarButtonItem.rx.tap .withLatestFrom(viewModel.input.sortPolicy) .withUnretained(self) diff --git a/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/Components/SortButton.swift b/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/Components/SortButton.swift new file mode 100644 index 0000000..f2dfbdc --- /dev/null +++ b/SpaceCapsule/SpaceCapsule/Scene/TabBar/CapsuleList/Components/SortButton.swift @@ -0,0 +1,15 @@ +// +// SortButton.swift +// SpaceCapsule +// +// Created by young june Park on 2022/12/15. +// + +import UIKit + +final class SortButton: UIButton { + override func layoutSubviews() { + super.layoutSubviews() + semanticContentAttribute = .forceRightToLeft + } +}