From a4895f8fad601e083f54e8676a43a870626f96c9 Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Mon, 26 Dec 2022 21:32:27 +0900 Subject: [PATCH 01/69] =?UTF-8?q?[ADD]=20SkeletonView=20SPM=20=EC=84=A4?= =?UTF-8?q?=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito.xcodeproj/project.pbxproj | 17 +++++++++++++++++ .../xcshareddata/swiftpm/Package.resolved | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/Manito/Manito.xcodeproj/project.pbxproj b/Manito/Manito.xcodeproj/project.pbxproj index 332268d27..db3d12ee8 100644 --- a/Manito/Manito.xcodeproj/project.pbxproj +++ b/Manito/Manito.xcodeproj/project.pbxproj @@ -139,6 +139,7 @@ CB5AE3E4285AAF7400382EA3 /* RoomInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5AE3E3285AAF7400382EA3 /* RoomInfoView.swift */; }; CB5AE3E6285AB76800382EA3 /* PeopleInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5AE3E5285AB76800382EA3 /* PeopleInfoView.swift */; }; CB637A3B28595C1200FF1240 /* ParticipateRoomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB637A3A28595C1200FF1240 /* ParticipateRoomViewController.swift */; }; + CB6637E82959CBC60050BD04 /* SkeletonView in Frameworks */ = {isa = PBXBuildFile; productRef = CB6637E72959CBC60050BD04 /* SkeletonView */; }; CB674C1C285966020063A6B7 /* InputInvitedCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB674C1B285966020063A6B7 /* InputInvitedCodeView.swift */; }; CB674C2128596A310063A6B7 /* CheckRoomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB674C2028596A310063A6B7 /* CheckRoomViewController.swift */; }; CB7B23A828C4ECA8004A4CF3 /* Character.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB7B23A728C4ECA8004A4CF3 /* Character.swift */; }; @@ -319,6 +320,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + CB6637E82959CBC60050BD04 /* SkeletonView in Frameworks */, B50B1B0428596C900080992C /* SnapKit in Frameworks */, B50B1B0728596CB10080992C /* FSCalendar in Frameworks */, B50B1B33285AC0970080992C /* Gifu in Frameworks */, @@ -937,6 +939,7 @@ B50B1B0328596C900080992C /* SnapKit */, B50B1B0628596CB10080992C /* FSCalendar */, B50B1B32285AC0970080992C /* Gifu */, + CB6637E72959CBC60050BD04 /* SkeletonView */, ); productName = Manito; productReference = B5F524CB28519AA000614FF7 /* Manito.app */; @@ -970,6 +973,7 @@ B50B1B0228596C900080992C /* XCRemoteSwiftPackageReference "SnapKit" */, B50B1B0528596CB10080992C /* XCRemoteSwiftPackageReference "FSCalendar" */, B50B1B31285AC0970080992C /* XCRemoteSwiftPackageReference "Gifu" */, + CB6637E62959CBC60050BD04 /* XCRemoteSwiftPackageReference "SkeletonView" */, ); productRefGroup = B5F524CC28519AA000614FF7 /* Products */; projectDirPath = ""; @@ -1406,6 +1410,14 @@ minimumVersion = 3.0.0; }; }; + CB6637E62959CBC60050BD04 /* XCRemoteSwiftPackageReference "SkeletonView" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Juanpe/SkeletonView.git"; + requirement = { + branch = main; + kind = branch; + }; + }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -1424,6 +1436,11 @@ package = B50B1B31285AC0970080992C /* XCRemoteSwiftPackageReference "Gifu" */; productName = Gifu; }; + CB6637E72959CBC60050BD04 /* SkeletonView */ = { + isa = XCSwiftPackageProductDependency; + package = CB6637E62959CBC60050BD04 /* XCRemoteSwiftPackageReference "SkeletonView" */; + productName = SkeletonView; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = B5F524C328519AA000614FF7 /* Project object */; diff --git a/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 83ad64fc6..e7a2789d8 100644 --- a/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -18,6 +18,15 @@ "version" : "3.3.1" } }, + { + "identity" : "skeletonview", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Juanpe/SkeletonView.git", + "state" : { + "branch" : "main", + "revision" : "0f5eaf82e82441690d38abfc4118c961f113881c" + } + }, { "identity" : "snapkit", "kind" : "remoteSourceControl", From 84461f9f39c9d97b9ffe396904babeba621c917b Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Mon, 26 Dec 2022 21:52:49 +0900 Subject: [PATCH 02/69] =?UTF-8?q?[FEAT]=20=EC=BB=AC=EB=A0=89=EC=85=98?= =?UTF-8?q?=EB=B7=B0=EC=97=90=20=EC=8A=A4=EC=BC=88=EB=A0=88=ED=86=A4=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito.xcodeproj/project.pbxproj | 8 ++--- .../Main/Cell/ManitoRoomCollectionCell.swift | 10 +++++++ .../Screens/Main/MainViewController.swift | 29 +++++++++++++++++-- ...ssonView.swift => CommonMissionView.swift} | 4 +-- 4 files changed, 42 insertions(+), 9 deletions(-) rename Manito/Manito/Screens/Main/UIComponent/{CommonMissonView.swift => CommonMissionView.swift} (94%) diff --git a/Manito/Manito.xcodeproj/project.pbxproj b/Manito/Manito.xcodeproj/project.pbxproj index db3d12ee8..7f0aabdd5 100644 --- a/Manito/Manito.xcodeproj/project.pbxproj +++ b/Manito/Manito.xcodeproj/project.pbxproj @@ -145,7 +145,7 @@ CB7B23A828C4ECA8004A4CF3 /* Character.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB7B23A728C4ECA8004A4CF3 /* Character.swift */; }; CB85DE1F28A76F3400399109 /* SettingDeveloperInfoHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB85DE1E28A76F3400399109 /* SettingDeveloperInfoHeaderView.swift */; }; CB9592B22855C09A00847751 /* ManitoRoomCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB9592B12855C09A00847751 /* ManitoRoomCollectionCell.swift */; }; - CB9592B52855D52700847751 /* CommonMissonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB9592B42855D52700847751 /* CommonMissonView.swift */; }; + CB9592B52855D52700847751 /* CommonMissionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB9592B42855D52700847751 /* CommonMissionView.swift */; }; CBA15C94285CE1A80051EDE2 /* ChooseCharacterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA15C93285CE1A80051EDE2 /* ChooseCharacterViewController.swift */; }; CBA4D7A42856CE9F0018BDC2 /* CreateRoomCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA4D7A32856CE9F0018BDC2 /* CreateRoomCollectionViewCell.swift */; }; CBA4D7A62856D48C0018BDC2 /* RoomStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA4D7A52856D48C0018BDC2 /* RoomStateView.swift */; }; @@ -299,7 +299,7 @@ CB7B23A728C4ECA8004A4CF3 /* Character.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Character.swift; sourceTree = ""; }; CB85DE1E28A76F3400399109 /* SettingDeveloperInfoHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingDeveloperInfoHeaderView.swift; sourceTree = ""; }; CB9592B12855C09A00847751 /* ManitoRoomCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManitoRoomCollectionCell.swift; sourceTree = ""; }; - CB9592B42855D52700847751 /* CommonMissonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonMissonView.swift; sourceTree = ""; }; + CB9592B42855D52700847751 /* CommonMissionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonMissionView.swift; sourceTree = ""; }; CBA15C93285CE1A80051EDE2 /* ChooseCharacterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChooseCharacterViewController.swift; sourceTree = ""; }; CBA4D7A32856CE9F0018BDC2 /* CreateRoomCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateRoomCollectionViewCell.swift; sourceTree = ""; }; CBA4D7A52856D48C0018BDC2 /* RoomStateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomStateView.swift; sourceTree = ""; }; @@ -843,7 +843,7 @@ CB9592B32855D51100847751 /* UIComponent */ = { isa = PBXGroup; children = ( - CB9592B42855D52700847751 /* CommonMissonView.swift */, + CB9592B42855D52700847751 /* CommonMissionView.swift */, CBA4D7A52856D48C0018BDC2 /* RoomStateView.swift */, ); path = UIComponent; @@ -1109,7 +1109,7 @@ B5F31BB028BE1CA700F61D0F /* UserDefaultStorage.swift in Sources */, B5F31BB228BE1CD700F61D0F /* UserDefaultHandler.swift in Sources */, 39CD581D28C4C03C00496E91 /* DetailDoneProtocol.swift in Sources */, - CB9592B52855D52700847751 /* CommonMissonView.swift in Sources */, + CB9592B52855D52700847751 /* CommonMissionView.swift in Sources */, CBA4D7A42856CE9F0018BDC2 /* CreateRoomCollectionViewCell.swift in Sources */, 39C95802287DACC300A04A2B /* RoomEndPoint.swift in Sources */, CB4C77E628C0D4EB007A1AD2 /* MainAPI.swift in Sources */, diff --git a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift index 441d8bcd5..a744e3c96 100644 --- a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift +++ b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift @@ -58,6 +58,7 @@ class ManitoRoomCollectionViewCell: UICollectionViewCell{ super.init(frame: frame) setupView() render() + setupSkeletionView() } required init?(coder aDecoder: NSCoder) { @@ -107,4 +108,13 @@ class ManitoRoomCollectionViewCell: UICollectionViewCell{ $0.centerX.equalToSuperview() } } + + private func setupSkeletionView() { + self.isSkeletonable = true + imageView.isSkeletonable = true + memberLabel.isSkeletonable = true + roomLabel.isSkeletonable = true + roomState.isSkeletonable = true + dateLabel.isSkeletonable = true + } } diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 3dde747ae..d91254b88 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -8,6 +8,7 @@ import UIKit import Gifu +import SkeletonView import SnapKit final class MainViewController: BaseViewController { @@ -38,6 +39,8 @@ final class MainViewController: BaseViewController { } } } + + private let skeletonAnimation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .leftRight) // MARK: - property @@ -49,7 +52,7 @@ final class MainViewController: BaseViewController { }() private let imgStar = UIImageView(image: ImageLiterals.imgStar) private let commonMissionImageView = UIImageView(image: ImageLiterals.imgCommonMisson) - private let commonMissionView = CommonMissonView() + private let commonMissionView = CommonMissionView() private let menuTitle: UILabel = { let label = UILabel() label.text = TextLiteral.mainViewControllerMenuTitle @@ -76,6 +79,7 @@ final class MainViewController: BaseViewController { forCellWithReuseIdentifier: ManitoRoomCollectionViewCell.className) collectionView.register(cell: CreateRoomCollectionViewCell.self, forCellWithReuseIdentifier: CreateRoomCollectionViewCell.className) + collectionView.isSkeletonable = true return collectionView }() private let maCharacterImageView = GIFImageView() @@ -101,8 +105,13 @@ final class MainViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - requestCommonMission() - requestManittoList() + + Task { + listCollectionView.showAnimatedGradientSkeleton(usingGradient: .init(colors: [.grey002, .lightGray]), animation: skeletonAnimation, transition: .none) + requestCommonMission() + requestManittoList() + } + } override func render() { @@ -210,6 +219,9 @@ final class MainViewController: BaseViewController { if let manittoList = data { rooms = manittoList.participatingRooms listCollectionView.reloadData() + +// self.listCollectionView.stopSkeletonAnimation() +// self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) } } catch NetworkError.serverError { print("serverError") @@ -296,6 +308,17 @@ final class MainViewController: BaseViewController { } } +// MARK: - SkeletonCollectionViewDelegate, SkeletonCollectionViewDataSource +extension MainViewController: SkeletonCollectionViewDelegate, SkeletonCollectionViewDataSource { + func collectionSkeletonView(_ skeletonView: UICollectionView, cellIdentifierForItemAt indexPath: IndexPath) -> ReusableCellIdentifier { + ManitoRoomCollectionViewCell.className + } + + func collectionSkeletonView(_ skeletonView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + 8 + } +} + // MARK: - UICollectionViewDataSource extension MainViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { diff --git a/Manito/Manito/Screens/Main/UIComponent/CommonMissonView.swift b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift similarity index 94% rename from Manito/Manito/Screens/Main/UIComponent/CommonMissonView.swift rename to Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift index 72a572b56..41b28e9ff 100644 --- a/Manito/Manito/Screens/Main/UIComponent/CommonMissonView.swift +++ b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift @@ -1,5 +1,5 @@ // -// CommonMissonView.swift +// CommonMissionView.swift // Manito // // Created by COBY_PRO on 2022/06/12. @@ -9,7 +9,7 @@ import UIKit import SnapKit -final class CommonMissonView: UIView { +final class CommonMissionView: UIView { // MARK: - property From a39c7b5e539ba986f4447068b6ac802e8d99c76d Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Tue, 17 Jan 2023 18:12:29 +0900 Subject: [PATCH 03/69] =?UTF-8?q?[CHORE]=20CommonMissionView=20=EB=B0=B0?= =?UTF-8?q?=EA=B2=BD=EC=97=90=20=ED=84=B0=EB=AF=B8=EB=84=90=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EB=84=A3=EA=B8=B0=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Main/Cell/ManitoRoomCollectionCell.swift | 23 ++++++++++- .../Screens/Main/MainViewController.swift | 39 +++++++++++-------- .../Main/UIComponent/CommonMissionView.swift | 12 ++++++ 3 files changed, 55 insertions(+), 19 deletions(-) diff --git a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift index d98edae63..615a5fea0 100644 --- a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift +++ b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift @@ -19,6 +19,13 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { // MARK: - property + private let greyBackgroundView: UIView = { + let uiView = UIView() + uiView.backgroundColor = .darkGrey002.withAlphaComponent(0.8) + uiView.clipsToBounds = true + uiView.makeBorderLayer(color: UIColor.white.withAlphaComponent(0.5)) + return uiView + }() private let imageView = UIImageView(image: ImageLiterals.imgNi) let memberLabel: UILabel = { let label = UILabel() @@ -48,6 +55,11 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { // MARK: - life cycle override func render() { + addSubview(greyBackgroundView) + greyBackgroundView.snp.makeConstraints { + $0.edges.equalToSuperview() + } + addSubview(imageView) imageView.snp.makeConstraints { $0.top.leading.equalToSuperview().inset(9) @@ -83,7 +95,14 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { } override func configUI() { - backgroundColor = .darkGrey002.withAlphaComponent(0.8) - makeBorderLayer(color: UIColor.white.withAlphaComponent(0.5)) +// self.isSkeletonable = true + greyBackgroundView.isSkeletonable = false + imageView.isSkeletonable = true + memberLabel.isSkeletonable = true + roomLabel.isSkeletonable = true + dateLabel.isSkeletonable = true + roomStateView.isSkeletonable = true + + self.skeletonCornerRadius = 10 } } diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index cd4e7257b..26a3065c9 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -24,6 +24,8 @@ final class MainViewController: BaseViewController { left: collectionHorizontalSpacing, bottom: collectionVerticalSpacing, right: collectionHorizontalSpacing) + static let commonMissionViewWidth: CGFloat = UIScreen.main.bounds.size.width - 48 + static let commonMissionViewHeight: CGFloat = commonMissionViewWidth * 0.6 } private enum RoomStatus: String { @@ -43,7 +45,7 @@ final class MainViewController: BaseViewController { } } - private let skeletonAnimation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .leftRight) + private let skeletonAnimation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .topLeftBottomRight) private let refreshControl = UIRefreshControl() @@ -59,7 +61,6 @@ final class MainViewController: BaseViewController { return button }() private let imgStar = UIImageView(image: ImageLiterals.imgStar) - private let commonMissionImageView = UIImageView(image: ImageLiterals.imgCommonMisson) private let commonMissionView = CommonMissionView() private let menuTitle: UILabel = { let label = UILabel() @@ -112,9 +113,9 @@ final class MainViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + setupSkeletonView() Task { - listCollectionView.showAnimatedGradientSkeleton(usingGradient: .init(colors: [.grey002, .lightGray]), animation: skeletonAnimation, transition: .none) requestCommonMission() requestManittoRoomList() } @@ -150,22 +151,16 @@ final class MainViewController: BaseViewController { $0.top.equalTo(view.safeAreaLayoutGuide).offset(30) } - view.addSubview(commonMissionImageView) - commonMissionImageView.snp.makeConstraints { - $0.leading.trailing.equalToSuperview().inset(24) - $0.height.equalTo(commonMissionImageView.snp.width).multipliedBy(0.61) - $0.top.equalTo(imgStar.snp.bottom) - } - - commonMissionImageView.addSubview(commonMissionView) + view.addSubview(commonMissionView) commonMissionView.snp.makeConstraints { - $0.center.equalToSuperview() - $0.leading.trailing.equalToSuperview().inset(30) + $0.top.equalTo(imgStar.snp.bottom) + $0.leading.trailing.equalToSuperview().inset(24) + $0.height.equalTo(Size.commonMissionViewHeight) } view.addSubview(menuTitle) menuTitle.snp.makeConstraints { - $0.top.equalTo(commonMissionImageView.snp.bottom).offset(50) + $0.top.equalTo(commonMissionView.snp.bottom).offset(50) $0.leading.equalToSuperview().offset(16) } @@ -177,7 +172,7 @@ final class MainViewController: BaseViewController { view.addSubview(guideButton) guideButton.snp.makeConstraints { - $0.top.equalTo(commonMissionImageView.snp.top).offset(27) + $0.top.equalTo(commonMissionView.snp.top).offset(27) $0.trailing.equalTo(commonMissionView.snp.trailing) $0.width.height.equalTo(44) } @@ -222,6 +217,17 @@ final class MainViewController: BaseViewController { listCollectionView.refreshControl = refreshControl } + private func setupSkeletonView() { + commonMissionView.showAnimatedGradientSkeleton(usingGradient: .init(colors: [.grey003, .darkGrey002]), animation: skeletonAnimation, transition: .none) + listCollectionView.showAnimatedGradientSkeleton(usingGradient: .init(colors: [.grey003, .darkGrey002]), animation: skeletonAnimation, transition: .none) + } + + private func stopSkeletonView() { + self.commonMissionView.stopSkeletonAnimation() + self.listCollectionView.stopSkeletonAnimation() + self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) + } + // MARK: - API private func requestCommonMission() { @@ -248,8 +254,7 @@ final class MainViewController: BaseViewController { rooms = manittoList.participatingRooms listCollectionView.reloadData() -// self.listCollectionView.stopSkeletonAnimation() -// self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) + self.stopSkeletonView() } } catch NetworkError.serverError { print("serverError") diff --git a/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift index 137026961..97acad28c 100644 --- a/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift +++ b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift @@ -13,6 +13,7 @@ final class CommonMissionView: UIView { // MARK: - property + private let commonMissionImageView = UIImageView(image: ImageLiterals.imgCommonMisson) private let title: UILabel = { let label = UILabel() label.text = TextLiteral.commonMissionViewTitle @@ -34,6 +35,7 @@ final class CommonMissionView: UIView { override init(frame: CGRect) { super.init(frame: frame) render() + configUI() } required init?(coder: NSCoder) { @@ -43,6 +45,12 @@ final class CommonMissionView: UIView { // MARK: - life cycle private func render() { + self.addSubview(commonMissionImageView) + commonMissionImageView.snp.makeConstraints { + $0.leading.trailing.equalToSuperview().inset(24) + $0.height.equalTo(commonMissionImageView.snp.width).multipliedBy(0.61) + } + self.addSubview(title) title.snp.makeConstraints { $0.top.centerX.equalToSuperview() @@ -55,4 +63,8 @@ final class CommonMissionView: UIView { $0.height.equalTo(56) } } + + private func configUI() { + self.isSkeletonable = true + } } From 42be6d96cfde2aba722613c95efeab4d4900acef Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Tue, 17 Jan 2023 18:27:04 +0900 Subject: [PATCH 04/69] =?UTF-8?q?[CHORE]=20CommonMissionView=20=EB=94=94?= =?UTF-8?q?=ED=85=8C=EC=9D=BC=20=EC=88=98=EC=A0=95=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Screens/Main/MainViewController.swift | 9 +++++---- .../Screens/Main/UIComponent/CommonMissionView.swift | 11 +++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 26a3065c9..5aee2589a 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -24,7 +24,7 @@ final class MainViewController: BaseViewController { left: collectionHorizontalSpacing, bottom: collectionVerticalSpacing, right: collectionHorizontalSpacing) - static let commonMissionViewWidth: CGFloat = UIScreen.main.bounds.size.width - 48 + static let commonMissionViewWidth: CGFloat = UIScreen.main.bounds.size.width - 40 static let commonMissionViewHeight: CGFloat = commonMissionViewWidth * 0.6 } @@ -154,7 +154,7 @@ final class MainViewController: BaseViewController { view.addSubview(commonMissionView) commonMissionView.snp.makeConstraints { $0.top.equalTo(imgStar.snp.bottom) - $0.leading.trailing.equalToSuperview().inset(24) + $0.leading.trailing.equalToSuperview().inset(20) $0.height.equalTo(Size.commonMissionViewHeight) } @@ -172,8 +172,8 @@ final class MainViewController: BaseViewController { view.addSubview(guideButton) guideButton.snp.makeConstraints { - $0.top.equalTo(commonMissionView.snp.top).offset(27) - $0.trailing.equalTo(commonMissionView.snp.trailing) + $0.top.equalTo(commonMissionView.snp.top).offset(30) + $0.trailing.equalTo(commonMissionView.snp.trailing).inset(30) $0.width.height.equalTo(44) } } @@ -224,6 +224,7 @@ final class MainViewController: BaseViewController { private func stopSkeletonView() { self.commonMissionView.stopSkeletonAnimation() + self.commonMissionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) self.listCollectionView.stopSkeletonAnimation() self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) } diff --git a/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift index 97acad28c..268b74710 100644 --- a/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift +++ b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift @@ -47,20 +47,19 @@ final class CommonMissionView: UIView { private func render() { self.addSubview(commonMissionImageView) commonMissionImageView.snp.makeConstraints { - $0.leading.trailing.equalToSuperview().inset(24) - $0.height.equalTo(commonMissionImageView.snp.width).multipliedBy(0.61) + $0.edges.equalToSuperview() } self.addSubview(title) title.snp.makeConstraints { - $0.top.centerX.equalToSuperview() + $0.top.equalToSuperview().inset(56) + $0.centerX.equalToSuperview() } self.addSubview(mission) mission.snp.makeConstraints { - $0.top.equalTo(self.title.snp.bottom).offset(23) - $0.bottom.leading.trailing.equalToSuperview() - $0.height.equalTo(56) + $0.top.equalTo(title.snp.bottom).offset(40) + $0.leading.trailing.equalToSuperview() } } From 77a377957cd6db9ab44359fe94dfd7980ddd2cd5 Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Tue, 17 Jan 2023 18:45:54 +0900 Subject: [PATCH 05/69] =?UTF-8?q?[CHORE]=20=EB=AF=B8=EC=85=98=EC=B0=BD=20?= =?UTF-8?q?=EC=8A=A4=EC=BC=88=EB=A0=88=ED=86=A4=20=EC=82=AD=EC=A0=9C=20(#3?= =?UTF-8?q?52)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Main/Cell/ManitoRoomCollectionCell.swift | 18 ++++-------------- .../Screens/Main/MainViewController.swift | 9 +++------ .../Main/UIComponent/CommonMissionView.swift | 5 ----- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift index 615a5fea0..c73aedbbb 100644 --- a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift +++ b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift @@ -19,13 +19,6 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { // MARK: - property - private let greyBackgroundView: UIView = { - let uiView = UIView() - uiView.backgroundColor = .darkGrey002.withAlphaComponent(0.8) - uiView.clipsToBounds = true - uiView.makeBorderLayer(color: UIColor.white.withAlphaComponent(0.5)) - return uiView - }() private let imageView = UIImageView(image: ImageLiterals.imgNi) let memberLabel: UILabel = { let label = UILabel() @@ -55,11 +48,6 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { // MARK: - life cycle override func render() { - addSubview(greyBackgroundView) - greyBackgroundView.snp.makeConstraints { - $0.edges.equalToSuperview() - } - addSubview(imageView) imageView.snp.makeConstraints { $0.top.leading.equalToSuperview().inset(9) @@ -95,8 +83,10 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { } override func configUI() { -// self.isSkeletonable = true - greyBackgroundView.isSkeletonable = false + backgroundColor = .darkGrey002.withAlphaComponent(0.8) + makeBorderLayer(color: UIColor.white.withAlphaComponent(0.5)) + + self.isSkeletonable = true imageView.isSkeletonable = true memberLabel.isSkeletonable = true roomLabel.isSkeletonable = true diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 5aee2589a..a5b76fd1e 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -109,11 +109,11 @@ final class MainViewController: BaseViewController { setupGuideArea() renderGuideArea() setupRefreshControl() + setupSkeletonView() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - setupSkeletonView() Task { requestCommonMission() @@ -218,15 +218,12 @@ final class MainViewController: BaseViewController { } private func setupSkeletonView() { - commonMissionView.showAnimatedGradientSkeleton(usingGradient: .init(colors: [.grey003, .darkGrey002]), animation: skeletonAnimation, transition: .none) listCollectionView.showAnimatedGradientSkeleton(usingGradient: .init(colors: [.grey003, .darkGrey002]), animation: skeletonAnimation, transition: .none) } private func stopSkeletonView() { - self.commonMissionView.stopSkeletonAnimation() - self.commonMissionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) - self.listCollectionView.stopSkeletonAnimation() - self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) +// self.listCollectionView.stopSkeletonAnimation() +// self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) } // MARK: - API diff --git a/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift index 268b74710..05157d0b9 100644 --- a/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift +++ b/Manito/Manito/Screens/Main/UIComponent/CommonMissionView.swift @@ -35,7 +35,6 @@ final class CommonMissionView: UIView { override init(frame: CGRect) { super.init(frame: frame) render() - configUI() } required init?(coder: NSCoder) { @@ -62,8 +61,4 @@ final class CommonMissionView: UIView { $0.leading.trailing.equalToSuperview() } } - - private func configUI() { - self.isSkeletonable = true - } } From e7357ecd450566d829652569da1127825ff32318 Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Tue, 17 Jan 2023 19:00:31 +0900 Subject: [PATCH 06/69] =?UTF-8?q?[CHORE]=20=EB=82=B4=EB=B6=80=20=EB=9D=BC?= =?UTF-8?q?=EB=B2=A8=20=EC=8A=A4=EC=BC=88=EB=A0=88=ED=86=A4=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Main/Cell/ManitoRoomCollectionCell.swift | 15 +++++++++------ .../Manito/Screens/Main/MainViewController.swift | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift index c73aedbbb..a3a12db3f 100644 --- a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift +++ b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift @@ -48,26 +48,26 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { // MARK: - life cycle override func render() { - addSubview(imageView) + contentView.addSubview(imageView) imageView.snp.makeConstraints { $0.top.leading.equalToSuperview().inset(9) $0.width.height.equalTo(30) } - addSubview(memberLabel) + contentView.addSubview(memberLabel) memberLabel.snp.makeConstraints { $0.top.equalToSuperview().inset(14) $0.leading.equalTo(imageView.snp.trailing).offset(4) } - addSubview(roomLabel) + contentView.addSubview(roomLabel) roomLabel.snp.makeConstraints { $0.top.equalTo(imageView.snp.bottom).offset(20) $0.centerX.equalToSuperview() $0.leading.trailing.equalToSuperview().inset(17) } - addSubview(roomStateView) + contentView.addSubview(roomStateView) roomStateView.snp.makeConstraints { $0.top.equalTo(roomLabel.snp.bottom).offset(24) $0.leading.equalToSuperview().inset(12) @@ -75,7 +75,7 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { $0.height.equalTo(24) } - addSubview(dateLabel) + contentView.addSubview(dateLabel) dateLabel.snp.makeConstraints { $0.bottom.equalToSuperview().inset(12) $0.centerX.equalToSuperview() @@ -92,7 +92,10 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { roomLabel.isSkeletonable = true dateLabel.isSkeletonable = true roomStateView.isSkeletonable = true - + + self.memberLabel.numberOfLines = 2 + self.roomLabel.numberOfLines = 2 + self.dateLabel.numberOfLines = 2 self.skeletonCornerRadius = 10 } } diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index a5b76fd1e..7109bcbdd 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -45,7 +45,7 @@ final class MainViewController: BaseViewController { } } - private let skeletonAnimation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .topLeftBottomRight) + private let skeletonAnimation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .leftRight) private let refreshControl = UIRefreshControl() From e2a934dd2b0be75539c6e76803e6632046ce3971 Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Tue, 17 Jan 2023 19:01:17 +0900 Subject: [PATCH 07/69] =?UTF-8?q?[CHORE]=20=EC=95=A0=EB=8B=88=EB=A9=94?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=A2=85=EB=A3=8C=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Screens/Main/MainViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 7109bcbdd..36dfac9aa 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -222,8 +222,8 @@ final class MainViewController: BaseViewController { } private func stopSkeletonView() { -// self.listCollectionView.stopSkeletonAnimation() -// self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) + self.listCollectionView.stopSkeletonAnimation() + self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) } // MARK: - API From d9271222d25d3722caa2ce3e6ebcef7bcbdd7888 Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Thu, 19 Jan 2023 20:33:12 +0900 Subject: [PATCH 08/69] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20=EB=B0=8F=20radius=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Main/Cell/ManitoRoomCollectionCell.swift | 11 +++++------ Manito/Manito/Screens/Main/MainViewController.swift | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift index a3a12db3f..e1d897ca9 100644 --- a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift +++ b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift @@ -88,14 +88,13 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { self.isSkeletonable = true imageView.isSkeletonable = true - memberLabel.isSkeletonable = true roomLabel.isSkeletonable = true - dateLabel.isSkeletonable = true roomStateView.isSkeletonable = true + + roomLabel.numberOfLines = 2 - self.memberLabel.numberOfLines = 2 - self.roomLabel.numberOfLines = 2 - self.dateLabel.numberOfLines = 2 - self.skeletonCornerRadius = 10 + imageView.skeletonCornerRadius = 15 + roomLabel.linesCornerRadius = 4 + roomStateView.skeletonCornerRadius = 4 } } diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 36dfac9aa..7109bcbdd 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -222,8 +222,8 @@ final class MainViewController: BaseViewController { } private func stopSkeletonView() { - self.listCollectionView.stopSkeletonAnimation() - self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) +// self.listCollectionView.stopSkeletonAnimation() +// self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) } // MARK: - API From 0d62094e3598c20e797565231f5303934bc2a932 Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Thu, 19 Jan 2023 20:41:01 +0900 Subject: [PATCH 09/69] =?UTF-8?q?[CHORE]=20=EC=95=A0=EB=8B=88=EB=A9=94?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=A2=85=EB=A3=8C=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Screens/Main/MainViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 7109bcbdd..36dfac9aa 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -222,8 +222,8 @@ final class MainViewController: BaseViewController { } private func stopSkeletonView() { -// self.listCollectionView.stopSkeletonAnimation() -// self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) + self.listCollectionView.stopSkeletonAnimation() + self.listCollectionView.hideSkeleton(reloadDataAfter: true, transition: .crossDissolve(0.5)) } // MARK: - API From 2ecde84815b942b2663f33b1a98dedb750cdc253 Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 26 Jan 2023 11:28:34 +0900 Subject: [PATCH 10/69] =?UTF-8?q?[MOVE]=20GoogleService-Info.plist=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=9C=84=EC=B9=98=EB=A5=BC=20Supports=20?= =?UTF-8?q?=EB=82=B4=EB=B6=80=EB=A1=9C=20=EB=B3=80=EA=B2=BD(#366)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito.xcodeproj/project.pbxproj | 2 +- Manito/{ => Manito/Global/Supports}/GoogleService-Info.plist | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Manito/{ => Manito/Global/Supports}/GoogleService-Info.plist (100%) diff --git a/Manito/Manito.xcodeproj/project.pbxproj b/Manito/Manito.xcodeproj/project.pbxproj index a2af8c01e..a34fac2e7 100644 --- a/Manito/Manito.xcodeproj/project.pbxproj +++ b/Manito/Manito.xcodeproj/project.pbxproj @@ -502,7 +502,6 @@ B5F524C228519AA000614FF7 = { isa = PBXGroup; children = ( - 39FFE33528F45E44008442EE /* GoogleService-Info.plist */, B55BCEB528D99F8600AF7E45 /* Settings.bundle */, B5F524CD28519AA000614FF7 /* Manito */, B5F524CC28519AA000614FF7 /* Products */, @@ -676,6 +675,7 @@ children = ( 39E6321328BDE59C00CFC6C4 /* Manito.entitlements */, B5F524DC28519AA100614FF7 /* Info.plist */, + 39FFE33528F45E44008442EE /* GoogleService-Info.plist */, B5F524CE28519AA000614FF7 /* AppDelegate.swift */, B5F524D028519AA000614FF7 /* SceneDelegate.swift */, ); diff --git a/Manito/GoogleService-Info.plist b/Manito/Manito/Global/Supports/GoogleService-Info.plist similarity index 100% rename from Manito/GoogleService-Info.plist rename to Manito/Manito/Global/Supports/GoogleService-Info.plist From 22a14a6fcff95dbfe5b4e3ba2679c82ff15d4e20 Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 26 Jan 2023 11:35:45 +0900 Subject: [PATCH 11/69] =?UTF-8?q?[MOVE]=20=EA=B8=B0=EB=B3=B8=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=93=A4=EC=9D=B4=20=EC=9E=88=EB=8A=94=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=EC=9D=84=20Service=EC=97=90=EC=84=9C=20Foundation?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD(#366)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito.xcodeproj/project.pbxproj | 6 +++--- .../Network/{Service => Foundation}/APIEnvironment.swift | 0 .../Manito/Network/{Service => Foundation}/APIService.swift | 0 .../Network/{Service => Foundation}/Endpointable.swift | 0 .../Manito/Network/{Service => Foundation}/HTTPMethod.swift | 0 .../Network/{Service => Foundation}/NetworkError.swift | 0 .../Network/{Service => Foundation}/NetworkRequest.swift | 0 .../Network/{Service => Foundation}/Requestable.swift | 0 8 files changed, 3 insertions(+), 3 deletions(-) rename Manito/Manito/Network/{Service => Foundation}/APIEnvironment.swift (100%) rename Manito/Manito/Network/{Service => Foundation}/APIService.swift (100%) rename Manito/Manito/Network/{Service => Foundation}/Endpointable.swift (100%) rename Manito/Manito/Network/{Service => Foundation}/HTTPMethod.swift (100%) rename Manito/Manito/Network/{Service => Foundation}/NetworkError.swift (100%) rename Manito/Manito/Network/{Service => Foundation}/NetworkRequest.swift (100%) rename Manito/Manito/Network/{Service => Foundation}/Requestable.swift (100%) diff --git a/Manito/Manito.xcodeproj/project.pbxproj b/Manito/Manito.xcodeproj/project.pbxproj index a34fac2e7..6c2668398 100644 --- a/Manito/Manito.xcodeproj/project.pbxproj +++ b/Manito/Manito.xcodeproj/project.pbxproj @@ -390,7 +390,7 @@ path = Login; sourceTree = ""; }; - 39C957D328799A8200A04A2B /* Service */ = { + 39C957D328799A8200A04A2B /* Foundation */ = { isa = PBXGroup; children = ( 39C957D528799AB900A04A2B /* HTTPMethod.swift */, @@ -401,7 +401,7 @@ 39C957F5287D9ED000A04A2B /* NetworkRequest.swift */, B5F31C5528BFA87700F61D0F /* Requestable.swift */, ); - path = Service; + path = Foundation; sourceTree = ""; }; 39C957EA287AE45900A04A2B /* EndPoint */ = { @@ -768,7 +768,7 @@ 397A241528BA519200454E4F /* Protocol */, 397A241128BA513E00454E4F /* API */, 39C957EA287AE45900A04A2B /* EndPoint */, - 39C957D328799A8200A04A2B /* Service */, + 39C957D328799A8200A04A2B /* Foundation */, B5F525472855D01200614FF7 /* Models */, ); path = Network; diff --git a/Manito/Manito/Network/Service/APIEnvironment.swift b/Manito/Manito/Network/Foundation/APIEnvironment.swift similarity index 100% rename from Manito/Manito/Network/Service/APIEnvironment.swift rename to Manito/Manito/Network/Foundation/APIEnvironment.swift diff --git a/Manito/Manito/Network/Service/APIService.swift b/Manito/Manito/Network/Foundation/APIService.swift similarity index 100% rename from Manito/Manito/Network/Service/APIService.swift rename to Manito/Manito/Network/Foundation/APIService.swift diff --git a/Manito/Manito/Network/Service/Endpointable.swift b/Manito/Manito/Network/Foundation/Endpointable.swift similarity index 100% rename from Manito/Manito/Network/Service/Endpointable.swift rename to Manito/Manito/Network/Foundation/Endpointable.swift diff --git a/Manito/Manito/Network/Service/HTTPMethod.swift b/Manito/Manito/Network/Foundation/HTTPMethod.swift similarity index 100% rename from Manito/Manito/Network/Service/HTTPMethod.swift rename to Manito/Manito/Network/Foundation/HTTPMethod.swift diff --git a/Manito/Manito/Network/Service/NetworkError.swift b/Manito/Manito/Network/Foundation/NetworkError.swift similarity index 100% rename from Manito/Manito/Network/Service/NetworkError.swift rename to Manito/Manito/Network/Foundation/NetworkError.swift diff --git a/Manito/Manito/Network/Service/NetworkRequest.swift b/Manito/Manito/Network/Foundation/NetworkRequest.swift similarity index 100% rename from Manito/Manito/Network/Service/NetworkRequest.swift rename to Manito/Manito/Network/Foundation/NetworkRequest.swift diff --git a/Manito/Manito/Network/Service/Requestable.swift b/Manito/Manito/Network/Foundation/Requestable.swift similarity index 100% rename from Manito/Manito/Network/Service/Requestable.swift rename to Manito/Manito/Network/Foundation/Requestable.swift From eac65947d9454c7a192c654d9dfb13c4a7e17e93 Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Thu, 26 Jan 2023 15:06:53 +0900 Subject: [PATCH 12/69] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Main/Cell/ManitoRoomCollectionCell.swift | 8 ++++---- Manito/Manito/Screens/Main/MainViewController.swift | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift index e1d897ca9..dd31fc33f 100644 --- a/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift +++ b/Manito/Manito/Screens/Main/Cell/ManitoRoomCollectionCell.swift @@ -7,6 +7,7 @@ import UIKit +import SkeletonView import SnapKit final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { @@ -86,10 +87,9 @@ final class ManitoRoomCollectionViewCell: BaseCollectionViewCell { backgroundColor = .darkGrey002.withAlphaComponent(0.8) makeBorderLayer(color: UIColor.white.withAlphaComponent(0.5)) - self.isSkeletonable = true - imageView.isSkeletonable = true - roomLabel.isSkeletonable = true - roomStateView.isSkeletonable = true + [self, imageView, roomLabel, roomStateView].forEach { + $0.isSkeletonable = true + } roomLabel.numberOfLines = 2 diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 36dfac9aa..ced3da115 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -150,7 +150,7 @@ final class MainViewController: BaseViewController { $0.leading.equalToSuperview().inset(13) $0.top.equalTo(view.safeAreaLayoutGuide).offset(30) } - + // FIXME: 좌우패딩 20값을 주는데 Size라는 변수명이 겹침 view.addSubview(commonMissionView) commonMissionView.snp.makeConstraints { $0.top.equalTo(imgStar.snp.bottom) @@ -339,11 +339,11 @@ final class MainViewController: BaseViewController { // MARK: - SkeletonCollectionViewDelegate, SkeletonCollectionViewDataSource extension MainViewController: SkeletonCollectionViewDelegate, SkeletonCollectionViewDataSource { func collectionSkeletonView(_ skeletonView: UICollectionView, cellIdentifierForItemAt indexPath: IndexPath) -> ReusableCellIdentifier { - ManitoRoomCollectionViewCell.className + return ManitoRoomCollectionViewCell.className } func collectionSkeletonView(_ skeletonView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - 8 + return 8 } } From e3c6b519716eeab2b829bfb2056c14ec53407aee Mon Sep 17 00:00:00 2001 From: coby5502 <57849386+coby5502@users.noreply.github.com> Date: Thu, 26 Jan 2023 15:10:34 +0900 Subject: [PATCH 13/69] =?UTF-8?q?[CHORE]=20=EC=BD=94=EB=93=9C=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B0=98=EC=98=81,=20=EB=8D=B0=EC=9D=B4=ED=84=B0?= =?UTF-8?q?=20=EB=B3=91=EB=A0=AC=EB=A1=9C=20=EB=B6=88=EB=9F=AC=EC=98=A4?= =?UTF-8?q?=EA=B8=B0=20(#352)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Screens/Main/MainViewController.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index ced3da115..9794e6464 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -114,12 +114,8 @@ final class MainViewController: BaseViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - - Task { - requestCommonMission() - requestManittoRoomList() - } - + requestCommonMission() + requestManittoRoomList() } override func render() { From 0e90750bb9721d71119d9869320d484c9fe5d486 Mon Sep 17 00:00:00 2001 From: chemi Date: Sun, 29 Jan 2023 23:22:56 +0900 Subject: [PATCH 14/69] =?UTF-8?q?[CHORE]=20=EC=A7=80=EB=82=9C=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=ED=99=95=EC=9D=B8=20=EB=B3=80=EC=88=98=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=EB=A1=9C=20=EB=B6=84=EB=A6=AC=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Network/Models/Room.swift | 8 ++++++++ .../Screens/Detail-Wait/DetailWaitViewController.swift | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Network/Models/Room.swift b/Manito/Manito/Network/Models/Room.swift index cefd0a792..4b0207407 100644 --- a/Manito/Manito/Network/Models/Room.swift +++ b/Manito/Manito/Network/Models/Room.swift @@ -81,6 +81,14 @@ struct RoomInfo: Decodable { return "" } } + + var isAlreadyPastDate: Bool { + if let date = startDate?.stringToDate { + return date.distance(to: Date()) > 86400 + } else { + return false + } + } } struct Mission: Codable { diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 602ff26af..5d9c77107 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -376,10 +376,8 @@ final class DetailWaitViewController: BaseViewController { } private func presentEditRoomView() { - guard let startDate = room?.roomInformation?.startDate?.stringToDate else { return } - let isAlreadyPastDate = startDate.distance(to: Date()) > 86400 - - if isAlreadyPastDate { + guard let roomInformation = room?.roomInformation else { return } + if roomInformation.isAlreadyPastDate { editInfoFromDefaultDate() } else { editInfoFromCurrentDate() From 62355e039c7e1a1859207216b7ff4517e255635c Mon Sep 17 00:00:00 2001 From: chemi Date: Sun, 29 Jan 2023 23:44:23 +0900 Subject: [PATCH 15/69] =?UTF-8?q?[CHORE]=20=EB=A7=88=EB=8B=88=EB=98=90=20?= =?UTF-8?q?=EC=8B=9C=EC=9E=91=20=EA=B0=80=EB=8A=A5=20=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EB=AA=A8=EB=8D=B8=EB=A1=9C=20=EB=B6=84=EB=A6=AC=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Network/Models/Room.swift | 11 +++++++++++ .../Detail-Wait/DetailWaitViewController.swift | 7 ++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Manito/Manito/Network/Models/Room.swift b/Manito/Manito/Network/Models/Room.swift index 4b0207407..d481595ae 100644 --- a/Manito/Manito/Network/Models/Room.swift +++ b/Manito/Manito/Network/Models/Room.swift @@ -89,6 +89,17 @@ struct RoomInfo: Decodable { return false } } + + var isStart: Bool { + if let date = startDate?.stringToDate { + let isPast = date.distance(to: Date()) > 86400 + let isToday = date.distance(to: Date()) < 86400 + let canStart = !isPast && isToday + return canStart + } else { + return false + } + } } struct Mission: Codable { diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 5d9c77107..2b5997a45 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -402,11 +402,8 @@ final class DetailWaitViewController: BaseViewController { } private func isPastStartDate() { - guard let startDate = room?.roomInformation?.startDate?.stringToDate else { return } - let isPast = startDate.distance(to: Date()) > 86400 - let isToday = startDate.distance(to: Date()) < 86400 - let canStart = !isPast && isToday - if !canStart { + guard let isStart = room?.roomInformation?.isStart else { return } + if !isStart { switch memberType { case .owner: let action: ((UIAlertAction) -> ()) = { [weak self] _ in From 8dcd24e08f81d2793127fc79e65ea393abad8be4 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 12:28:52 +0900 Subject: [PATCH 16/69] =?UTF-8?q?[CHORE]=20=EC=98=A4=EB=8A=98=EC=9D=B8?= =?UTF-8?q?=EC=A7=80=20=ED=99=95=EC=9D=B8=20=EB=B3=80=EC=88=98=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 2b5997a45..6a983ed46 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -422,10 +422,9 @@ final class DetailWaitViewController: BaseViewController { private func setStartButton() { if memberType == .owner { guard let startDate = room?.roomInformation?.startDate?.stringToDate, - let todayDate = Date().dateToString.stringToDate, let userCount = room?.participants?.count else { return } - let isToday = startDate.distance(to: todayDate).isZero + let isToday = startDate.isToday let isMinimumUserCount = userCount >= 4 detectStartableStatus?(isToday && isMinimumUserCount) From 6e84c64bdb2cdb3a69a594fce85f6cd504f585cc Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 13:19:49 +0900 Subject: [PATCH 17/69] =?UTF-8?q?[CHORE]=20=EC=8B=9C=EC=9E=91=20=EA=B0=80?= =?UTF-8?q?=EB=8A=A5=20=EC=97=AC=EB=B6=80=20=EB=B3=80=EC=88=98=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Network/Models/Room.swift | 10 ++++++++++ .../Screens/Detail-Wait/DetailWaitViewController.swift | 9 ++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Manito/Manito/Network/Models/Room.swift b/Manito/Manito/Network/Models/Room.swift index d481595ae..512d549b6 100644 --- a/Manito/Manito/Network/Models/Room.swift +++ b/Manito/Manito/Network/Models/Room.swift @@ -39,6 +39,16 @@ struct Room: Decodable { } } + var canStart: Bool { + if let count = participants?.count, + let date = roomInformation?.startDate?.stringToDate { + let isMinimumUserCount = count >= 4 + return isMinimumUserCount && date.isToday + } else { + return false + } + } + enum CodingKeys: String, CodingKey { case roomInformation = "room" case participants diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 6a983ed46..0ac1d4f90 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -421,13 +421,8 @@ final class DetailWaitViewController: BaseViewController { private func setStartButton() { if memberType == .owner { - guard let startDate = room?.roomInformation?.startDate?.stringToDate, - let userCount = room?.participants?.count else { return } - - let isToday = startDate.isToday - let isMinimumUserCount = userCount >= 4 - - detectStartableStatus?(isToday && isMinimumUserCount) + guard let canStart = room?.canStart else { return } + detectStartableStatus?(canStart) } else { detectStartableStatus?(false) } From e943360383509010d44cabb2683e59be6533341d Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 2 Feb 2023 13:23:49 +0900 Subject: [PATCH 18/69] =?UTF-8?q?[CHORE]=20isToday=20=EB=B3=80=EC=88=98=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Network/Models/Room.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manito/Manito/Network/Models/Room.swift b/Manito/Manito/Network/Models/Room.swift index 512d549b6..fa7fb2fea 100644 --- a/Manito/Manito/Network/Models/Room.swift +++ b/Manito/Manito/Network/Models/Room.swift @@ -103,7 +103,7 @@ struct RoomInfo: Decodable { var isStart: Bool { if let date = startDate?.stringToDate { let isPast = date.distance(to: Date()) > 86400 - let isToday = date.distance(to: Date()) < 86400 + let isToday = date.isToday let canStart = !isPast && isToday return canStart } else { From 4e5c1e4052b0c38ddb5a112898f8e318b98304a8 Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 16:06:17 +0900 Subject: [PATCH 19/69] =?UTF-8?q?[CHORE]=20MARK=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20Internal=20Size=20=EB=82=B4?= =?UTF-8?q?=EB=B6=80=20static=20=EB=B3=80=EC=88=98=20=EC=88=98=EC=A0=95(#3?= =?UTF-8?q?70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xcshareddata/swiftpm/Package.resolved | 18 +++---- .../Screens/Letter/LetterViewController.swift | 48 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 547f62695..a5052b187 100644 --- a/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Manito/Manito.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -45,15 +45,6 @@ "version" : "3.3.1" } }, - { - "identity" : "skeletonview", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Juanpe/SkeletonView.git", - "state" : { - "branch" : "main", - "revision" : "0f5eaf82e82441690d38abfc4118c961f113881c" - } - }, { "identity" : "googleappmeasurement", "kind" : "remoteSourceControl", @@ -126,6 +117,15 @@ "version" : "2.1.1" } }, + { + "identity" : "skeletonview", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Juanpe/SkeletonView.git", + "state" : { + "branch" : "main", + "revision" : "0f5eaf82e82441690d38abfc4118c961f113881c" + } + }, { "identity" : "snapkit", "kind" : "remoteSourceControl", diff --git a/Manito/Manito/Screens/Letter/LetterViewController.swift b/Manito/Manito/Screens/Letter/LetterViewController.swift index dd1dab1d6..e4804bd7c 100644 --- a/Manito/Manito/Screens/Letter/LetterViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterViewController.swift @@ -34,27 +34,23 @@ final class LetterViewController: BaseViewController { } } - private enum Size { + private enum InternalSize { + static let cellWidth: CGFloat = UIScreen.main.bounds.size.width - Size.leadingTrailingPadding * 2 static let headerHeight: CGFloat = 66.0 - static let collectionHorizontalSpacing: CGFloat = 20.0 - static let collectionVerticalSpacing: CGFloat = 18.0 - static let cellTopSpacing: CGFloat = 16.0 - static let cellBottomSpacing: CGFloat = 35.0 - static let cellHorizontalSpacing: CGFloat = 16.0 - static let cellWidth: CGFloat = UIScreen.main.bounds.size.width - collectionHorizontalSpacing * 2 static let imageHeight: CGFloat = 204.0 - static let collectionInset = UIEdgeInsets(top: collectionVerticalSpacing, - left: collectionHorizontalSpacing, - bottom: collectionVerticalSpacing, - right: collectionHorizontalSpacing) + static let cellInset: UIEdgeInsets = UIEdgeInsets(top: 16.0, left: 16.0, bottom: 35.0, right: 16.0) + static let collectionInset: UIEdgeInsets = UIEdgeInsets(top: 18.0, + left: Size.leadingTrailingPadding, + bottom: 18.0, + right: Size.leadingTrailingPadding) } - // MARK: - property + // MARK: - ui component private let collectionViewFlowLayout: UICollectionViewFlowLayout = { let flowLayout = UICollectionViewFlowLayout() flowLayout.scrollDirection = .vertical - flowLayout.sectionInset = Size.collectionInset + flowLayout.sectionInset = InternalSize.collectionInset flowLayout.minimumLineSpacing = 33 flowLayout.sectionHeadersPinToVisibleBounds = true return flowLayout @@ -73,6 +69,8 @@ final class LetterViewController: BaseViewController { return collectionView }() private lazy var sendLetterView = SendLetterView() + + // MARK: - property private var letterState: LetterState { didSet { @@ -138,6 +136,12 @@ final class LetterViewController: BaseViewController { super.viewWillAppear(animated) setupLargeTitle() } + + override func viewWillDisappear(_ animated: Bool) { + guideBoxImageView.isHidden = true + } + + // MARK: - override override func render() { view.addSubview(listCollectionView) @@ -187,7 +191,7 @@ final class LetterViewController: BaseViewController { view.addSubview(guideBoxImageView) guideBoxImageView.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide.snp.top).inset(35) - $0.trailing.equalTo(view.snp.trailing).inset(Size.collectionHorizontalSpacing + 8) + $0.trailing.equalTo(view.snp.trailing).inset(Size.leadingTrailingPadding + 8) $0.width.equalTo(270) $0.height.equalTo(90) } @@ -199,11 +203,7 @@ final class LetterViewController: BaseViewController { $0.leading.trailing.equalToSuperview().inset(15) } } - - override func viewWillDisappear(_ animated: Bool) { - guideBoxImageView.isHidden = true - } - + // MARK: - func private func setupLargeTitle() { @@ -252,7 +252,7 @@ final class LetterViewController: BaseViewController { } private func calculateContentHeight(text: String) -> CGFloat { - let width = UIScreen.main.bounds.size.width - Size.collectionHorizontalSpacing * 2 - Size.cellHorizontalSpacing * 2 + let width = UIScreen.main.bounds.size.width - Size.leadingTrailingPadding * 2 - InternalSize.cellInset.left * 2 let label = UILabel(frame: CGRect(origin: .zero, size: CGSize(width: width, height: .greatestFiniteMagnitude))) @@ -373,21 +373,21 @@ extension LetterViewController: UICollectionViewDataSource { // MARK: - UICollectionViewDelegateFlowLayout extension LetterViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - var heights = [Size.cellTopSpacing, Size.cellBottomSpacing] + var heights = [InternalSize.cellInset.top, InternalSize.cellInset.bottom] if let content = letterList[indexPath.item].content { heights += [calculateContentHeight(text: content)] } if letterList[indexPath.item].imageUrl != nil { - heights += [Size.imageHeight] + heights += [InternalSize.imageHeight] } - return CGSize(width: Size.cellWidth, height: heights.reduce(0, +)) + return CGSize(width: InternalSize.cellWidth, height: heights.reduce(0, +)) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { - return CGSize(width: UIScreen.main.bounds.size.width, height: Size.headerHeight) + return CGSize(width: UIScreen.main.bounds.size.width, height: InternalSize.headerHeight) } } From fe4a29233c537937dfefc2773a38ff313e71e5fa Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 17:04:17 +0900 Subject: [PATCH 20/69] =?UTF-8?q?[CHORE]=20self=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EB=B6=99=EC=9D=B4=EA=B8=B0(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Letter/LetterViewController.swift | 176 +++++++++--------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/Manito/Manito/Screens/Letter/LetterViewController.swift b/Manito/Manito/Screens/Letter/LetterViewController.swift index e4804bd7c..b2a219fe5 100644 --- a/Manito/Manito/Screens/Letter/LetterViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterViewController.swift @@ -56,7 +56,7 @@ final class LetterViewController: BaseViewController { return flowLayout }() private lazy var listCollectionView: UICollectionView = { - let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewFlowLayout) + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: self.collectionViewFlowLayout) collectionView.backgroundColor = .clear collectionView.dataSource = self collectionView.delegate = self @@ -68,42 +68,39 @@ final class LetterViewController: BaseViewController { withReuseIdentifier: LetterHeaderView.className) return collectionView }() - private lazy var sendLetterView = SendLetterView() + private let emptyLabel: UILabel = { + let label = UILabel() + label.numberOfLines = 2 + label.font = .font(.regular, ofSize: 16) + label.text = TextLiteral.letterViewControllerEmptyViewTo + label.isHidden = true + label.textColor = .grey003 + label.textAlignment = .center + label.addLabelSpacing(lineSpacing: 16) + return label + }() + private lazy var sendLetterView: SendLetterView = SendLetterView() // MARK: - property private var letterState: LetterState { didSet { - reloadCollectionView(with: self.letterState) - setupEmptyLabel() + self.reloadCollectionView(with: self.letterState) + self.setupEmptyLabel() } } - private var letterList: [Message] = [] { didSet { - listCollectionView.reloadData() - setupEmptyView() + self.listCollectionView.reloadData() + self.setupEmptyView() } } - private let letterSevice: LetterAPI = LetterAPI(apiService: APIService()) private var manitteeId: String? private var roomId: String private var roomState: String private var mission: String - private let emptyLabel: UILabel = { - let label = UILabel() - label.numberOfLines = 2 - label.font = .font(.regular, ofSize: 16) - label.text = TextLiteral.letterViewControllerEmptyViewTo - label.isHidden = true - label.textColor = .grey003 - label.addLabelSpacing(lineSpacing: 16) - label.textAlignment = .center - return label - }() - // MARK: - init init(roomState: String, roomId: String, mission: String, letterState: LetterState) { @@ -126,79 +123,80 @@ final class LetterViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - setupButtonAction() - setupGuideArea() - renderGuideArea() - hideGuideViewWhenTappedAround() + self.setupButtonAction() + self.setupGuideArea() + self.renderGuideArea() + self.hideGuideViewWhenTappedAround() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - setupLargeTitle() + self.setupLargeTitle() } override func viewWillDisappear(_ animated: Bool) { - guideBoxImageView.isHidden = true + self.guideBoxImageView.isHidden = true } // MARK: - override override func render() { - view.addSubview(listCollectionView) - listCollectionView.snp.makeConstraints { - $0.edges.equalTo(view.safeAreaLayoutGuide) + self.view.addSubview(self.listCollectionView) + self.listCollectionView.snp.makeConstraints { + $0.edges.equalTo(self.view.safeAreaLayoutGuide) } - view.addSubview(guideButton) - guideButton.snp.makeConstraints { + self.view.addSubview(self.guideButton) + self.guideButton.snp.makeConstraints { $0.width.height.equalTo(44) } - - if roomState != "POST" { - view.addSubview(sendLetterView) - sendLetterView.snp.makeConstraints { - $0.leading.trailing.bottom.equalTo(view.safeAreaLayoutGuide) - } - } - view.addSubview(emptyLabel) - emptyLabel.snp.makeConstraints { + + self.view.addSubview(self.emptyLabel) + self.emptyLabel.snp.makeConstraints { $0.center.equalToSuperview() } + + if self.roomState != "POST" { + self.view.addSubview(self.sendLetterView) + self.sendLetterView.snp.makeConstraints { + $0.leading.trailing.bottom.equalTo(self.view.safeAreaLayoutGuide) + } + } } override func configUI() { super.configUI() - reloadCollectionView(with: self.letterState) - setupEmptyLabel() + self.reloadCollectionView(with: self.letterState) + self.setupEmptyLabel() } override func setupNavigationBar() { super.setupNavigationBar() - let guideButton = makeBarButtonItem(with: guideButton) - - navigationItem.rightBarButtonItem = guideButton - title = TextLiteral.letterViewControllerTitle + + let guideButton = self.makeBarButtonItem(with: self.guideButton) + self.navigationItem.rightBarButtonItem = guideButton + self.title = TextLiteral.letterViewControllerTitle } override func setupGuideArea() { super.setupGuideArea() - guideButton.setImage(ImageLiterals.icLetterInfo, for: .normal) - setupGuideText(title: TextLiteral.letterViewControllerGuideTitle, text: TextLiteral.letterViewControllerGuideText) + self.guideButton.setImage(ImageLiterals.icLetterInfo, for: .normal) + self.setupGuideText(title: TextLiteral.letterViewControllerGuideTitle, text: TextLiteral.letterViewControllerGuideText) } override func renderGuideArea() { - if let view = navigationController?.view { - view.addSubview(guideBoxImageView) - guideBoxImageView.snp.makeConstraints { - $0.top.equalTo(view.safeAreaLayoutGuide.snp.top).inset(35) - $0.trailing.equalTo(view.snp.trailing).inset(Size.leadingTrailingPadding + 8) + if let navigationView = self.navigationController?.view { + navigationView.addSubview(self.guideBoxImageView) + self.guideBoxImageView.snp.makeConstraints { + $0.top.equalTo(navigationView.safeAreaLayoutGuide.snp.top).inset(35) + $0.trailing.equalTo(navigationView.snp.trailing).inset(Size.leadingTrailingPadding + 8) $0.width.equalTo(270) $0.height.equalTo(90) } } - guideBoxImageView.addSubview(guideLabel) - guideLabel.snp.makeConstraints { + self.guideBoxImageView.addSubview(self.guideLabel) + self.guideLabel.snp.makeConstraints { $0.top.equalToSuperview().inset(20) $0.leading.trailing.equalToSuperview().inset(15) } @@ -207,12 +205,12 @@ final class LetterViewController: BaseViewController { // MARK: - func private func setupLargeTitle() { - navigationController?.navigationBar.prefersLargeTitles = true - navigationItem.largeTitleDisplayMode = .automatic + self.navigationController?.navigationBar.prefersLargeTitles = true + self.navigationItem.largeTitleDisplayMode = .automatic } private func setupEmptyView() { - emptyLabel.isHidden = !letterList.isEmpty + self.emptyLabel.isHidden = !self.letterList.isEmpty } private func setupButtonAction() { @@ -229,25 +227,25 @@ final class LetterViewController: BaseViewController { } self.present(navigationController, animated: true, completion: nil) } - sendLetterView.sendLetterButton.addAction(presentSendButtonAction, - for: .touchUpInside) + self.sendLetterView.sendLetterButton.addAction(presentSendButtonAction, + for: .touchUpInside) } private func reloadCollectionView(with state: LetterState) { let isReceivedState = (state == .received) let bottomInset: CGFloat = (isReceivedState ? 0 : 73) - let topPoint = listCollectionView.adjustedContentInset.top + 1 + let topPoint = self.listCollectionView.adjustedContentInset.top + 1 - sendLetterView.isHidden = isReceivedState - listCollectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: bottomInset, right: 0) - listCollectionView.setContentOffset(CGPoint(x: 0, y: -topPoint), animated: false) - listCollectionView.collectionViewLayout.invalidateLayout() + self.sendLetterView.isHidden = isReceivedState + self.listCollectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: bottomInset, right: 0) + self.listCollectionView.setContentOffset(CGPoint(x: 0, y: -topPoint), animated: false) + self.listCollectionView.collectionViewLayout.invalidateLayout() switch state { case .sent: - fetchSendLetter(roomId: roomId) + self.fetchSendLetter(roomId: self.roomId) case .received: - fetchReceviedLetter(roomId: roomId) + self.fetchReceviedLetter(roomId: self.roomId) } } @@ -265,25 +263,25 @@ final class LetterViewController: BaseViewController { } private func hideGuideViewWhenTappedAround() { - let navigationTap = UITapGestureRecognizer(target: self, action: #selector(dismissGuideView)) - let viewTap = UITapGestureRecognizer(target: self, action: #selector(dismissGuideView)) + let navigationTap = UITapGestureRecognizer(target: self, action: #selector(self.dismissGuideView)) + let viewTap = UITapGestureRecognizer(target: self, action: #selector(self.dismissGuideView)) navigationTap.cancelsTouchesInView = false viewTap.cancelsTouchesInView = false - navigationController?.view.addGestureRecognizer(navigationTap) - view.addGestureRecognizer(viewTap) + self.navigationController?.view.addGestureRecognizer(navigationTap) + self.view.addGestureRecognizer(viewTap) } private func setupEmptyLabel() { - emptyLabel.text = letterState.labelText - emptyLabel.isHidden = true + self.emptyLabel.text = self.letterState.labelText + self.emptyLabel.isHidden = true } // MARK: - selector @objc private func dismissGuideView() { - if !guideButton.isTouchInside { - guideBoxImageView.isHidden = true + if !self.guideButton.isTouchInside { + self.guideBoxImageView.isHidden = true } } @@ -292,12 +290,12 @@ final class LetterViewController: BaseViewController { private func fetchSendLetter(roomId: String) { Task { do { - let letterContent = try await letterSevice.fetchSendLetter(roomId: roomId) + let letterContent = try await self.letterSevice.fetchSendLetter(roomId: roomId) if let content = letterContent { dump(content) - manitteeId = content.manittee?.id - letterList = content.messages + self.manitteeId = content.manittee?.id + self.letterList = content.messages } } catch NetworkError.serverError { print("serverError") @@ -310,11 +308,11 @@ final class LetterViewController: BaseViewController { private func fetchReceviedLetter(roomId: String) { Task { do { - let letterContent = try await letterSevice.fetchReceiveLetter(roomId: roomId) + let letterContent = try await self.letterSevice.fetchReceiveLetter(roomId: roomId) if let content = letterContent { dump(content) - letterList = content.messages + self.letterList = content.messages } } catch NetworkError.serverError { print("serverError") @@ -328,12 +326,12 @@ final class LetterViewController: BaseViewController { // MARK: - UICollectionViewDataSource extension LetterViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return letterList.count + return self.letterList.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell: LetterCollectionViewCell = collectionView.dequeueReusableCell(forIndexPath: indexPath) - cell.setLetterData(with: letterList[indexPath.item], isHidden: letterState.isHidden) + cell.setLetterData(with: self.letterList[indexPath.item], isHidden: self.letterState.isHidden) cell.didTappedReport = { [weak self] in self?.sendReportMail(userNickname: UserDefaultStorage.nickname ?? "", content: self?.letterList[indexPath.item].content ?? "글 내용 없음") @@ -351,12 +349,14 @@ extension LetterViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView { switch kind { case UICollectionView.elementKindSectionHeader: - guard let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: LetterHeaderView.className, for: indexPath) as? LetterHeaderView else { + guard let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, + withReuseIdentifier: LetterHeaderView.className, + for: indexPath) as? LetterHeaderView else { assert(false, "do not have reusable view") return UICollectionReusableView() } - headerView.segmentControlIndex = letterState.rawValue + headerView.segmentControlIndex = self.letterState.rawValue headerView.changeSegmentControlIndex = { [weak self] index in guard let letterStatus = LetterState.init(rawValue: index) else { return } self?.letterState = letterStatus @@ -375,11 +375,11 @@ extension LetterViewController: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { var heights = [InternalSize.cellInset.top, InternalSize.cellInset.bottom] - if let content = letterList[indexPath.item].content { - heights += [calculateContentHeight(text: content)] + if let content = self.letterList[indexPath.item].content { + heights += [self.calculateContentHeight(text: content)] } - if letterList[indexPath.item].imageUrl != nil { + if self.letterList[indexPath.item].imageUrl != nil { heights += [InternalSize.imageHeight] } @@ -394,6 +394,6 @@ extension LetterViewController: UICollectionViewDelegateFlowLayout { // MARK: - UICollectionViewDelegate extension LetterViewController: UICollectionViewDelegate { func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { - guideBoxImageView.isHidden = true + self.guideBoxImageView.isHidden = true } } From 0763eded34e7c86ed3747ea9c36a17887194c1fe Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 17:07:57 +0900 Subject: [PATCH 21/69] =?UTF-8?q?[CHORE]=20=EB=A0=88=EC=9D=B4=EC=95=84?= =?UTF-8?q?=EC=9B=83=20=EC=84=A4=EC=A0=95=20=ED=95=A8=EC=88=98=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Global/Base/BaseViewController.swift | 4 ++-- Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift | 2 +- .../ChooseCharacter/ChooseCharacterViewController.swift | 2 +- .../Screens/CreateNickName/CreateNickNameViewController.swift | 2 +- .../Manito/Screens/CreateRoom/CreateRoomViewController.swift | 2 +- .../Manito/Screens/Detail-Ing/DetailIngViewController.swift | 2 +- .../Screens/Detail-Ing/DetailngCodebaseViewController.swift | 2 +- Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift | 2 +- .../Manito/Screens/Detail-Wait/DetailEditViewController.swift | 2 +- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 2 +- .../Screens/Interaction/OpenManittoPopupViewController.swift | 2 +- .../Screens/Interaction/OpenManittoViewController.swift | 2 +- .../Screens/InvitedCode/InvitedCodeViewController.swift | 2 +- Manito/Manito/Screens/Letter/CreateLetterViewController.swift | 2 +- Manito/Manito/Screens/Letter/LetterImageViewController.swift | 2 +- Manito/Manito/Screens/Letter/LetterViewController.swift | 2 +- Manito/Manito/Screens/Login/LoginViewController.swift | 2 +- Manito/Manito/Screens/Main/MainViewController.swift | 2 +- .../ParticipateRoom/ParticipateRoomViewController.swift | 2 +- .../Manito/Screens/Setting/ChangeNickNameViewController.swift | 2 +- Manito/Manito/Screens/Setting/SettingViewController.swift | 2 +- .../SettingDeveloperInfoViewController.swift | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Manito/Manito/Global/Base/BaseViewController.swift b/Manito/Manito/Global/Base/BaseViewController.swift index a87229e84..c4975d044 100644 --- a/Manito/Manito/Global/Base/BaseViewController.swift +++ b/Manito/Manito/Global/Base/BaseViewController.swift @@ -49,7 +49,7 @@ class BaseViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - render() + setupLayout() configUI() setupBackButton() hidekeyboardWhenTappedAround() @@ -66,7 +66,7 @@ class BaseViewController: UIViewController { setupInteractivePopGestureRecognizer() } - func render() { + func setupLayout() { // Override Layout } diff --git a/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift b/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift index 544ae3e28..8ff027af0 100644 --- a/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift +++ b/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift @@ -73,7 +73,7 @@ class CheckRoomViewController: BaseViewController { setupViewController() } - override func render() { + override func setupLayout() { view.addSubview(roomInfoImageView) roomInfoImageView.snp.makeConstraints { $0.center.equalToSuperview() diff --git a/Manito/Manito/Screens/ChooseCharacter/ChooseCharacterViewController.swift b/Manito/Manito/Screens/ChooseCharacter/ChooseCharacterViewController.swift index 363593e4f..2c8edb1fc 100644 --- a/Manito/Manito/Screens/ChooseCharacter/ChooseCharacterViewController.swift +++ b/Manito/Manito/Screens/ChooseCharacter/ChooseCharacterViewController.swift @@ -127,7 +127,7 @@ class ChooseCharacterViewController: BaseViewController { // MARK: - life cycle - override func render() { + override func setupLayout() { view.addSubview(closeButton) closeButton.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(9) diff --git a/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift b/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift index 8c781ba02..f64f50a6e 100644 --- a/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift +++ b/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift @@ -90,7 +90,7 @@ class CreateNickNameViewController: BaseViewController { } } - override func render() { + override func setupLayout() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(66) diff --git a/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift b/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift index d88b4a9fe..c4bcda759 100644 --- a/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift +++ b/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift @@ -88,7 +88,7 @@ class CreateRoomViewController: BaseViewController { setupNotificationCenter() } - override func render() { + override func setupLayout() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(66) diff --git a/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift b/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift index df467f4ab..73441cf74 100644 --- a/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift +++ b/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift @@ -116,7 +116,7 @@ class DetailIngViewController: BaseViewController { renderGuideArea() } - override func render() { + override func setupLayout() { view.addSubview(manitoOpenButton) manitoOpenButton.snp.makeConstraints { $0.bottom.equalTo(view.safeAreaLayoutGuide).inset(7) diff --git a/Manito/Manito/Screens/Detail-Ing/DetailngCodebaseViewController.swift b/Manito/Manito/Screens/Detail-Ing/DetailngCodebaseViewController.swift index 66207105d..ad9e56d41 100644 --- a/Manito/Manito/Screens/Detail-Ing/DetailngCodebaseViewController.swift +++ b/Manito/Manito/Screens/Detail-Ing/DetailngCodebaseViewController.swift @@ -244,7 +244,7 @@ final class DetailingCodebaseViewController: BaseViewController { requestRoomInfo() } - override func render() { + override func setupLayout() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(19) diff --git a/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift b/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift index 244f7be4a..9f6196c10 100644 --- a/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift +++ b/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift @@ -116,7 +116,7 @@ final class MemoryViewController: BaseViewController { // MARK: - life cycle - override func render() { + override func setupLayout() { view.addSubview(segmentControl) segmentControl.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(30) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index a3499ec6a..6b304c091 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -154,7 +154,7 @@ final class DetailEditViewController: BaseViewController { setupChangedButton() } - override func render() { + override func setupLayout() { view.addSubview(cancelButton) cancelButton.snp.makeConstraints { $0.top.equalToSuperview().inset(24) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 602ff26af..de7c19930 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -176,7 +176,7 @@ final class DetailWaitViewController: BaseViewController { setupNotificationCenter() } - override func render() { + override func setupLayout() { view.addSubview(titleView) titleView.snp.makeConstraints { $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) diff --git a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift index deee98ccd..6d37853e4 100644 --- a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift +++ b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift @@ -62,7 +62,7 @@ final class OpenManittoPopupViewController: BaseViewController { setTypingAnimation() } - override func render() { + override func setupLayout() { view.addSubview(popupView) popupView.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(UIScreen.main.bounds.size.height * 0.15) diff --git a/Manito/Manito/Screens/Interaction/OpenManittoViewController.swift b/Manito/Manito/Screens/Interaction/OpenManittoViewController.swift index 1f547bc65..0d1bb950f 100644 --- a/Manito/Manito/Screens/Interaction/OpenManittoViewController.swift +++ b/Manito/Manito/Screens/Interaction/OpenManittoViewController.swift @@ -85,7 +85,7 @@ final class OpenManittoViewController: BaseViewController { requestWithFriends(roomId: roomId) } - override func render() { + override func setupLayout() { view.addSubview(titleLabel) titleLabel.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(57) diff --git a/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift b/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift index 6b4cd0ed4..d24bb0d76 100644 --- a/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift +++ b/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift @@ -103,7 +103,7 @@ class InvitedCodeViewController: BaseViewController { // MARK: - configure - override func render() { + override func setupLayout() { view.addSubview(invitedImageView) invitedImageView.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(142) diff --git a/Manito/Manito/Screens/Letter/CreateLetterViewController.swift b/Manito/Manito/Screens/Letter/CreateLetterViewController.swift index 7150e0b7e..ba80605b5 100644 --- a/Manito/Manito/Screens/Letter/CreateLetterViewController.swift +++ b/Manito/Manito/Screens/Letter/CreateLetterViewController.swift @@ -80,7 +80,7 @@ final class CreateLetterViewController: BaseViewController { setupButtonAction() } - override func render() { + override func setupLayout() { view.addSubview(indicatorView) indicatorView.snp.makeConstraints { $0.top.equalToSuperview().inset(9) diff --git a/Manito/Manito/Screens/Letter/LetterImageViewController.swift b/Manito/Manito/Screens/Letter/LetterImageViewController.swift index 42a16d591..fb856e5ce 100644 --- a/Manito/Manito/Screens/Letter/LetterImageViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterImageViewController.swift @@ -36,7 +36,7 @@ final class LetterImageViewController: BaseViewController { // MARK: - life cycle - override func render() { + override func setupLayout() { view.addSubview(scrollView) scrollView.addSubview(imageView) view.addSubview(closeButton) diff --git a/Manito/Manito/Screens/Letter/LetterViewController.swift b/Manito/Manito/Screens/Letter/LetterViewController.swift index b2a219fe5..b14b2cd2c 100644 --- a/Manito/Manito/Screens/Letter/LetterViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterViewController.swift @@ -140,7 +140,7 @@ final class LetterViewController: BaseViewController { // MARK: - override - override func render() { + override func setupLayout() { self.view.addSubview(self.listCollectionView) self.listCollectionView.snp.makeConstraints { $0.edges.equalTo(self.view.safeAreaLayoutGuide) diff --git a/Manito/Manito/Screens/Login/LoginViewController.swift b/Manito/Manito/Screens/Login/LoginViewController.swift index e13074190..960ed85bf 100644 --- a/Manito/Manito/Screens/Login/LoginViewController.swift +++ b/Manito/Manito/Screens/Login/LoginViewController.swift @@ -35,7 +35,7 @@ final class LoginViewController: BaseViewController { // MARK: - func - override func render() { + override func setupLayout() { view.addSubview(logoImageView) logoImageView.snp.makeConstraints { $0.centerX.equalToSuperview() diff --git a/Manito/Manito/Screens/Main/MainViewController.swift b/Manito/Manito/Screens/Main/MainViewController.swift index 9794e6464..1b93fe44c 100644 --- a/Manito/Manito/Screens/Main/MainViewController.swift +++ b/Manito/Manito/Screens/Main/MainViewController.swift @@ -118,7 +118,7 @@ final class MainViewController: BaseViewController { requestManittoRoomList() } - override func render() { + override func setupLayout() { view.addSubview(maCharacterImageView) maCharacterImageView.snp.makeConstraints { $0.leading.equalToSuperview().inset(70) diff --git a/Manito/Manito/Screens/ParticipateRoom/ParticipateRoomViewController.swift b/Manito/Manito/Screens/ParticipateRoom/ParticipateRoomViewController.swift index 85dae17ee..31a78df7a 100644 --- a/Manito/Manito/Screens/ParticipateRoom/ParticipateRoomViewController.swift +++ b/Manito/Manito/Screens/ParticipateRoom/ParticipateRoomViewController.swift @@ -57,7 +57,7 @@ final class ParticipateRoomViewController: BaseViewController { setupNotificationCenter() } - override func render() { + override func setupLayout() { view.addSubview(closeButton) closeButton.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(9) diff --git a/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift b/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift index dd134e60f..7f1c8bde1 100644 --- a/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift +++ b/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift @@ -71,7 +71,7 @@ class ChangeNickNameViewController: BaseViewController { setupLargeTitle() } - override func render() { + override func setupLayout() { view.addSubview(nameTextField) nameTextField.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).inset(66) diff --git a/Manito/Manito/Screens/Setting/SettingViewController.swift b/Manito/Manito/Screens/Setting/SettingViewController.swift index 18aa9a10e..dd601514f 100644 --- a/Manito/Manito/Screens/Setting/SettingViewController.swift +++ b/Manito/Manito/Screens/Setting/SettingViewController.swift @@ -54,7 +54,7 @@ class SettingViewController: BaseViewController { navigationController?.navigationBar.prefersLargeTitles = false } - override func render() { + override func setupLayout() { view.addSubview(imageRow) imageRow.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide) diff --git a/Manito/Manito/Screens/SettingDeveloperInfo/SettingDeveloperInfoViewController.swift b/Manito/Manito/Screens/SettingDeveloperInfo/SettingDeveloperInfoViewController.swift index 68b6a7c22..a37ded00b 100644 --- a/Manito/Manito/Screens/SettingDeveloperInfo/SettingDeveloperInfoViewController.swift +++ b/Manito/Manito/Screens/SettingDeveloperInfo/SettingDeveloperInfoViewController.swift @@ -108,7 +108,7 @@ final class SettingDeveloperInfoViewController: BaseViewController { setupLargeTitle() } - override func render() { + override func setupLayout() { view.addSubview(listCollectionView) listCollectionView.snp.makeConstraints { $0.top.equalTo(view.safeAreaLayoutGuide).offset(30) From 3bc7c2a43ceee656fc0f691e7c2d679ad3d24476 Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 17:09:20 +0900 Subject: [PATCH 22/69] =?UTF-8?q?[CHORE]=20ConfigureUI=EB=A1=9C=20configUI?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Global/Base/BaseViewController.swift | 4 ++-- Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift | 2 +- .../Screens/CreateNickName/CreateNickNameViewController.swift | 4 ++-- .../Manito/Screens/CreateRoom/CreateRoomViewController.swift | 4 ++-- .../Manito/Screens/Detail-Ing/DetailIngViewController.swift | 4 ++-- .../Manito/Screens/Detail-Ing/FriendListViewController.swift | 4 ++-- Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift | 4 ++-- .../Manito/Screens/Detail-Wait/DetailEditViewController.swift | 4 ++-- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 4 ++-- .../Screens/Interaction/OpenManittoPopupViewController.swift | 2 +- .../Screens/Interaction/SelectManittoViewController.swift | 4 ++-- .../Screens/InvitedCode/InvitedCodeViewController.swift | 2 +- Manito/Manito/Screens/Letter/CreateLetterViewController.swift | 4 ++-- Manito/Manito/Screens/Letter/LetterImageViewController.swift | 2 +- Manito/Manito/Screens/Letter/LetterViewController.swift | 4 ++-- .../Manito/Screens/Setting/ChangeNickNameViewController.swift | 4 ++-- Manito/Manito/Screens/Setting/SettingViewController.swift | 4 ++-- 17 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Manito/Manito/Global/Base/BaseViewController.swift b/Manito/Manito/Global/Base/BaseViewController.swift index c4975d044..e1eb4f8a2 100644 --- a/Manito/Manito/Global/Base/BaseViewController.swift +++ b/Manito/Manito/Global/Base/BaseViewController.swift @@ -50,7 +50,7 @@ class BaseViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() setupLayout() - configUI() + configureUI() setupBackButton() hidekeyboardWhenTappedAround() setupNavigationBar() @@ -70,7 +70,7 @@ class BaseViewController: UIViewController { // Override Layout } - func configUI() { + func configureUI() { view.backgroundColor = .backgroundGrey } diff --git a/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift b/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift index 8ff027af0..6844db072 100644 --- a/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift +++ b/Manito/Manito/Screens/CheckRoom/CheckRoomViewController.swift @@ -110,7 +110,7 @@ class CheckRoomViewController: BaseViewController { } } - override func configUI() { + override func configureUI() { view.backgroundColor = .black.withAlphaComponent(0.7) } diff --git a/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift b/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift index f64f50a6e..626970359 100644 --- a/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift +++ b/Manito/Manito/Screens/CreateNickName/CreateNickNameViewController.swift @@ -191,8 +191,8 @@ class CreateNickNameViewController: BaseViewController { // MARK: - Configure - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() } } diff --git a/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift b/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift index c4bcda759..4887b5f49 100644 --- a/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift +++ b/Manito/Manito/Screens/CreateRoom/CreateRoomViewController.swift @@ -148,8 +148,8 @@ class CreateRoomViewController: BaseViewController { // MARK: - Configure - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() navigationController?.navigationBar.isHidden = true } diff --git a/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift b/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift index 73441cf74..fce9e6cb2 100644 --- a/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift +++ b/Manito/Manito/Screens/Detail-Ing/DetailIngViewController.swift @@ -146,8 +146,8 @@ class DetailIngViewController: BaseViewController { } } - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() setupFont() setupViewLayer() setupStatusLabel() diff --git a/Manito/Manito/Screens/Detail-Ing/FriendListViewController.swift b/Manito/Manito/Screens/Detail-Ing/FriendListViewController.swift index 2cecf7817..02fd96b40 100644 --- a/Manito/Manito/Screens/Detail-Ing/FriendListViewController.swift +++ b/Manito/Manito/Screens/Detail-Ing/FriendListViewController.swift @@ -36,8 +36,8 @@ final class FriendListViewController: BaseViewController { setupDelegation() } - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() friendListCollectionView.backgroundColor = .clear } diff --git a/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift b/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift index 9f6196c10..c038e5164 100644 --- a/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift +++ b/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift @@ -179,8 +179,8 @@ final class MemoryViewController: BaseViewController { } } - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() setupAction() } diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 6b304c091..e2f0560cd 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -146,8 +146,8 @@ final class DetailEditViewController: BaseViewController { // MARK: - life cycle - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() self.navigationController?.isNavigationBarHidden = true self.presentationController?.delegate = self isModalInPresentation = true diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index de7c19930..619f06e4f 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -217,8 +217,8 @@ final class DetailWaitViewController: BaseViewController { } } - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() setupSettingButton() } diff --git a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift index 6d37853e4..55346eaee 100644 --- a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift +++ b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift @@ -90,7 +90,7 @@ final class OpenManittoPopupViewController: BaseViewController { } } - override func configUI() { + override func configureUI() { view.backgroundColor = .black.withAlphaComponent(0.8) } diff --git a/Manito/Manito/Screens/Interaction/SelectManittoViewController.swift b/Manito/Manito/Screens/Interaction/SelectManittoViewController.swift index da6ffb454..743f7f5cb 100644 --- a/Manito/Manito/Screens/Interaction/SelectManittoViewController.swift +++ b/Manito/Manito/Screens/Interaction/SelectManittoViewController.swift @@ -64,8 +64,8 @@ final class SelectManittoViewController: BaseViewController { setupGifImage() } - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() informationLabel.font = .font(.regular, ofSize: 20) nameLabel.font = .font(.regular, ofSize: 30) diff --git a/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift b/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift index d24bb0d76..1bcc2d2ca 100644 --- a/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift +++ b/Manito/Manito/Screens/InvitedCode/InvitedCodeViewController.swift @@ -153,7 +153,7 @@ class InvitedCodeViewController: BaseViewController { } } - override func configUI() { + override func configureUI() { view.backgroundColor = .black.withAlphaComponent(0.8) } } diff --git a/Manito/Manito/Screens/Letter/CreateLetterViewController.swift b/Manito/Manito/Screens/Letter/CreateLetterViewController.swift index ba80605b5..ab767ab97 100644 --- a/Manito/Manito/Screens/Letter/CreateLetterViewController.swift +++ b/Manito/Manito/Screens/Letter/CreateLetterViewController.swift @@ -122,8 +122,8 @@ final class CreateLetterViewController: BaseViewController { } } - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() navigationController?.presentationController?.delegate = self isModalInPresentation = true diff --git a/Manito/Manito/Screens/Letter/LetterImageViewController.swift b/Manito/Manito/Screens/Letter/LetterImageViewController.swift index fb856e5ce..57ca454b9 100644 --- a/Manito/Manito/Screens/Letter/LetterImageViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterImageViewController.swift @@ -53,7 +53,7 @@ final class LetterImageViewController: BaseViewController { } } - override func configUI() { + override func configureUI() { setupScrollView() setupImageView() setImagePinchGesture() diff --git a/Manito/Manito/Screens/Letter/LetterViewController.swift b/Manito/Manito/Screens/Letter/LetterViewController.swift index b14b2cd2c..aff3eea06 100644 --- a/Manito/Manito/Screens/Letter/LetterViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterViewController.swift @@ -164,8 +164,8 @@ final class LetterViewController: BaseViewController { } } - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() self.reloadCollectionView(with: self.letterState) self.setupEmptyLabel() } diff --git a/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift b/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift index 7f1c8bde1..e76161c9f 100644 --- a/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift +++ b/Manito/Manito/Screens/Setting/ChangeNickNameViewController.swift @@ -178,8 +178,8 @@ class ChangeNickNameViewController: BaseViewController { // MARK: - Configure - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() } override func setupNavigationBar() { diff --git a/Manito/Manito/Screens/Setting/SettingViewController.swift b/Manito/Manito/Screens/Setting/SettingViewController.swift index dd601514f..52e4966e3 100644 --- a/Manito/Manito/Screens/Setting/SettingViewController.swift +++ b/Manito/Manito/Screens/Setting/SettingViewController.swift @@ -73,8 +73,8 @@ class SettingViewController: BaseViewController { // MARK: - Configure - override func configUI() { - super.configUI() + override func configureUI() { + super.configureUI() } override func setupNavigationBar() { From 1d6fa7f09f8d42f5661863cc32949c6ffd7b485c Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 17:15:57 +0900 Subject: [PATCH 23/69] =?UTF-8?q?[DEL]=20action=20closure=20=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20=EC=82=AD=EC=A0=9C(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Letter/LetterViewController+MailCompose.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift b/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift index b858129c0..dce0ceba7 100644 --- a/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift +++ b/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift @@ -43,10 +43,7 @@ extension LetterViewController: MFMailComposeViewControllerDelegate { private func showSendMailErrorAlert() { let sendMailErrorAlert = UIAlertController(title: "메일 전송 실패", message: "아이폰 이메일 설정을 확인하고 다시 시도해주세요.", preferredStyle: .alert) - let confirmAction = UIAlertAction(title: "확인", style: .default) { - (action) in - print("확인") - } + let confirmAction = UIAlertAction(title: "확인", style: .default) sendMailErrorAlert.addAction(confirmAction) self.present(sendMailErrorAlert, animated: true, completion: nil) } From 331d8c255a3318f69b4fd17f757101a6beca4e5d Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 20:19:35 +0900 Subject: [PATCH 24/69] =?UTF-8?q?[DEL]=20completion=20handler=20nil=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=20=EC=82=AD=EC=A0=9C(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Letter/LetterViewController+MailCompose.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift b/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift index dce0ceba7..b3a9b7ee6 100644 --- a/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift +++ b/Manito/Manito/Screens/Letter/LetterViewController+MailCompose.swift @@ -34,7 +34,7 @@ extension LetterViewController: MFMailComposeViewControllerDelegate { composeVC.setSubject("[신고 관련 문의]") composeVC.setMessageBody(messageBody, isHTML: false) - self.present(composeVC, animated: true, completion: nil) + self.present(composeVC, animated: true) } else { self.showSendMailErrorAlert() @@ -45,10 +45,10 @@ extension LetterViewController: MFMailComposeViewControllerDelegate { let sendMailErrorAlert = UIAlertController(title: "메일 전송 실패", message: "아이폰 이메일 설정을 확인하고 다시 시도해주세요.", preferredStyle: .alert) let confirmAction = UIAlertAction(title: "확인", style: .default) sendMailErrorAlert.addAction(confirmAction) - self.present(sendMailErrorAlert, animated: true, completion: nil) + self.present(sendMailErrorAlert, animated: true) } func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) { - controller.dismiss(animated: true, completion: nil) + controller.dismiss(animated: true) } } From 39f456aad49f0d087cb3d47515924213e68bd3d5 Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 20:28:28 +0900 Subject: [PATCH 25/69] =?UTF-8?q?[CHORE]=20CreateLetterVC=20=EB=82=B4?= =?UTF-8?q?=EB=B6=80=20=EC=BD=94=EB=93=9C=20convention=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=B0=EC=84=9C=20=EB=B3=80=EA=B2=BD(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Letter/CreateLetterViewController.swift | 112 +++++++++--------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/Manito/Manito/Screens/Letter/CreateLetterViewController.swift b/Manito/Manito/Screens/Letter/CreateLetterViewController.swift index ab767ab97..2c6db87cf 100644 --- a/Manito/Manito/Screens/Letter/CreateLetterViewController.swift +++ b/Manito/Manito/Screens/Letter/CreateLetterViewController.swift @@ -13,7 +13,7 @@ final class CreateLetterViewController: BaseViewController { var createLetter: (() -> ())? - // MARK: - property + // MARK: - ui component private let indicatorView: UIView = { let view = UIView() @@ -45,9 +45,11 @@ final class CreateLetterViewController: BaseViewController { return scrollView }() private let scrollContentView = UIView() - private lazy var missionView = IndividualMissionView(mission: mission) private let letterTextView = LetterTextView() private let letterPhotoView = LetterPhotoView() + private lazy var missionView = IndividualMissionView(mission: self.mission) + + // MARK: - property private let letterSevice: LetterAPI = LetterAPI(apiService: APIService()) var manitteeId: String @@ -75,48 +77,50 @@ final class CreateLetterViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - checkSendButtonEnabled() - setupNavigationItem() - setupButtonAction() + self.checkSendButtonEnabled() + self.setupNavigationItem() + self.setupButtonAction() } + + // MARK: - override override func setupLayout() { - view.addSubview(indicatorView) - indicatorView.snp.makeConstraints { + self.view.addSubview(self.indicatorView) + self.indicatorView.snp.makeConstraints { $0.top.equalToSuperview().inset(9) $0.centerX.equalToSuperview() $0.height.equalTo(3) $0.width.equalTo(40) } - view.addSubview(scrollView) - scrollView.snp.makeConstraints { - $0.top.equalTo(view.safeAreaLayoutGuide) + self.view.addSubview(self.scrollView) + self.scrollView.snp.makeConstraints { + $0.top.equalTo(self.view.safeAreaLayoutGuide) $0.leading.trailing.bottom.equalToSuperview() } - scrollView.addSubview(scrollContentView) - scrollContentView.snp.makeConstraints { + self.scrollView.addSubview(self.scrollContentView) + self.scrollContentView.snp.makeConstraints { $0.edges.equalToSuperview() - $0.width.equalTo(scrollView.snp.width) + $0.width.equalTo(self.scrollView.snp.width) } - scrollContentView.addSubview(missionView) - missionView.snp.makeConstraints { + self.scrollContentView.addSubview(self.missionView) + self.missionView.snp.makeConstraints { $0.top.equalToSuperview().offset(25) $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) $0.height.equalTo(100) } - scrollContentView.addSubview(letterTextView) - letterTextView.snp.makeConstraints { - $0.top.equalTo(missionView.snp.bottom).offset(32) + self.scrollContentView.addSubview(self.letterTextView) + self.letterTextView.snp.makeConstraints { + $0.top.equalTo(self.missionView.snp.bottom).offset(32) $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) } - scrollContentView.addSubview(letterPhotoView) - letterPhotoView.snp.makeConstraints { - $0.top.equalTo(letterTextView.snp.bottom).offset(22) + self.scrollContentView.addSubview(self.letterPhotoView) + self.letterPhotoView.snp.makeConstraints { + $0.top.equalTo(self.letterTextView.snp.bottom).offset(22) $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) $0.bottom.equalToSuperview().inset(105) } @@ -125,12 +129,12 @@ final class CreateLetterViewController: BaseViewController { override func configureUI() { super.configureUI() - navigationController?.presentationController?.delegate = self - isModalInPresentation = true + self.navigationController?.presentationController?.delegate = self + self.isModalInPresentation = true } override func setupNavigationBar() { - guard let navigationBar = navigationController?.navigationBar else { return } + guard let navigationBar = self.navigationController?.navigationBar else { return } let appearance = UINavigationBarAppearance() let font = UIFont.font(.regular, ofSize: 16) @@ -145,36 +149,36 @@ final class CreateLetterViewController: BaseViewController { navigationBar.compactAppearance = appearance navigationBar.scrollEdgeAppearance = appearance - title = TextLiteral.createLetterViewControllerTitle + self.title = TextLiteral.createLetterViewControllerTitle } // MARK: - func private func checkSendButtonEnabled() { - letterTextView.applySendButtonEnabled = { [weak self] in + self.letterTextView.applySendButtonEnabled = { [weak self] in self?.changeButtonEnabledState() } - letterPhotoView.applySendButtonEnabled = { [weak self] in + self.letterPhotoView.applySendButtonEnabled = { [weak self] in self?.changeButtonEnabledState() } } private func changeButtonEnabledState() { - let hasText = letterTextView.letterTextView.hasText - let hasImage = letterPhotoView.importPhotosButton.imageView?.image != ImageLiterals.btnCamera + let hasText = self.letterTextView.letterTextView.hasText + let hasImage = self.letterPhotoView.importPhotosButton.imageView?.image != ImageLiterals.btnCamera let canEnabled = hasText || hasImage - sendButton.isEnabled = canEnabled + self.sendButton.isEnabled = canEnabled } private func setupNavigationItem() { - let cancelButton = makeBarButtonItem(with: cancelButton) - let sendButton = makeBarButtonItem(with: sendButton) + let cancelButton = self.makeBarButtonItem(with: cancelButton) + let sendButton = self.makeBarButtonItem(with: sendButton) sendButton.isEnabled = false - navigationItem.leftBarButtonItem = cancelButton - navigationItem.rightBarButtonItem = sendButton + self.navigationItem.leftBarButtonItem = cancelButton + self.navigationItem.rightBarButtonItem = sendButton } private func setupButtonAction() { @@ -188,19 +192,19 @@ final class CreateLetterViewController: BaseViewController { self?.dismiss(animated: true) } - cancelButton.addAction(cancelAction, for: .touchUpInside) - sendButton.addAction(sendAction, for: .touchUpInside) + self.cancelButton.addAction(cancelAction, for: .touchUpInside) + self.sendButton.addAction(sendAction, for: .touchUpInside) } private func presentationControllerDidAttemptToDismissAction() { - let hasText = letterTextView.letterTextView.hasText - let hasImage = letterPhotoView.importPhotosButton.imageView?.image != ImageLiterals.btnCamera + let hasText = self.letterTextView.letterTextView.hasText + let hasImage = self.letterPhotoView.importPhotosButton.imageView?.image != ImageLiterals.btnCamera guard hasText || hasImage else { - dismiss(animated: true, completion: nil) + self.dismiss(animated: true, completion: nil) return } - presentActionSheet() + self.presentActionSheet() } private func presentActionSheet() { @@ -208,9 +212,9 @@ final class CreateLetterViewController: BaseViewController { self?.resignFirstResponder() self?.dismiss(animated: true, completion: nil) } - makeActionSheet(actionTitles: [TextLiteral.destructive, TextLiteral.cancel], - actionStyle: [.destructive, .cancel], - actions: [dismissAction, nil]) + self.makeActionSheet(actionTitles: [TextLiteral.destructive, TextLiteral.cancel], + actionStyle: [.destructive, .cancel], + actions: [dismissAction, nil]) } // MARK: - network @@ -218,31 +222,31 @@ final class CreateLetterViewController: BaseViewController { private func dispatchLetter(roomId: String) { Task { do { - if let content = letterTextView.letterTextView.text, - let image = letterPhotoView.importPhotosButton.imageView?.image, + if let content = self.letterTextView.letterTextView.text, + let image = self.letterPhotoView.importPhotosButton.imageView?.image, image != ImageLiterals.btnCamera { guard let jpegData = image.jpegData(compressionQuality: 0.3) else { return } - let dto = LetterDTO(manitteeId: manitteeId, messageContent: content) + let dto = LetterDTO(manitteeId: self.manitteeId, messageContent: content) - let status = try await letterSevice.dispatchLetter(roomId: roomId, image: jpegData, letter: dto) + let status = try await self.letterSevice.dispatchLetter(roomId: roomId, image: jpegData, letter: dto) if status == 201 { self.createLetter?() } - } else if let content = letterTextView.letterTextView.text { - let dto = LetterDTO(manitteeId: manitteeId, messageContent: content) + } else if let content = self.letterTextView.letterTextView.text { + let dto = LetterDTO(manitteeId: self.manitteeId, messageContent: content) - let status = try await letterSevice.dispatchLetter(roomId: roomId, letter: dto) + let status = try await self.letterSevice.dispatchLetter(roomId: roomId, letter: dto) if status == 201 { self.createLetter?() } - } else if let image = letterPhotoView.importPhotosButton.imageView?.image, + } else if let image = self.letterPhotoView.importPhotosButton.imageView?.image, image != ImageLiterals.btnCamera { guard let jpegData = image.jpegData(compressionQuality: 0.3) else { return } - let dto = LetterDTO(manitteeId: manitteeId) + let dto = LetterDTO(manitteeId: self.manitteeId) - let status = try await letterSevice.dispatchLetter(roomId: roomId, image: jpegData, letter: dto) + let status = try await self.letterSevice.dispatchLetter(roomId: roomId, image: jpegData, letter: dto) if status == 201 { self.createLetter?() @@ -261,6 +265,6 @@ final class CreateLetterViewController: BaseViewController { // MARK: - UIAdaptivePresentationControllerDelegate extension CreateLetterViewController: UIAdaptivePresentationControllerDelegate { func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) { - presentationControllerDidAttemptToDismissAction() + self.presentationControllerDidAttemptToDismissAction() } } From f64bb29519e59e46f83341fec6c78ae62c464bdd Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 20:33:32 +0900 Subject: [PATCH 26/69] =?UTF-8?q?[FEAT]=20imageView=EC=97=90=20image?= =?UTF-8?q?=EB=A5=BC=20init=EB=A5=BC=20=ED=86=B5=ED=95=B4=EC=84=9C=20?= =?UTF-8?q?=EA=B0=80=EC=A0=B8=EC=98=A4=EB=8F=84=EB=A1=9D=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Detail-Ing/MemoryViewController.swift | 3 +-- .../Letter/LetterImageViewController.swift | 23 +++++++++++++++---- .../Screens/Letter/LetterViewController.swift | 3 +-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift b/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift index c038e5164..7f7c36d41 100644 --- a/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift +++ b/Manito/Manito/Screens/Detail-Ing/MemoryViewController.swift @@ -292,8 +292,7 @@ extension MemoryViewController: UICollectionViewDataSource { content: memory?.memoriesWithManitto?.messages?[indexPath.item].content) } cell.didTappedImage = { [weak self] image in - let viewController = LetterImageViewController() - viewController.imageView.image = image + let viewController = LetterImageViewController(image: image) viewController.modalPresentationStyle = .fullScreen viewController.modalTransitionStyle = .crossDissolve self?.present(viewController, animated: true) diff --git a/Manito/Manito/Screens/Letter/LetterImageViewController.swift b/Manito/Manito/Screens/Letter/LetterImageViewController.swift index 57ca454b9..017121136 100644 --- a/Manito/Manito/Screens/Letter/LetterImageViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterImageViewController.swift @@ -12,17 +12,16 @@ import SnapKit final class LetterImageViewController: BaseViewController { - // MARK: - property + // MARK: - ui component - private let scrollView = UIScrollView() private lazy var closeButton: UIButton = { let button = UIButton(type: .system) button.setImage(ImageLiterals.btnXmark, for: .normal) button.tintColor = .grey001 - button.addTarget(self, action: #selector(didTapCloseButton), for: .touchUpInside) + button.addTarget(self, action: #selector(self.didTapCloseButton), for: .touchUpInside) return button }() - let imageView: UIImageView = { + private let imageView: UIImageView = { let imageView = UIImageView() imageView.contentMode = .scaleAspectFit imageView.isUserInteractionEnabled = true @@ -33,6 +32,22 @@ final class LetterImageViewController: BaseViewController { button.setImage(ImageLiterals.icSave, for: .normal) return button }() + private let scrollView = UIScrollView() + + // MARK: - init + + init(image: UIImage) { + self.imageView.image = image + super.init() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + deinit { + print("\(#file) is dead") + } // MARK: - life cycle diff --git a/Manito/Manito/Screens/Letter/LetterViewController.swift b/Manito/Manito/Screens/Letter/LetterViewController.swift index aff3eea06..f1241603f 100644 --- a/Manito/Manito/Screens/Letter/LetterViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterViewController.swift @@ -337,8 +337,7 @@ extension LetterViewController: UICollectionViewDataSource { content: self?.letterList[indexPath.item].content ?? "글 내용 없음") } cell.didTappedImage = { [weak self] image in - let viewController = LetterImageViewController() - viewController.imageView.image = image + let viewController = LetterImageViewController(image: image) viewController.modalPresentationStyle = .fullScreen viewController.modalTransitionStyle = .crossDissolve self?.present(viewController, animated: true) From f99c6cd2fd26d2d5f9e15589459f5fcb932f34f0 Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 20:37:26 +0900 Subject: [PATCH 27/69] =?UTF-8?q?[CHORE]=20ScrollView=20=EC=84=B8=ED=8C=85?= =?UTF-8?q?=EC=9D=84=20=EC=84=A0=EC=96=B8=20closure=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Letter/LetterImageViewController.swift | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Manito/Manito/Screens/Letter/LetterImageViewController.swift b/Manito/Manito/Screens/Letter/LetterImageViewController.swift index 017121136..9d6dd6876 100644 --- a/Manito/Manito/Screens/Letter/LetterImageViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterImageViewController.swift @@ -21,6 +21,18 @@ final class LetterImageViewController: BaseViewController { button.addTarget(self, action: #selector(self.didTapCloseButton), for: .touchUpInside) return button }() + private lazy var scrollView: UIScrollView = { + let scrollView = UIScrollView() + scrollView.frame = view.bounds + scrollView.delegate = self + scrollView.zoomScale = 1.0 + scrollView.minimumZoomScale = 1.0 + scrollView.maximumZoomScale = 3.0 + scrollView.contentInsetAdjustmentBehavior = .never + scrollView.showsVerticalScrollIndicator = false + scrollView.showsHorizontalScrollIndicator = false + return scrollView + }() private let imageView: UIImageView = { let imageView = UIImageView() imageView.contentMode = .scaleAspectFit @@ -32,7 +44,6 @@ final class LetterImageViewController: BaseViewController { button.setImage(ImageLiterals.icSave, for: .normal) return button }() - private let scrollView = UIScrollView() // MARK: - init @@ -49,41 +60,30 @@ final class LetterImageViewController: BaseViewController { print("\(#file) is dead") } - // MARK: - life cycle + // MARK: - override override func setupLayout() { - view.addSubview(scrollView) - scrollView.addSubview(imageView) - view.addSubview(closeButton) - closeButton.snp.makeConstraints { - $0.top.equalTo(view.safeAreaLayoutGuide).inset(23) - $0.leading.equalTo(view.safeAreaLayoutGuide).inset(17) + self.view.addSubview(self.scrollView) + self.scrollView.addSubview(self.imageView) + + self.view.addSubview(self.closeButton) + self.closeButton.snp.makeConstraints { + $0.top.equalTo(self.view.safeAreaLayoutGuide).inset(23) + $0.leading.equalTo(self.view.safeAreaLayoutGuide).inset(17) $0.width.height.equalTo(44) } - view.addSubview(downloadButton) - downloadButton.snp.makeConstraints { - $0.top.equalTo(view.safeAreaLayoutGuide).inset(23) - $0.trailing.equalTo(view.safeAreaLayoutGuide).inset(17) + self.view.addSubview(self.downloadButton) + self.downloadButton.snp.makeConstraints { + $0.top.equalTo(self.view.safeAreaLayoutGuide).inset(23) + $0.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(17) } } override func configureUI() { - setupScrollView() - setupImageView() - setImagePinchGesture() - setupButtonAction() - } - - private func setupScrollView() { - scrollView.frame = view.bounds - scrollView.delegate = self - scrollView.zoomScale = 1.0 - scrollView.minimumZoomScale = 1.0 - scrollView.maximumZoomScale = 3.0 - scrollView.contentInsetAdjustmentBehavior = .never - scrollView.showsVerticalScrollIndicator = false - scrollView.showsHorizontalScrollIndicator = false + self.setupImageView() + self.setImagePinchGesture() + self.setupButtonAction() } private func setupImageView() { From e157560dce2d85186a99343fe0b8a4684c878e5e Mon Sep 17 00:00:00 2001 From: YoonAh-dev Date: Thu, 2 Feb 2023 20:49:07 +0900 Subject: [PATCH 28/69] =?UTF-8?q?[CHORE]=20LetterImageViewController=20?= =?UTF-8?q?=EB=82=B4=EB=B6=80=20=EC=BB=A8=EB=B2=A4=EC=85=98=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9(#370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Letter/LetterImageViewController.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Manito/Manito/Screens/Letter/LetterImageViewController.swift b/Manito/Manito/Screens/Letter/LetterImageViewController.swift index 9d6dd6876..72d90d2a0 100644 --- a/Manito/Manito/Screens/Letter/LetterImageViewController.swift +++ b/Manito/Manito/Screens/Letter/LetterImageViewController.swift @@ -87,13 +87,13 @@ final class LetterImageViewController: BaseViewController { } private func setupImageView() { - imageView.frame = scrollView.bounds - imageView.contentMode = .scaleAspectFit + self.imageView.frame = self.scrollView.bounds + self.imageView.contentMode = .scaleAspectFit } private func setImagePinchGesture() { - let pinch = UIPinchGestureRecognizer(target: self, action: #selector(didPinchImage(_:))) - view.addGestureRecognizer(pinch) + let pinch = UIPinchGestureRecognizer(target: self, action: #selector(self.didPinchImage(_:))) + self.view.addGestureRecognizer(pinch) } private func setupButtonAction() { @@ -106,7 +106,7 @@ final class LetterImageViewController: BaseViewController { PHPhotoLibrary.shared().performChanges({ PHAssetChangeRequest.creationRequestForAsset(from: image) - }, completionHandler: { (success, error) in + }) { (success, error) in DispatchQueue.main.async { if success { self?.makeAlert(title: TextLiteral.letterImageViewControllerSuccessTitle, @@ -117,9 +117,9 @@ final class LetterImageViewController: BaseViewController { message: TextLiteral.letterImageViewControllerErrorMessage) } } - }) + } } - downloadButton.addAction(downloadAction, for: .touchUpInside) + self.downloadButton.addAction(downloadAction, for: .touchUpInside) } // MARK: - selector @@ -131,7 +131,7 @@ final class LetterImageViewController: BaseViewController { @objc private func didPinchImage(_ pinch: UIPinchGestureRecognizer) { - imageView.transform = imageView.transform.scaledBy(x: pinch.scale, y: pinch.scale) + self.imageView.transform = self.imageView.transform.scaledBy(x: pinch.scale, y: pinch.scale) pinch.scale = 1 } } @@ -143,8 +143,8 @@ extension LetterImageViewController: UIScrollViewDelegate { func scrollViewDidZoom(_ scrollView: UIScrollView) { if scrollView.zoomScale > 1 { - guard let image = imageView.image else { return } - guard let zoomView = viewForZooming(in: scrollView) else { return } + guard let image = self.imageView.image else { return } + guard let zoomView = self.viewForZooming(in: scrollView) else { return } let widthRatio = zoomView.frame.width / image.size.width let heightRatio = zoomView.frame.height / image.size.height From b04cf031f8fcb1d1247f987a57cdeea022f50b5d Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 10:24:57 +0900 Subject: [PATCH 29/69] =?UTF-8?q?[CHORE]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EA=B3=BC=EA=B1=B0=EC=9D=B8=EC=A7=80=20=ED=99=95?= =?UTF-8?q?=EC=9D=B8=20=EB=B3=80=EC=88=98=20=EC=82=AD=EC=A0=9C=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Network/Models/Room.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Manito/Manito/Network/Models/Room.swift b/Manito/Manito/Network/Models/Room.swift index fa7fb2fea..16298a42c 100644 --- a/Manito/Manito/Network/Models/Room.swift +++ b/Manito/Manito/Network/Models/Room.swift @@ -102,9 +102,7 @@ struct RoomInfo: Decodable { var isStart: Bool { if let date = startDate?.stringToDate { - let isPast = date.distance(to: Date()) > 86400 - let isToday = date.isToday - let canStart = !isPast && isToday + let canStart = date.isToday return canStart } else { return false From 55addf2f45741f3ef35d7414c3fbc26b09134222 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 7 Feb 2023 11:09:56 +0900 Subject: [PATCH 30/69] =?UTF-8?q?[CHORE]=20AlertText=20=ED=8A=9C=ED=94=8C?= =?UTF-8?q?=20=ED=98=95=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailWaitViewController.swift | 42 ++++--------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 0ac1d4f90..0abbf128d 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -32,44 +32,16 @@ final class DetailWaitViewController: BaseViewController { case owner case member - var alertText: AlertText { + var alertText: (title: String, message: String, okTitle: String) { switch self { case .owner: - return .delete + return (title: TextLiteral.datailWaitViewControllerDeleteTitle, + message: TextLiteral.datailWaitViewControllerDeleteMessage, + okTitle: TextLiteral.delete) case .member: - return .exit - } - } - } - - private enum AlertText { - case delete - case exit - - var title: String { - switch self { - case .delete: - return TextLiteral.datailWaitViewControllerDeleteTitle - case .exit: - return TextLiteral.datailWaitViewControllerExitTitle - } - } - - var message: String { - switch self { - case .delete: - return TextLiteral.datailWaitViewControllerDeleteMessage - case .exit: - return TextLiteral.datailWaitViewControllerExitMessage - } - } - - var okTitle: String { - switch self { - case .delete: - return TextLiteral.delete - case .exit: - return TextLiteral.leave + return (title: TextLiteral.datailWaitViewControllerExitTitle, + message: TextLiteral.datailWaitViewControllerExitMessage, + okTitle: TextLiteral.leave) } } } From 431e82e02dc9e689c087f2491358359d3fb780bb Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 9 Feb 2023 10:48:07 +0900 Subject: [PATCH 31/69] =?UTF-8?q?[CHORE]=20UIMenu=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailWaitViewController.swift | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 0abbf128d..211b0a3db 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -64,7 +64,6 @@ final class DetailWaitViewController: BaseViewController { private lazy var settingButton: UIButton = { let button = MoreButton() - button.menu = setExitButtonMenu() button.showsMenuAsPrimaryAction = true return button }() @@ -323,28 +322,22 @@ final class DetailWaitViewController: BaseViewController { } private func setExitButtonMenu() -> UIMenu { - switch memberType { - case .owner: - let menu = UIMenu(options: [], children: [ - UIAction(title: TextLiteral.modifiedRoomInfo, handler: { [weak self] _ in - self?.presentEditRoomView() - }), - UIAction(title: TextLiteral.detailWaitViewControllerDeleteRoom, handler: { [weak self] _ in - self?.makeRequestAlert(title: UserStatus.owner.alertText.title, message: UserStatus.owner.alertText.message, okTitle: UserStatus.owner.alertText.okTitle, okAction: { _ in - self?.requestDeleteRoom() - }) - })]) - return menu - case .member: - let menu = UIMenu(options: [], children: [ - UIAction(title: TextLiteral.detailWaitViewControllerLeaveRoom, handler: { [weak self] _ in - self?.makeRequestAlert(title: UserStatus.member.alertText.title, message: UserStatus.member.alertText.message, okTitle: UserStatus.member.alertText.okTitle, okAction: { _ in - self?.requestDeleteLeaveRoom() - }) - }) - ]) - return menu - } + let children: [UIAction] = memberType == .owner + ? [UIAction(title: TextLiteral.modifiedRoomInfo, handler: { [weak self] _ in + self?.presentEditRoomView() + }),UIAction(title: TextLiteral.detailWaitViewControllerDeleteRoom, handler: { [weak self] _ in + self?.makeRequestAlert(title: UserStatus.owner.alertText.title, message: UserStatus.owner.alertText.message, okTitle: UserStatus.owner.alertText.okTitle, okAction: { _ in + self?.requestDeleteRoom() + }) + }) + ] + : [UIAction(title: TextLiteral.detailWaitViewControllerLeaveRoom, handler: { [weak self] _ in + self?.makeRequestAlert(title: UserStatus.member.alertText.title, message: UserStatus.member.alertText.message, okTitle: UserStatus.member.alertText.okTitle, okAction: { _ in + self?.requestDeleteLeaveRoom() + }) + })] + let menu = UIMenu(children: children) + return menu } private func presentEditRoomView() { From 2286d4aff548e324c0c6f5bbc684f9967125d2dd Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 9 Feb 2023 11:19:55 +0900 Subject: [PATCH 32/69] =?UTF-8?q?[CHORE]=20=EB=B0=A9=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EC=A1=B0=ED=9A=8C=20API=20=EA=B4=80=EB=A0=A8=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EB=B6=84=EB=A6=AC=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Network/Models/Room.swift | 20 +++++++++++++++++++ .../DetailWaitViewController.swift | 15 ++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Manito/Manito/Network/Models/Room.swift b/Manito/Manito/Network/Models/Room.swift index 16298a42c..dc7e0d993 100644 --- a/Manito/Manito/Network/Models/Room.swift +++ b/Manito/Manito/Network/Models/Room.swift @@ -49,6 +49,18 @@ struct Room: Decodable { } } + var roomDTO: RoomDTO { + if let roomInformation { + let dto = RoomDTO(title: roomInformation.title ?? "", + capacity: roomInformation.capacity ?? 0, + startDate: roomInformation.startDate ?? "", + endDate: roomInformation.endDate ?? "") + return dto + } else { + return RoomDTO(title: "", capacity: 0, startDate: "", endDate: "") + } + } + enum CodingKeys: String, CodingKey { case roomInformation = "room" case participants @@ -71,6 +83,14 @@ struct Friend: Decodable { struct Participants: Decodable { let count: Int? let members: [User]? + + var membersNickname: [String] { + if let nicknames = members { + return nicknames.map { $0.nickname ?? "" } + } else { + return [] + } + } } // MARK: - Member diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 211b0a3db..f7f9b7836 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -202,19 +202,16 @@ final class DetailWaitViewController: BaseViewController { if let roomInfo = data { guard let title = roomInfo.roomInformation?.title, let state = roomInfo.roomInformation?.state, - let members = roomInfo.participants?.members, + let participants = roomInfo.participants, let isAdmin = roomInfo.admin else { return } - self.room = data - titleView.setStartState(state: state) - userArr = members.map { $0.nickname ?? "" } + self.room = roomInfo + userArr = participants.membersNickname memberType = isAdmin ? .owner : .member - self.roomInfo = RoomDTO(title: title, - capacity: data?.roomInformation?.capacity ?? 15, - startDate: data?.roomInformation?.startDate ?? "", - endDate: data?.roomInformation?.endDate ?? "") - isPastStartDate() + self.roomInfo = roomInfo.roomDTO setStartButton() DispatchQueue.main.async { + self.isPastStartDate() + self.titleView.setStartState(state: state) self.comeInLabel.text = data?.userCount self.titleView.setRoomTitleLabelText(text: title) self.titleView.setDurationDateLabel(text: roomInfo.roomInformation?.dateRange ?? "") From 8dea8a2db039afeccf4f45c0d24f5c5b65d654a5 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 9 Feb 2023 11:43:28 +0900 Subject: [PATCH 33/69] =?UTF-8?q?[CHORE]=20=EC=A4=91=EB=B3=B5=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=ED=95=A8=EC=88=98=EB=A1=9C=20=EB=B6=84=EB=A6=AC=20?= =?UTF-8?q?(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailWaitViewController.swift | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index f7f9b7836..13621faf8 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -232,13 +232,8 @@ final class DetailWaitViewController: BaseViewController { do { let data = try await detailWaitService.startManitto(roomId: "\(roomIndex)") if let manittee = data { - let storyboard = UIStoryboard(name: "Interaction", bundle: nil) - guard let viewController = storyboard.instantiateViewController(withIdentifier: SelectManittoViewController.className) as? SelectManittoViewController else { return } guard let nickname = manittee.nickname else { return } - viewController.modalPresentationStyle = .fullScreen - viewController.manitteeName = nickname - viewController.roomId = roomInformation?.id?.description - present(viewController, animated: true) + presentSelectManittoViewController(nickname: nickname) } } catch NetworkError.serverError { print("server Error") @@ -340,17 +335,17 @@ final class DetailWaitViewController: BaseViewController { private func presentEditRoomView() { guard let roomInformation = room?.roomInformation else { return } if roomInformation.isAlreadyPastDate { - editInfoFromDefaultDate() + editInfoFromDefaultDate(isDateEdit: false) } else { editInfoFromCurrentDate() } } - private func editInfoFromDefaultDate() { + private func editInfoFromDefaultDate(isDateEdit: Bool) { let fiveDaysInterval: TimeInterval = 86400 * 4 let defaultStartDate = Date().dateToString let defaultEndDate = (Date() + fiveDaysInterval).dateToString - self.presentDetailEditViewController(startString: defaultStartDate, endString: defaultEndDate, isDateEdit: false) + self.presentDetailEditViewController(startString: defaultStartDate, endString: defaultEndDate, isDateEdit: isDateEdit) } private func editInfoFromCurrentDate() { @@ -369,10 +364,7 @@ final class DetailWaitViewController: BaseViewController { switch memberType { case .owner: let action: ((UIAlertAction) -> ()) = { [weak self] _ in - let fiveDaysInterval: TimeInterval = 86400 * 4 - let startDate = Date().dateToString - let endDate = (Date() + fiveDaysInterval).dateToString - self?.presentDetailEditViewController(startString: startDate, endString: endDate, isDateEdit: true) + self?.editInfoFromDefaultDate(isDateEdit: true) } makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, message: TextLiteral.detailWaitViewControllerPastOwnerAlertMessage, okAction: action) case .member: @@ -414,6 +406,15 @@ final class DetailWaitViewController: BaseViewController { titleView.addGestureRecognizer(tapGesture) } } + + private func presentSelectManittoViewController(nickname: String) { + let storyboard = UIStoryboard(name: "Interaction", bundle: nil) + guard let viewController = storyboard.instantiateViewController(withIdentifier: SelectManittoViewController.className) as? SelectManittoViewController else { return } + viewController.modalPresentationStyle = .fullScreen + viewController.manitteeName = nickname + viewController.roomId = roomInformation?.id?.description + present(viewController, animated: true) + } // MARK: - selector @objc private func didTapEnterButton() { From 5d1e291eb5ad6b86893b055afe13c45279a9c092 Mon Sep 17 00:00:00 2001 From: chemi Date: Thu, 9 Feb 2023 12:20:45 +0900 Subject: [PATCH 34/69] =?UTF-8?q?[CHORE]=20=EC=8B=9C=EC=9E=91=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=EA=B0=80=20=EB=AF=B8=EB=9E=98=EC=97=AC=EB=8F=84=20?= =?UTF-8?q?=EA=B3=BC=EA=B1=B0=EB=9D=BC=EB=8A=94=20alert=EB=9C=A8=EB=8A=94?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20(#368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito/Network/Models/Room.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Manito/Manito/Network/Models/Room.swift b/Manito/Manito/Network/Models/Room.swift index dc7e0d993..c527cdb24 100644 --- a/Manito/Manito/Network/Models/Room.swift +++ b/Manito/Manito/Network/Models/Room.swift @@ -122,8 +122,9 @@ struct RoomInfo: Decodable { var isStart: Bool { if let date = startDate?.stringToDate { - let canStart = date.isToday - return canStart + let isStartDate = date.distance(to: Date()) < 86400 + let isPast = date.distance(to: Date()) > 86400 + return !isPast && isStartDate } else { return false } From a87ff0c628f51705e724d5ac72c4a61f263ba5df Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Feb 2023 23:30:48 +0900 Subject: [PATCH 35/69] =?UTF-8?q?[CHORE]=20component=20=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EC=BB=A8=EB=B2=A4=EC=85=98=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailEditViewController.swift | 6 +- .../DetailWaitViewController.swift | 73 ++++++++++--------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index e2f0560cd..676be4a7d 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -48,7 +48,7 @@ final class DetailEditViewController: BaseViewController { button.addAction(buttonAction, for: .touchUpInside) return button }() - private let topIndicator: UIView = { + private let topIndicatorView: UIView = { let view = UIView() view.backgroundColor = .white.withAlphaComponent(0.8) view.layer.cornerRadius = 1.5 @@ -169,8 +169,8 @@ final class DetailEditViewController: BaseViewController { $0.width.height.equalTo(44) } - view.addSubview(topIndicator) - topIndicator.snp.makeConstraints { + view.addSubview(topIndicatorView) + topIndicatorView.snp.makeConstraints { $0.top.equalToSuperview().inset(8) $0.centerX.equalToSuperview() $0.width.equalTo(40) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index a509ef85b..159aa4a5f 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -10,23 +10,6 @@ import UIKit import SnapKit final class DetailWaitViewController: BaseViewController { - private var room: Room? - private let detailWaitService: DetailWaitAPI = DetailWaitAPI(apiService: APIService()) - private let roomIndex: Int - var roomInformation: ParticipatingRoom? - private var roomInfo: RoomDTO? - private var userArr: [String] = [] { - didSet { - renderTableView() - } - } - private var detectStartableStatus: ((Bool) -> ())? - private var memberType = UserStatus.member { - didSet { - settingButton.menu = setExitButtonMenu() - setupTitleViewGesture() - } - } private enum UserStatus: CaseIterable { case owner @@ -60,7 +43,7 @@ final class DetailWaitViewController: BaseViewController { } } - // MARK: - property + // MARK: - ui component private lazy var settingButton: UIButton = { let button = MoreButton() @@ -80,7 +63,7 @@ final class DetailWaitViewController: BaseViewController { imageView.image = ImageLiterals.imgNi return imageView }() - private lazy var comeInLabel: UILabel = { + private let comeInLabel: UILabel = { let label = UILabel() label.textColor = .white label.font = .font(.regular, ofSize: 14) @@ -90,7 +73,9 @@ final class DetailWaitViewController: BaseViewController { let button = UIButton(type: .system) let buttonAction = UIAction { [weak self] _ in if let code = self?.room?.invitation?.code { - ToastView.showToast(code: code ,message: TextLiteral.detailWaitViewControllerCopyCode, controller: self ?? UIViewController()) + ToastView.showToast(code: code , + message: TextLiteral.detailWaitViewControllerCopyCode, + controller: self ?? UIViewController()) } } button.setTitle(TextLiteral.copyCode, for: .normal) @@ -99,11 +84,11 @@ final class DetailWaitViewController: BaseViewController { button.addAction(buttonAction, for: .touchUpInside) return button }() - private let listTable: UITableView = { - let table = UITableView() - table.layer.cornerRadius = 10 - table.isScrollEnabled = false - return table + private let listTableView: UITableView = { + let tableView = UITableView() + tableView.layer.cornerRadius = 10 + tableView.isScrollEnabled = false + return tableView }() private lazy var startButton: UIButton = { let button = MainButton() @@ -122,11 +107,31 @@ final class DetailWaitViewController: BaseViewController { } return button }() + + // MARK: - property + + private var room: Room? + private let detailWaitService: DetailWaitAPI = DetailWaitAPI(apiService: APIService()) + private let roomIndex: Int + var roomInformation: ParticipatingRoom? + private var roomInfo: RoomDTO? + private var userArr: [String] = [] { + didSet { + renderTableView() + } + } + private var detectStartableStatus: ((Bool) -> ())? + private var memberType = UserStatus.member { + didSet { + settingButton.menu = setExitButtonMenu() + setupTitleViewGesture() + } + } // MARK: - init init(index: Int) { - roomIndex = index + self.roomIndex = index super.init() } @@ -282,9 +287,9 @@ final class DetailWaitViewController: BaseViewController { // MARK: - func private func setupDelegation() { - listTable.delegate = self - listTable.dataSource = self - listTable.register(UITableViewCell.self, forCellReuseIdentifier: "cell") + listTableView.delegate = self + listTableView.dataSource = self + listTableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") } private func presentDetailEditViewController(startString: String, endString: String, isDateEdit: Bool) { @@ -384,14 +389,14 @@ final class DetailWaitViewController: BaseViewController { private func renderTableView() { DispatchQueue.main.async { - self.listTable.reloadData() - self.view.addSubview(self.listTable) + self.listTableView.reloadData() + self.view.addSubview(self.listTableView) var tableHeight = self.userArr.count * 44 if tableHeight > 400 { tableHeight = 400 - self.listTable.isScrollEnabled = true + self.listTableView.isScrollEnabled = true } - self.listTable.snp.makeConstraints { + self.listTableView.snp.makeConstraints { $0.top.equalTo(self.togetherFriendLabel.snp.bottom).offset(30) $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) $0.centerX.equalToSuperview() @@ -455,7 +460,7 @@ extension DetailWaitViewController: UITableViewDataSource { } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = listTable.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell + let cell = listTableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell cell.textLabel?.text = userArr[indexPath.row] cell.textLabel?.font = .font(.regular, ofSize: 17) cell.backgroundColor = .darkGrey003 From 100b6f47614c204c3aad6544a6e3afd87fc190c5 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Feb 2023 23:34:52 +0900 Subject: [PATCH 36/69] =?UTF-8?q?[CHORE]=20=EC=A3=BC=EC=84=9D=20=EC=BB=A8?= =?UTF-8?q?=EB=B2=A4=EC=85=98=EC=97=90=20=EB=94=B0=EB=9D=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailEditViewController.swift | 53 ++++++++++--------- .../UIComponent/CalendarView.swift | 27 +++++----- .../UIComponent/DetailWaitTitleView.swift | 6 +-- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 676be4a7d..4951f1b44 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -11,31 +11,8 @@ import FSCalendar import SnapKit final class DetailEditViewController: BaseViewController { - private let detailWaitService: DetailWaitAPI = DetailWaitAPI(apiService: APIService()) - var didTappedChangeButton: (() -> ())? - private let roomIndex: Int - private let roomTitle: String - enum EditMode { - case date - case information - } - var editMode: EditMode - var currentUserCount = 0 - var sliderValue = 10 - var startDateText = "" { - didSet { - calendarView.startDateText = startDateText - calendarView.setupDateRange() - } - } - var endDateText = "" { - didSet { - calendarView.endDateText = endDateText - calendarView.setupDateRange() - } - } - // MARK: - property + // MARK: - ui component private lazy var cancelButton: UIButton = { let button = UIButton(type: .system) @@ -126,6 +103,32 @@ final class DetailEditViewController: BaseViewController { label.textColor = .white return label }() + + // MARK: - property + + private let detailWaitService: DetailWaitAPI = DetailWaitAPI(apiService: APIService()) + var didTappedChangeButton: (() -> ())? + private let roomIndex: Int + private let roomTitle: String + enum EditMode { + case date + case information + } + var editMode: EditMode + var currentUserCount = 0 + var sliderValue = 10 + var startDateText = "" { + didSet { + calendarView.startDateText = startDateText + calendarView.setupDateRange() + } + } + var endDateText = "" { + didSet { + calendarView.endDateText = endDateText + calendarView.setupDateRange() + } + } // MARK: - life cycle @@ -144,8 +147,6 @@ final class DetailEditViewController: BaseViewController { print("\(#file) is dead") } - // MARK: - life cycle - override func configureUI() { super.configureUI() self.navigationController?.isNavigationBarHidden = true diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index 606a6371e..b427c57e8 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -11,15 +11,6 @@ import FSCalendar import SnapKit class CalendarView: UIView { - private var selectStartDate = Date() - private let oneDayInterval: TimeInterval = 86400 - private let sevenDaysInterval: TimeInterval = 604800 - var changeButtonState: ((Bool) -> ())? - var startDateText = "" - var endDateText = "" - private var tempStartDateText = "" - private var tempEndDateText = "" - var isFirstTap = false private enum CalendarMoveType { case previous @@ -35,7 +26,7 @@ class CalendarView: UIView { } } - // MARK: - property + // MARK: - ui component private lazy var previousButton: UIButton = { let button = UIButton() @@ -74,6 +65,18 @@ class CalendarView: UIView { calendar.appearance.todayColor = .clear return calendar }() + + // MARK: - property + + private var selectStartDate = Date() + private let oneDayInterval: TimeInterval = 86400 + private let sevenDaysInterval: TimeInterval = 604800 + var changeButtonState: ((Bool) -> ())? + var startDateText = "" + var endDateText = "" + private var tempStartDateText = "" + private var tempEndDateText = "" + var isFirstTap = false // MARK: - init @@ -87,6 +90,8 @@ class CalendarView: UIView { required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + + // MARK: - func private func render() { self.addSubview(calendar) @@ -112,8 +117,6 @@ class CalendarView: UIView { changeButtonState?(hasDate) } - // MARK: - func - private func setupDelegation() { calendar.delegate = self calendar.dataSource = self diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift index 6ddef56b4..f888cb458 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift @@ -28,7 +28,7 @@ final class DetailWaitTitleView: UIView { } } - // MARK: - property + // MARK: - ui component private(set) var roomTitleLabel: UILabel = { let label = UILabel() @@ -81,6 +81,8 @@ final class DetailWaitTitleView: UIView { required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + + // MARK: - func private func render() { self.addSubview(roomTitleLabel) @@ -116,8 +118,6 @@ final class DetailWaitTitleView: UIView { } } - // MARK: - func - func setStartState(state: String) { switch state { case "PRE": From 839459ee406808f20f6f40a0e9c6c725c9e0f2f7 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Feb 2023 23:36:19 +0900 Subject: [PATCH 37/69] =?UTF-8?q?[CHORE]=20layout=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=EB=AA=85=20=EC=88=98=EC=A0=95=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift | 4 ++-- .../Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index b427c57e8..c310816f3 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -82,7 +82,7 @@ class CalendarView: UIView { override init(frame: CGRect) { super.init(frame: frame) - render() + setupLayout() setupDelegation() setupDateRange() } @@ -93,7 +93,7 @@ class CalendarView: UIView { // MARK: - func - private func render() { + private func setupLayout() { self.addSubview(calendar) calendar.snp.makeConstraints { $0.edges.equalToSuperview() diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift index f888cb458..4876d30ab 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift @@ -75,7 +75,7 @@ final class DetailWaitTitleView: UIView { override init(frame: CGRect) { super.init(frame: frame) - render() + setupLayout() } required init?(coder: NSCoder) { @@ -84,7 +84,7 @@ final class DetailWaitTitleView: UIView { // MARK: - func - private func render() { + private func setupLayout() { self.addSubview(roomTitleLabel) roomTitleLabel.snp.makeConstraints { $0.leading.top.equalToSuperview() From 99217f8fea3b4c33571ad716a0545177dc4dd39f Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Feb 2023 23:38:20 +0900 Subject: [PATCH 38/69] =?UTF-8?q?[CHORE]=20=ED=83=80=EC=9E=84=20=EB=AA=85?= =?UTF-8?q?=EC=8B=9C=20=EC=BB=A8=EB=B2=A4=EC=85=98=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Detail-Wait/DetailEditViewController.swift | 8 ++++---- .../Detail-Wait/UIComponent/CalendarView.swift | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 4951f1b44..982be07f9 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -115,15 +115,15 @@ final class DetailEditViewController: BaseViewController { case information } var editMode: EditMode - var currentUserCount = 0 - var sliderValue = 10 - var startDateText = "" { + var currentUserCount: Int = 0 + var sliderValue: Int = 10 + var startDateText: String = "" { didSet { calendarView.startDateText = startDateText calendarView.setupDateRange() } } - var endDateText = "" { + var endDateText: String = "" { didSet { calendarView.endDateText = endDateText calendarView.setupDateRange() diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index c310816f3..85806e028 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -68,15 +68,15 @@ class CalendarView: UIView { // MARK: - property - private var selectStartDate = Date() + private var selectStartDate: Date = Date() private let oneDayInterval: TimeInterval = 86400 private let sevenDaysInterval: TimeInterval = 604800 var changeButtonState: ((Bool) -> ())? - var startDateText = "" - var endDateText = "" - private var tempStartDateText = "" - private var tempEndDateText = "" - var isFirstTap = false + var startDateText: String = "" + var endDateText: String = "" + private var tempStartDateText: String = "" + private var tempEndDateText: String = "" + var isFirstTap: Bool = false // MARK: - init From cdc1349b0ffbfd39da596fede2add24f0c6ea30a Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Feb 2023 23:47:04 +0900 Subject: [PATCH 39/69] =?UTF-8?q?[CHORE]=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=20=EC=A4=84=EB=B0=94=EA=BF=88=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailEditViewController.swift | 10 +++-- .../DetailWaitViewController.swift | 40 ++++++++++++++----- .../UIComponent/CalendarView.swift | 20 +++++++--- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 982be07f9..2668df400 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -245,7 +245,8 @@ final class DetailEditViewController: BaseViewController { do { let status = try await detailWaitService.editRoomInfo(roomId: "\(roomIndex)", roomInfo: roomDto) if status == 204 { - ToastView.showToast(message: "방 정보 수정 완료", controller: self) + ToastView.showToast(message: "방 정보 수정 완료", + controller: self) didTappedChangeButton?() dismiss(animated: true) } @@ -275,7 +276,9 @@ final class DetailEditViewController: BaseViewController { let actions: [((UIAlertAction) -> Void)?] = [{ [weak self] _ in self?.dismiss(animated: true) }, nil] - makeActionSheet(actionTitles: actionTitles, actionStyle: actionStyle, actions: actions) + makeActionSheet(actionTitles: actionTitles, + actionStyle: actionStyle, + actions: actions) } private func setupChangedButton() { @@ -298,7 +301,8 @@ final class DetailEditViewController: BaseViewController { if currentUserCount <= sliderValue { putChangeRoomInfo(roomDto: dto) } else { - makeAlert(title: TextLiteral.detailEditViewControllerChangeRoomInfoAlertTitle, message: TextLiteral.detailEditViewControllerChangeRoomInfoAlertMessage) + makeAlert(title: TextLiteral.detailEditViewControllerChangeRoomInfoAlertTitle, + message: TextLiteral.detailEditViewControllerChangeRoomInfoAlertMessage) } } } diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 159aa4a5f..c0b931681 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -15,7 +15,9 @@ final class DetailWaitViewController: BaseViewController { case owner case member - var alertText: (title: String, message: String, okTitle: String) { + var alertText: (title: String, + message: String, + okTitle: String) { switch self { case .owner: return (title: TextLiteral.datailWaitViewControllerDeleteTitle, @@ -312,7 +314,8 @@ final class DetailWaitViewController: BaseViewController { // MARK: - private func private func setupSettingButton() { - let rightOffsetSettingButton = super.removeBarButtonItemOffset(with: settingButton, offsetX: -10) + let rightOffsetSettingButton = super.removeBarButtonItemOffset(with: settingButton, + offsetX: -10) let settingButton = super.makeBarButtonItem(with: rightOffsetSettingButton) navigationItem.rightBarButtonItem = settingButton @@ -323,13 +326,21 @@ final class DetailWaitViewController: BaseViewController { ? [UIAction(title: TextLiteral.modifiedRoomInfo, handler: { [weak self] _ in self?.presentEditRoomView() }),UIAction(title: TextLiteral.detailWaitViewControllerDeleteRoom, handler: { [weak self] _ in - self?.makeRequestAlert(title: UserStatus.owner.alertText.title, message: UserStatus.owner.alertText.message, okTitle: UserStatus.owner.alertText.okTitle, okAction: { _ in + self?.makeRequestAlert(title: UserStatus.owner.alertText.title, + message: UserStatus.owner.alertText.message, + okTitle: UserStatus.owner.alertText.okTitle, + okAction: { _ in self?.requestDeleteRoom() + }) - }) + + }) ] : [UIAction(title: TextLiteral.detailWaitViewControllerLeaveRoom, handler: { [weak self] _ in - self?.makeRequestAlert(title: UserStatus.member.alertText.title, message: UserStatus.member.alertText.message, okTitle: UserStatus.member.alertText.okTitle, okAction: { _ in + self?.makeRequestAlert(title: UserStatus.member.alertText.title, + message: UserStatus.member.alertText.message, + okTitle: UserStatus.member.alertText.okTitle, + okAction: { _ in self?.requestDeleteLeaveRoom() }) })] @@ -350,13 +361,17 @@ final class DetailWaitViewController: BaseViewController { let fiveDaysInterval: TimeInterval = 86400 * 4 let defaultStartDate = Date().dateToString let defaultEndDate = (Date() + fiveDaysInterval).dateToString - self.presentDetailEditViewController(startString: defaultStartDate, endString: defaultEndDate, isDateEdit: isDateEdit) + self.presentDetailEditViewController(startString: defaultStartDate, + endString: defaultEndDate, + isDateEdit: isDateEdit) } private func editInfoFromCurrentDate() { guard let startDate = room?.roomInformation?.startDate, let endDate = room?.roomInformation?.endDate else { return } - self.presentDetailEditViewController(startString: startDate, endString: endDate, isDateEdit: false) + self.presentDetailEditViewController(startString: startDate, + endString: endDate, + isDateEdit: false) } private func setupNotificationCenter() { @@ -371,9 +386,12 @@ final class DetailWaitViewController: BaseViewController { let action: ((UIAlertAction) -> ()) = { [weak self] _ in self?.editInfoFromDefaultDate(isDateEdit: true) } - makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, message: TextLiteral.detailWaitViewControllerPastOwnerAlertMessage, okAction: action) + makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, + message: TextLiteral.detailWaitViewControllerPastOwnerAlertMessage, + okAction: action) case .member: - makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, message: TextLiteral.detailWaitViewControllerPastAlertMessage) + makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, + message: TextLiteral.detailWaitViewControllerPastAlertMessage) } } } @@ -440,7 +458,9 @@ final class DetailWaitViewController: BaseViewController { @objc private func presentEditViewController() { guard let startDate = room?.roomInformation?.startDate, let endDate = room?.roomInformation?.endDate else { return } - self.presentDetailEditViewController(startString: startDate, endString: endDate, isDateEdit: false) + self.presentDetailEditViewController(startString: startDate, + endString: endDate, + isDateEdit: false) } @objc private func changeStartButton() { diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index 85806e028..688b40cf6 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -148,16 +148,20 @@ class CalendarView: UIView { let isFirstClickPastDate = calendar.selectedDates[0] < calendar.selectedDates[1] if isFirstClickPastDate { - setSelecteDate(startIndex: 0, endIndex: 1) + setSelecteDate(startIndex: 0, + endIndex: 1) } else { - setSelecteDate(startIndex: 1, endIndex: 0) + setSelecteDate(startIndex: 1, + endIndex: 0) } } func setSelecteDate(startIndex: Int, endIndex: Int) { var startDate = calendar.selectedDates[startIndex] while startDate < calendar.selectedDates[endIndex] { - guard let addDate = Calendar.current.date(byAdding: .day, value: 1, to: startDate) else { return } + guard let addDate = Calendar.current.date(byAdding: .day, + value: 1, + to: startDate) else { return } calendar.select(addDate) startDate += oneDayInterval } @@ -167,7 +171,9 @@ class CalendarView: UIView { func countDateRange() -> Int { let isFirstClickPastDate = calendar.selectedDates[0] < calendar.selectedDates[1] - let selectdDate = isFirstClickPastDate ? calendar.selectedDates[1].timeIntervalSince(calendar.selectedDates[0]) : calendar.selectedDates[0].timeIntervalSince(calendar.selectedDates[1]) + let selectdDate = isFirstClickPastDate + ? calendar.selectedDates[1].timeIntervalSince(calendar.selectedDates[0]) + : calendar.selectedDates[0].timeIntervalSince(calendar.selectedDates[1]) let dateRangeCount = selectdDate / 86400 return Int(dateRangeCount) + 1 @@ -196,7 +202,8 @@ extension CalendarView: FSCalendarDelegate { tempEndDateText = date.dateToString if countDateRange() > 7 { calendar.deselect(date) - viewController?.makeAlert(title: TextLiteral.calendarViewAlertMaxTitle, message: TextLiteral.maxMessage) + viewController?.makeAlert(title: TextLiteral.calendarViewAlertMaxTitle, + message: TextLiteral.maxMessage) } else { setDateRange() calendar.reloadData() @@ -229,7 +236,8 @@ extension CalendarView: FSCalendarDelegate { func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool { if date < Date() - oneDayInterval { - viewController?.makeAlert(title: TextLiteral.calendarViewAlertPastTitle, message: TextLiteral.calendarViewAlertPastMessage) + viewController?.makeAlert(title: TextLiteral.calendarViewAlertPastTitle, + message: TextLiteral.calendarViewAlertPastMessage) return false } else { return true From bb08a81576fa5101ec90fd7cf3b3b219d4f23410 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 13 Feb 2023 23:49:14 +0900 Subject: [PATCH 40/69] =?UTF-8?q?[CHORE]=20final=20=EB=AA=85=EC=8B=9C=20(#?= =?UTF-8?q?376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index 688b40cf6..129dae7d9 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -10,7 +10,7 @@ import UIKit import FSCalendar import SnapKit -class CalendarView: UIView { +final class CalendarView: UIView { private enum CalendarMoveType { case previous From 98506702acbd579f2cfe3826a36437846020a406 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 00:04:51 +0900 Subject: [PATCH 41/69] =?UTF-8?q?[CHORE]=20self=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EB=AA=85=EC=8B=9C=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailEditViewController.swift | 135 +++++++++--------- .../DetailWaitViewController.swift | 128 ++++++++--------- .../UIComponent/CalendarView.swift | 112 +++++++-------- .../UIComponent/DetailWaitTitleView.swift | 40 +++--- 4 files changed, 208 insertions(+), 207 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 2668df400..9a5d1a5f4 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -72,14 +72,14 @@ final class DetailEditViewController: BaseViewController { }() private lazy var minMemberLabel: UILabel = { let label = UILabel() - label.text = "\(Int(memberSlider.minimumValue))인" + label.text = "\(Int(self.memberSlider.minimumValue))인" label.font = .font(.regular, ofSize: 16) label.textColor = .white return label }() private lazy var maxMemberLabel: UILabel = { let label = UILabel() - label.text = "\(Int(memberSlider.maximumValue))인" + label.text = "\(Int(self.memberSlider.maximumValue))인" label.font = .font(.regular, ofSize: 16) label.textColor = .white return label @@ -90,15 +90,15 @@ final class DetailEditViewController: BaseViewController { slider.maximumValue = 15 slider.maximumTrackTintColor = .darkGrey003 slider.minimumTrackTintColor = .red001 - slider.value = Float(sliderValue) + slider.value = Float(self.sliderValue) slider.isContinuous = true slider.setThumbImage(ImageLiterals.imageSliderThumb, for: .normal) - slider.addTarget(self, action: #selector(changeMemberCount(sender:)), for: .valueChanged) + slider.addTarget(self, action: #selector(self.changeMemberCount(sender:)), for: .valueChanged) return slider }() private lazy var memberCountLabel: UILabel = { let label = UILabel() - label.text = "\(sliderValue)" + TextLiteral.per + label.text = "\(self.sliderValue)" + TextLiteral.per label.font = .font(.regular, ofSize: 24) label.textColor = .white return label @@ -119,14 +119,14 @@ final class DetailEditViewController: BaseViewController { var sliderValue: Int = 10 var startDateText: String = "" { didSet { - calendarView.startDateText = startDateText - calendarView.setupDateRange() + self.calendarView.startDateText = startDateText + self.calendarView.setupDateRange() } } var endDateText: String = "" { didSet { - calendarView.endDateText = endDateText - calendarView.setupDateRange() + self.calendarView.endDateText = endDateText + self.calendarView.setupDateRange() } } @@ -151,89 +151,89 @@ final class DetailEditViewController: BaseViewController { super.configureUI() self.navigationController?.isNavigationBarHidden = true self.presentationController?.delegate = self - isModalInPresentation = true - setupChangedButton() + self.isModalInPresentation = true + self.setupChangedButton() } override func setupLayout() { - view.addSubview(cancelButton) - cancelButton.snp.makeConstraints { + self.view.addSubview(self.cancelButton) + self.cancelButton.snp.makeConstraints { $0.top.equalToSuperview().inset(24) $0.leading.equalToSuperview().inset(29) $0.width.height.equalTo(44) } - view.addSubview(changeButton) - changeButton.snp.makeConstraints { + self.view.addSubview(self.changeButton) + self.changeButton.snp.makeConstraints { $0.top.equalToSuperview().inset(24) $0.trailing.equalToSuperview().inset(29) $0.width.height.equalTo(44) } - view.addSubview(topIndicatorView) - topIndicatorView.snp.makeConstraints { + self.view.addSubview(self.topIndicatorView) + self.topIndicatorView.snp.makeConstraints { $0.top.equalToSuperview().inset(8) $0.centerX.equalToSuperview() $0.width.equalTo(40) $0.height.equalTo(3) } - view.addSubview(titleLabel) - titleLabel.snp.makeConstraints { + self.view.addSubview(self.titleLabel) + self.titleLabel.snp.makeConstraints { $0.centerX.equalToSuperview() - $0.centerY.equalTo(cancelButton.snp.centerY) + $0.centerY.equalTo(self.cancelButton.snp.centerY) } - view.addSubview(startSettingLabel) - startSettingLabel.snp.makeConstraints { - $0.top.equalTo(cancelButton.snp.bottom).offset(51) + self.view.addSubview(self.startSettingLabel) + self.startSettingLabel.snp.makeConstraints { + $0.top.equalTo(self.cancelButton.snp.bottom).offset(51) $0.leading.equalToSuperview().inset(Size.leadingTrailingPadding) } - view.addSubview(calendarView) - calendarView.snp.makeConstraints { - $0.top.equalTo(startSettingLabel.snp.bottom).offset(30) + self.view.addSubview(self.calendarView) + self.calendarView.snp.makeConstraints { + $0.top.equalTo(self.startSettingLabel.snp.bottom).offset(30) $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) $0.height.equalTo(400) } - view.addSubview(tipLabel) - tipLabel.snp.makeConstraints { - $0.top.equalTo(calendarView.snp.bottom).offset(8) + self.view.addSubview(tipLabel) + self.tipLabel.snp.makeConstraints { + $0.top.equalTo(self.calendarView.snp.bottom).offset(8) $0.trailing.equalToSuperview().inset(25) } - if editMode == .information { - view.addSubview(setMemberLabel) - setMemberLabel.snp.makeConstraints { - $0.top.equalTo(calendarView.snp.bottom).offset(60) + if self.editMode == .information { + self.view.addSubview(self.setMemberLabel) + self.setMemberLabel.snp.makeConstraints { + $0.top.equalTo(self.calendarView.snp.bottom).offset(60) $0.leading.equalToSuperview().inset(Size.leadingTrailingPadding) } - view.addSubview(minMemberLabel) - minMemberLabel.snp.makeConstraints { - $0.top.equalTo(setMemberLabel.snp.bottom).offset(30) + self.view.addSubview(self.minMemberLabel) + self.minMemberLabel.snp.makeConstraints { + $0.top.equalTo(self.setMemberLabel.snp.bottom).offset(30) $0.leading.equalToSuperview().inset(24) } - view.addSubview(memberSlider) - memberSlider.snp.makeConstraints { - $0.leading.equalTo(minMemberLabel.snp.trailing).offset(5) + self.view.addSubview(self.memberSlider) + self.memberSlider.snp.makeConstraints { + $0.leading.equalTo(self.minMemberLabel.snp.trailing).offset(5) $0.height.equalTo(45) - $0.centerY.equalTo(minMemberLabel.snp.centerY) + $0.centerY.equalTo(self.minMemberLabel.snp.centerY) } - view.addSubview(maxMemberLabel) - maxMemberLabel.snp.makeConstraints { - $0.top.equalTo(setMemberLabel.snp.bottom).offset(30) - $0.leading.equalTo(memberSlider.snp.trailing).offset(5) + self.view.addSubview(self.maxMemberLabel) + self.maxMemberLabel.snp.makeConstraints { + $0.top.equalTo(self.setMemberLabel.snp.bottom).offset(30) + $0.leading.equalTo(self.memberSlider.snp.trailing).offset(5) $0.trailing.equalToSuperview().inset(24) } - view.addSubview(memberCountLabel) - memberCountLabel.snp.makeConstraints { + self.view.addSubview(self.memberCountLabel) + self.memberCountLabel.snp.makeConstraints { $0.centerX.equalToSuperview() - $0.centerY.equalTo(setMemberLabel.snp.centerY) + $0.centerY.equalTo(self.setMemberLabel.snp.centerY) } } } @@ -243,12 +243,13 @@ final class DetailEditViewController: BaseViewController { private func putChangeRoomInfo(roomDto: RoomDTO) { Task { do { - let status = try await detailWaitService.editRoomInfo(roomId: "\(roomIndex)", roomInfo: roomDto) + let status = try await self.detailWaitService.editRoomInfo(roomId: "\(roomIndex)", + roomInfo: roomDto) if status == 204 { ToastView.showToast(message: "방 정보 수정 완료", controller: self) - didTappedChangeButton?() - dismiss(animated: true) + self.didTappedChangeButton?() + self.dismiss(animated: true) } } catch NetworkError.serverError { print("server Error") @@ -263,11 +264,11 @@ final class DetailEditViewController: BaseViewController { // MARK: - func private func presentationControllerDidAttemptToDismissAlert() { - guard calendarView.isFirstTap else { - dismiss(animated: true) + guard self.calendarView.isFirstTap else { + self.dismiss(animated: true) return } - showDiscardChangAlert() + self.showDiscardChangAlert() } private func showDiscardChangAlert() { @@ -282,7 +283,7 @@ final class DetailEditViewController: BaseViewController { } private func setupChangedButton() { - calendarView.changeButtonState = { [weak self] value in + self.calendarView.changeButtonState = { [weak self] value in self?.changeButton.isEnabled = value self?.changeButton.setTitleColor(.subBlue, for: .normal) self?.changeButton.setTitleColor(.grey002, for: .disabled) @@ -291,17 +292,17 @@ final class DetailEditViewController: BaseViewController { private func didTapChangeButton() { let dto = RoomDTO(title: roomTitle, - capacity: Int(memberSlider.value), - startDate: "20\(calendarView.getTempStartDate())", - endDate: "20\(calendarView.getTempEndDate())") - switch editMode { + capacity: Int(self.memberSlider.value), + startDate: "20\(self.calendarView.getTempStartDate())", + endDate: "20\(self.calendarView.getTempEndDate())") + switch self.editMode { case .date: - putChangeRoomInfo(roomDto: dto) + self.putChangeRoomInfo(roomDto: dto) case .information: - if currentUserCount <= sliderValue { - putChangeRoomInfo(roomDto: dto) + if self.currentUserCount <= self.sliderValue { + self.putChangeRoomInfo(roomDto: dto) } else { - makeAlert(title: TextLiteral.detailEditViewControllerChangeRoomInfoAlertTitle, + self.makeAlert(title: TextLiteral.detailEditViewControllerChangeRoomInfoAlertTitle, message: TextLiteral.detailEditViewControllerChangeRoomInfoAlertMessage) } } @@ -310,15 +311,15 @@ final class DetailEditViewController: BaseViewController { // MARK: - selector @objc private func changeMemberCount(sender: UISlider) { - sliderValue = Int(sender.value) - memberCountLabel.text = String(Int(sender.value)) + TextLiteral.per - memberCountLabel.font = .font(.regular, ofSize: 24) - memberCountLabel.textColor = .white + self.sliderValue = Int(sender.value) + self.memberCountLabel.text = String(Int(sender.value)) + TextLiteral.per + self.memberCountLabel.font = .font(.regular, ofSize: 24) + self.memberCountLabel.textColor = .white } } extension DetailEditViewController: UIAdaptivePresentationControllerDelegate { func presentationControllerDidAttemptToDismiss(_ presentationController: UIPresentationController) { - presentationControllerDidAttemptToDismissAlert() + self.presentationControllerDidAttemptToDismissAlert() } } diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index c0b931681..bfc3d0e1b 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -94,7 +94,7 @@ final class DetailWaitViewController: BaseViewController { }() private lazy var startButton: UIButton = { let button = MainButton() - detectStartableStatus = { value in + self.detectStartableStatus = { value in if value { button.title = ButtonText.start.status button.isDisabled = false @@ -119,14 +119,14 @@ final class DetailWaitViewController: BaseViewController { private var roomInfo: RoomDTO? private var userArr: [String] = [] { didSet { - renderTableView() + self.renderTableView() } } private var detectStartableStatus: ((Bool) -> ())? private var memberType = UserStatus.member { didSet { - settingButton.menu = setExitButtonMenu() - setupTitleViewGesture() + self.settingButton.menu = self.setExitButtonMenu() + self.setupTitleViewGesture() } } @@ -149,46 +149,46 @@ final class DetailWaitViewController: BaseViewController { override func viewDidLoad() { super.viewDidLoad() - requestWaitRoomInfo() - setupDelegation() - setupNotificationCenter() + self.requestWaitRoomInfo() + self.setupDelegation() + self.setupNotificationCenter() } override func setupLayout() { - view.addSubview(titleView) - titleView.snp.makeConstraints { + self.view.addSubview(self.titleView) + self.titleView.snp.makeConstraints { $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) $0.top.equalToSuperview().offset(100) $0.height.equalTo(86) } - view.addSubview(togetherFriendLabel) - togetherFriendLabel.snp.makeConstraints { + self.view.addSubview(self.togetherFriendLabel) + self.togetherFriendLabel.snp.makeConstraints { $0.leading.equalToSuperview().inset(Size.leadingTrailingPadding) $0.top.equalTo(titleView.snp.bottom).offset(44) } - view.addSubview(imgNiView) - imgNiView.snp.makeConstraints { - $0.centerY.equalTo(togetherFriendLabel.snp.centerY) - $0.leading.equalTo(togetherFriendLabel.snp.trailing).offset(7) + self.view.addSubview(self.imgNiView) + self.imgNiView.snp.makeConstraints { + $0.centerY.equalTo(self.togetherFriendLabel.snp.centerY) + $0.leading.equalTo(self.togetherFriendLabel.snp.trailing).offset(7) $0.width.height.equalTo(30) } - view.addSubview(comeInLabel) - comeInLabel.snp.makeConstraints { - $0.leading.equalTo(imgNiView.snp.trailing) - $0.centerY.equalTo(imgNiView.snp.centerY) + self.view.addSubview(self.comeInLabel) + self.comeInLabel.snp.makeConstraints { + $0.leading.equalTo(self.imgNiView.snp.trailing) + $0.centerY.equalTo(self.imgNiView.snp.centerY) } - view.addSubview(copyButton) - copyButton.snp.makeConstraints { + self.view.addSubview(self.copyButton) + self.copyButton.snp.makeConstraints { $0.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) - $0.centerY.equalTo(togetherFriendLabel.snp.centerY) + $0.centerY.equalTo(self.togetherFriendLabel.snp.centerY) } - view.addSubview(startButton) - startButton.snp.makeConstraints { + self.view.addSubview(self.startButton) + self.startButton.snp.makeConstraints { $0.leading.trailing.equalToSuperview().inset(Size.leadingTrailingPadding) $0.bottom.equalToSuperview().inset(65) $0.height.equalTo(60) @@ -197,7 +197,7 @@ final class DetailWaitViewController: BaseViewController { override func configureUI() { super.configureUI() - setupSettingButton() + self.setupSettingButton() } // MARK: - API @@ -205,17 +205,17 @@ final class DetailWaitViewController: BaseViewController { private func requestWaitRoomInfo() { Task { do { - let data = try await detailWaitService.getWaitingRoomInfo(roomId: "\(roomIndex)") + let data = try await self.detailWaitService.getWaitingRoomInfo(roomId: "\(roomIndex)") if let roomInfo = data { guard let title = roomInfo.roomInformation?.title, let state = roomInfo.roomInformation?.state, let participants = roomInfo.participants, let isAdmin = roomInfo.admin else { return } self.room = roomInfo - userArr = participants.membersNickname - memberType = isAdmin ? .owner : .member + self.userArr = participants.membersNickname + self.memberType = isAdmin ? .owner : .member self.roomInfo = roomInfo.roomDTO - setStartButton() + self.setStartButton() DispatchQueue.main.async { self.isPastStartDate() self.titleView.setStartState(state: state) @@ -237,10 +237,10 @@ final class DetailWaitViewController: BaseViewController { private func requestStartManitto() { Task { do { - let data = try await detailWaitService.startManitto(roomId: "\(roomIndex)") + let data = try await self.detailWaitService.startManitto(roomId: "\(roomIndex)") if let manittee = data { guard let nickname = manittee.nickname else { return } - presentSelectManittoViewController(nickname: nickname) + self.presentSelectManittoViewController(nickname: nickname) } } catch NetworkError.serverError { print("server Error") @@ -255,9 +255,9 @@ final class DetailWaitViewController: BaseViewController { private func requestDeleteRoom() { Task { do { - let status = try await detailWaitService.deleteRoom(roomId: "\(roomIndex)") + let status = try await self.detailWaitService.deleteRoom(roomId: "\(roomIndex)") if status == 204 { - navigationController?.popViewController(animated: true) + self.navigationController?.popViewController(animated: true) } } catch NetworkError.serverError { print("server Error") @@ -272,9 +272,9 @@ final class DetailWaitViewController: BaseViewController { private func requestDeleteLeaveRoom() { Task { do { - let status = try await detailWaitService.deleteLeaveRoom(roomId: "\(roomIndex)") + let status = try await self.detailWaitService.deleteLeaveRoom(roomId: "\(roomIndex)") if status == 204 { - navigationController?.popViewController(animated: true) + self.navigationController?.popViewController(animated: true) } } catch NetworkError.serverError { print("server Error") @@ -289,13 +289,13 @@ final class DetailWaitViewController: BaseViewController { // MARK: - func private func setupDelegation() { - listTableView.delegate = self - listTableView.dataSource = self - listTableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") + self.listTableView.delegate = self + self.listTableView.dataSource = self + self.listTableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") } private func presentDetailEditViewController(startString: String, endString: String, isDateEdit: Bool) { - guard let title = titleView.roomTitleLabel.text else { return } + guard let title = self.titleView.roomTitleLabel.text else { return } let viewController = DetailEditViewController(editMode: isDateEdit ? .date : .information, roomIndex: roomIndex, title: title) @@ -308,7 +308,7 @@ final class DetailWaitViewController: BaseViewController { viewController.sliderValue = capacity viewController.startDateText = startString viewController.endDateText = endString - present(viewController, animated: true, completion: nil) + self.present(viewController, animated: true, completion: nil) } // MARK: - private func @@ -318,7 +318,7 @@ final class DetailWaitViewController: BaseViewController { offsetX: -10) let settingButton = super.makeBarButtonItem(with: rightOffsetSettingButton) - navigationItem.rightBarButtonItem = settingButton + self.navigationItem.rightBarButtonItem = settingButton } private func setExitButtonMenu() -> UIMenu { @@ -349,11 +349,11 @@ final class DetailWaitViewController: BaseViewController { } private func presentEditRoomView() { - guard let roomInformation = room?.roomInformation else { return } + guard let roomInformation = self.room?.roomInformation else { return } if roomInformation.isAlreadyPastDate { - editInfoFromDefaultDate(isDateEdit: false) + self.editInfoFromDefaultDate(isDateEdit: false) } else { - editInfoFromCurrentDate() + self.editInfoFromCurrentDate() } } @@ -367,19 +367,19 @@ final class DetailWaitViewController: BaseViewController { } private func editInfoFromCurrentDate() { - guard let startDate = room?.roomInformation?.startDate, - let endDate = room?.roomInformation?.endDate else { return } + guard let startDate = self.room?.roomInformation?.startDate, + let endDate = self.room?.roomInformation?.endDate else { return } self.presentDetailEditViewController(startString: startDate, endString: endDate, isDateEdit: false) } private func setupNotificationCenter() { - NotificationCenter.default.addObserver(self, selector: #selector(didTapEnterButton), name: .createRoomInvitedCode, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(self.didTapEnterButton), name: .createRoomInvitedCode, object: nil) } private func isPastStartDate() { - guard let isStart = room?.roomInformation?.isStart else { return } + guard let isStart = self.room?.roomInformation?.isStart else { return } if !isStart { switch memberType { case .owner: @@ -398,10 +398,10 @@ final class DetailWaitViewController: BaseViewController { private func setStartButton() { if memberType == .owner { - guard let canStart = room?.canStart else { return } - detectStartableStatus?(canStart) + guard let canStart = self.room?.canStart else { return } + self.detectStartableStatus?(canStart) } else { - detectStartableStatus?(false) + self.detectStartableStatus?(false) } } @@ -424,9 +424,9 @@ final class DetailWaitViewController: BaseViewController { } private func setupTitleViewGesture() { - if memberType == .owner { - let tapGesture = UITapGestureRecognizer(target: self, action: #selector(presentEditViewController)) - titleView.addGestureRecognizer(tapGesture) + if self.memberType == .owner { + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.presentEditViewController)) + self.titleView.addGestureRecognizer(tapGesture) } } @@ -435,14 +435,14 @@ final class DetailWaitViewController: BaseViewController { guard let viewController = storyboard.instantiateViewController(withIdentifier: SelectManittoViewController.className) as? SelectManittoViewController else { return } viewController.modalPresentationStyle = .fullScreen viewController.manitteeName = nickname - viewController.roomId = roomInformation?.id?.description + viewController.roomId = self.roomInformation?.id?.description present(viewController, animated: true) } // MARK: - selector @objc private func didTapEnterButton() { - guard let roomInfo = roomInfo, - let code = room?.invitation?.code + guard let roomInfo = self.roomInfo, + let code = self.room?.invitation?.code else { return } let viewController = InvitedCodeViewController(roomInfo: RoomDTO(title: roomInfo.title, capacity: roomInfo.capacity, @@ -452,19 +452,19 @@ final class DetailWaitViewController: BaseViewController { viewController.roomInfo = roomInfo viewController.modalPresentationStyle = .overCurrentContext viewController.modalTransitionStyle = .crossDissolve - present(viewController, animated: true) + self.present(viewController, animated: true) } @objc private func presentEditViewController() { - guard let startDate = room?.roomInformation?.startDate, - let endDate = room?.roomInformation?.endDate else { return } + guard let startDate = self.room?.roomInformation?.startDate, + let endDate = self.room?.roomInformation?.endDate else { return } self.presentDetailEditViewController(startString: startDate, endString: endDate, isDateEdit: false) } @objc private func changeStartButton() { - setStartButton() + self.setStartButton() } } @@ -476,12 +476,12 @@ extension DetailWaitViewController: UITableViewDelegate { extension DetailWaitViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return userArr.count + return self.userArr.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = listTableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell - cell.textLabel?.text = userArr[indexPath.row] + let cell = self.listTableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell + cell.textLabel?.text = self.userArr[indexPath.row] cell.textLabel?.font = .font(.regular, ofSize: 17) cell.backgroundColor = .darkGrey003 cell.selectionStyle = .none diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index 129dae7d9..477f8e62d 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -82,9 +82,9 @@ final class CalendarView: UIView { override init(frame: CGRect) { super.init(frame: frame) - setupLayout() - setupDelegation() - setupDateRange() + self.setupLayout() + self.setupDelegation() + self.setupDateRange() } required init?(coder: NSCoder) { @@ -94,148 +94,148 @@ final class CalendarView: UIView { // MARK: - func private func setupLayout() { - self.addSubview(calendar) - calendar.snp.makeConstraints { + self.addSubview(self.calendar) + self.calendar.snp.makeConstraints { $0.edges.equalToSuperview() } - self.addSubview(previousButton) - previousButton.snp.makeConstraints { + self.addSubview(self.previousButton) + self.previousButton.snp.makeConstraints { $0.top.equalToSuperview().inset(5) $0.leading.equalToSuperview().inset(70) } - self.addSubview(nextButton) - nextButton.snp.makeConstraints { + self.addSubview(self.nextButton) + self.nextButton.snp.makeConstraints { $0.top.equalToSuperview().inset(5) $0.trailing.equalToSuperview().inset(72) } } func setupButtonState() { - let hasDate = tempStartDateText != "" && tempEndDateText != "" - changeButtonState?(hasDate) + let hasDate = self.tempStartDateText != "" && self.tempEndDateText != "" + self.changeButtonState?(hasDate) } private func setupDelegation() { - calendar.delegate = self - calendar.dataSource = self + self.calendar.delegate = self + self.calendar.dataSource = self } private func changeMonth(with type: CalendarMoveType) { let todayCalendar = Calendar.current - let currentPage = calendar.currentPage + let currentPage = self.calendar.currentPage var dateComponents = DateComponents() dateComponents.month = type.month guard let changedCurrentPage = todayCalendar.date(byAdding: dateComponents, to: currentPage) else { return } - calendar.setCurrentPage(changedCurrentPage, animated: true) + self.calendar.setCurrentPage(changedCurrentPage, animated: true) } func setupDateRange() { - guard let startDate = startDateText.stringToDate else { return } - guard let endDate = endDateText.stringToDate else { return } - setupCalendarRange(startDate: startDate, endDate: endDate) + guard let startDate = self.startDateText.stringToDate else { return } + guard let endDate = self.endDateText.stringToDate else { return } + self.setupCalendarRange(startDate: startDate, endDate: endDate) } private func setupCalendarRange(startDate: Date, endDate: Date) { - calendar.select(startDate) - calendar.select(endDate) - setDateRange() + self.calendar.select(startDate) + self.calendar.select(endDate) + self.setDateRange() } func setDateRange() { - guard countDateRange() <= 7 else { return } + guard self.countDateRange() <= 7 else { return } - let isFirstClickPastDate = calendar.selectedDates[0] < calendar.selectedDates[1] + let isFirstClickPastDate = self.calendar.selectedDates[0] < self.calendar.selectedDates[1] if isFirstClickPastDate { - setSelecteDate(startIndex: 0, - endIndex: 1) + self.setSelecteDate(startIndex: 0, + endIndex: 1) } else { - setSelecteDate(startIndex: 1, - endIndex: 0) + self.setSelecteDate(startIndex: 1, + endIndex: 0) } } func setSelecteDate(startIndex: Int, endIndex: Int) { - var startDate = calendar.selectedDates[startIndex] - while startDate < calendar.selectedDates[endIndex] { + var startDate = self.calendar.selectedDates[startIndex] + while startDate < self.calendar.selectedDates[endIndex] { guard let addDate = Calendar.current.date(byAdding: .day, value: 1, to: startDate) else { return } - calendar.select(addDate) - startDate += oneDayInterval + self.calendar.select(addDate) + startDate += self.oneDayInterval } - tempStartDateText = calendar.selectedDates[startIndex].dateToString - tempEndDateText = calendar.selectedDates[endIndex].dateToString + self.tempStartDateText = self.calendar.selectedDates[startIndex].dateToString + self.tempEndDateText = self.calendar.selectedDates[endIndex].dateToString } func countDateRange() -> Int { - let isFirstClickPastDate = calendar.selectedDates[0] < calendar.selectedDates[1] + let isFirstClickPastDate = self.calendar.selectedDates[0] < self.calendar.selectedDates[1] let selectdDate = isFirstClickPastDate - ? calendar.selectedDates[1].timeIntervalSince(calendar.selectedDates[0]) - : calendar.selectedDates[0].timeIntervalSince(calendar.selectedDates[1]) + ? self.calendar.selectedDates[1].timeIntervalSince(self.calendar.selectedDates[0]) + : self.calendar.selectedDates[0].timeIntervalSince(self.calendar.selectedDates[1]) let dateRangeCount = selectdDate / 86400 return Int(dateRangeCount) + 1 } func getTempStartDate() -> String { - return tempStartDateText + return self.tempStartDateText } func getTempEndDate() -> String { - return tempEndDateText + return self.tempEndDateText } } extension CalendarView: FSCalendarDelegate { func calendar(_ calendar: FSCalendar, didSelect date: Date, at monthPosition: FSCalendarMonthPosition) { - isFirstTap = true + self.isFirstTap = true let isCreatedRoomOnlySelectedStartDate = calendar.selectedDates.count == 1 let isSelectedDateRange = calendar.selectedDates.count == 2 let isReclickedStartDate = calendar.selectedDates.count > 2 if isCreatedRoomOnlySelectedStartDate { - selectStartDate = date - calendar.select(selectStartDate) + self.selectStartDate = date + calendar.select(self.selectStartDate) calendar.reloadData() } else if isSelectedDateRange { - tempEndDateText = date.dateToString - if countDateRange() > 7 { + self.tempEndDateText = date.dateToString + if self.countDateRange() > 7 { calendar.deselect(date) viewController?.makeAlert(title: TextLiteral.calendarViewAlertMaxTitle, message: TextLiteral.maxMessage) } else { - setDateRange() + self.setDateRange() calendar.reloadData() } } else if isReclickedStartDate { - tempStartDateText = date.dateToString - tempEndDateText = "" + self.tempStartDateText = date.dateToString + self.tempEndDateText = "" (calendar.selectedDates).forEach { calendar.deselect($0) } - selectStartDate = date - calendar.select(selectStartDate) + self.selectStartDate = date + calendar.select(self.selectStartDate) calendar.reloadData() } - setupButtonState() + self.setupButtonState() } func calendar(_ calendar: FSCalendar, didDeselect date: Date, at monthPosition: FSCalendarMonthPosition) { - tempEndDateText = "" - isFirstTap = true + self.tempEndDateText = "" + self.isFirstTap = true (calendar.selectedDates).forEach { calendar.deselect($0) } - selectStartDate = date + self.selectStartDate = date calendar.select(date) calendar.reloadData() - setupButtonState() + self.setupButtonState() } func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool { - if date < Date() - oneDayInterval { + if date < Date() - self.oneDayInterval { viewController?.makeAlert(title: TextLiteral.calendarViewAlertPastTitle, message: TextLiteral.calendarViewAlertPastMessage) return false @@ -245,8 +245,8 @@ extension CalendarView: FSCalendarDelegate { } func calendar(_ calendar: FSCalendar, appearance: FSCalendarAppearance, titleDefaultColorFor date: Date) -> UIColor? { - let isBeforeToday = date < Date() - oneDayInterval - let isAWeekBeforeAfter = date < selectStartDate + sevenDaysInterval && date > selectStartDate - sevenDaysInterval + let isBeforeToday = date < Date() - self.oneDayInterval + let isAWeekBeforeAfter = date < self.selectStartDate + self.sevenDaysInterval && date > self.selectStartDate - self.sevenDaysInterval let isDoneSelectedDate = calendar.selectedDates.count > 2 if isBeforeToday { return .grey004.withAlphaComponent(0.4) diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift index 4876d30ab..a909fce63 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/DetailWaitTitleView.swift @@ -75,7 +75,7 @@ final class DetailWaitTitleView: UIView { override init(frame: CGRect) { super.init(frame: frame) - setupLayout() + self.setupLayout() } required init?(coder: NSCoder) { @@ -85,34 +85,34 @@ final class DetailWaitTitleView: UIView { // MARK: - func private func setupLayout() { - self.addSubview(roomTitleLabel) - roomTitleLabel.snp.makeConstraints { + self.addSubview(self.roomTitleLabel) + self.roomTitleLabel.snp.makeConstraints { $0.leading.top.equalToSuperview() } - self.addSubview(startStautsLabel) - startStautsLabel.snp.makeConstraints { - $0.centerY.equalTo(roomTitleLabel.snp.centerY) - $0.leading.equalTo(roomTitleLabel.snp.trailing).offset(10) + self.addSubview(self.startStautsLabel) + self.startStautsLabel.snp.makeConstraints { + $0.centerY.equalTo(self.roomTitleLabel.snp.centerY) + $0.leading.equalTo(self.roomTitleLabel.snp.trailing).offset(10) $0.width.equalTo(66) $0.height.equalTo(23) } - self.addSubview(durationView) - durationView.snp.makeConstraints { - $0.top.equalTo(roomTitleLabel.snp.bottom).offset(30) + self.addSubview(self.durationView) + self.durationView.snp.makeConstraints { + $0.top.equalTo(self.roomTitleLabel.snp.bottom).offset(30) $0.trailing.leading.equalToSuperview() $0.height.equalTo(36) } - durationView.addSubview(durationLabel) - durationLabel.snp.makeConstraints { + self.durationView.addSubview(self.durationLabel) + self.durationLabel.snp.makeConstraints { $0.leading.equalToSuperview().inset(20) $0.centerY.equalToSuperview() } - durationView.addSubview(durationDateLabel) - durationDateLabel.snp.makeConstraints { + self.durationView.addSubview(self.durationDateLabel) + self.durationDateLabel.snp.makeConstraints { $0.trailing.equalToSuperview().inset(40) $0.centerY.equalToSuperview() } @@ -121,21 +121,21 @@ final class DetailWaitTitleView: UIView { func setStartState(state: String) { switch state { case "PRE": - startStautsLabel.text = StartStatus.waiting.status + self.startStautsLabel.text = StartStatus.waiting.status case "PROCESSING": - startStautsLabel.text = StartStatus.starting.status + self.startStautsLabel.text = StartStatus.starting.status case "POST": - startStautsLabel.text = StartStatus.complete.status + self.startStautsLabel.text = StartStatus.complete.status default: - startStautsLabel.text = StartStatus.waiting.status + self.startStautsLabel.text = StartStatus.waiting.status } } func setRoomTitleLabelText(text: String) { - roomTitleLabel.text = text + self.roomTitleLabel.text = text } func setDurationDateLabel(text: String) { - durationDateLabel.text = text + self.durationDateLabel.text = text } } From 10b950494bfcfa0c09e008682c4ebe5931887a75 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 00:06:57 +0900 Subject: [PATCH 42/69] =?UTF-8?q?[CHORE]=20=EB=84=A4=ED=8A=B8=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=20=EC=BD=94=EB=93=9C=20=EC=9C=84=EC=B9=98=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailEditViewController.swift | 46 ++--- .../DetailWaitViewController.swift | 175 +++++++++--------- 2 files changed, 110 insertions(+), 111 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 9a5d1a5f4..43fc20654 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -237,29 +237,6 @@ final class DetailEditViewController: BaseViewController { } } } - - // MARK: - API - - private func putChangeRoomInfo(roomDto: RoomDTO) { - Task { - do { - let status = try await self.detailWaitService.editRoomInfo(roomId: "\(roomIndex)", - roomInfo: roomDto) - if status == 204 { - ToastView.showToast(message: "방 정보 수정 완료", - controller: self) - self.didTappedChangeButton?() - self.dismiss(animated: true) - } - } catch NetworkError.serverError { - print("server Error") - } catch NetworkError.encodingError { - print("encoding Error") - } catch NetworkError.clientError(let message) { - print("client Error: \(String(describing: message))") - } - } - } // MARK: - func @@ -316,6 +293,29 @@ final class DetailEditViewController: BaseViewController { self.memberCountLabel.font = .font(.regular, ofSize: 24) self.memberCountLabel.textColor = .white } + + // MARK: - network + + private func putChangeRoomInfo(roomDto: RoomDTO) { + Task { + do { + let status = try await self.detailWaitService.editRoomInfo(roomId: "\(roomIndex)", + roomInfo: roomDto) + if status == 204 { + ToastView.showToast(message: "방 정보 수정 완료", + controller: self) + self.didTappedChangeButton?() + self.dismiss(animated: true) + } + } catch NetworkError.serverError { + print("server Error") + } catch NetworkError.encodingError { + print("encoding Error") + } catch NetworkError.clientError(let message) { + print("client Error: \(String(describing: message))") + } + } + } } extension DetailEditViewController: UIAdaptivePresentationControllerDelegate { diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index bfc3d0e1b..bb509a84e 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -199,92 +199,6 @@ final class DetailWaitViewController: BaseViewController { super.configureUI() self.setupSettingButton() } - - // MARK: - API - - private func requestWaitRoomInfo() { - Task { - do { - let data = try await self.detailWaitService.getWaitingRoomInfo(roomId: "\(roomIndex)") - if let roomInfo = data { - guard let title = roomInfo.roomInformation?.title, - let state = roomInfo.roomInformation?.state, - let participants = roomInfo.participants, - let isAdmin = roomInfo.admin else { return } - self.room = roomInfo - self.userArr = participants.membersNickname - self.memberType = isAdmin ? .owner : .member - self.roomInfo = roomInfo.roomDTO - self.setStartButton() - DispatchQueue.main.async { - self.isPastStartDate() - self.titleView.setStartState(state: state) - self.comeInLabel.text = data?.userCount - self.titleView.setRoomTitleLabelText(text: title) - self.titleView.setDurationDateLabel(text: roomInfo.roomInformation?.dateRange ?? "") - } - } - } catch NetworkError.serverError { - print("server Error") - } catch NetworkError.encodingError { - print("encoding Error") - } catch NetworkError.clientError(let message) { - print("client Error: \(String(describing: message))") - } - } - } - - private func requestStartManitto() { - Task { - do { - let data = try await self.detailWaitService.startManitto(roomId: "\(roomIndex)") - if let manittee = data { - guard let nickname = manittee.nickname else { return } - self.presentSelectManittoViewController(nickname: nickname) - } - } catch NetworkError.serverError { - print("server Error") - } catch NetworkError.encodingError { - print("encoding Error") - } catch NetworkError.clientError(let message) { - print("client Error: \(String(describing: message))") - } - } - } - - private func requestDeleteRoom() { - Task { - do { - let status = try await self.detailWaitService.deleteRoom(roomId: "\(roomIndex)") - if status == 204 { - self.navigationController?.popViewController(animated: true) - } - } catch NetworkError.serverError { - print("server Error") - } catch NetworkError.encodingError { - print("encoding Error") - } catch NetworkError.clientError(let message) { - print("client Error: \(String(describing: message))") - } - } - } - - private func requestDeleteLeaveRoom() { - Task { - do { - let status = try await self.detailWaitService.deleteLeaveRoom(roomId: "\(roomIndex)") - if status == 204 { - self.navigationController?.popViewController(animated: true) - } - } catch NetworkError.serverError { - print("server Error") - } catch NetworkError.encodingError { - print("encoding Error") - } catch NetworkError.clientError(let message) { - print("client Error: \(String(describing: message))") - } - } - } // MARK: - func @@ -311,8 +225,6 @@ final class DetailWaitViewController: BaseViewController { self.present(viewController, animated: true, completion: nil) } - // MARK: - private func - private func setupSettingButton() { let rightOffsetSettingButton = super.removeBarButtonItemOffset(with: settingButton, offsetX: -10) @@ -440,6 +352,7 @@ final class DetailWaitViewController: BaseViewController { } // MARK: - selector + @objc private func didTapEnterButton() { guard let roomInfo = self.roomInfo, let code = self.room?.invitation?.code @@ -466,6 +379,92 @@ final class DetailWaitViewController: BaseViewController { @objc private func changeStartButton() { self.setStartButton() } + + // MARK: - network + + private func requestWaitRoomInfo() { + Task { + do { + let data = try await self.detailWaitService.getWaitingRoomInfo(roomId: "\(roomIndex)") + if let roomInfo = data { + guard let title = roomInfo.roomInformation?.title, + let state = roomInfo.roomInformation?.state, + let participants = roomInfo.participants, + let isAdmin = roomInfo.admin else { return } + self.room = roomInfo + self.userArr = participants.membersNickname + self.memberType = isAdmin ? .owner : .member + self.roomInfo = roomInfo.roomDTO + self.setStartButton() + DispatchQueue.main.async { + self.isPastStartDate() + self.titleView.setStartState(state: state) + self.comeInLabel.text = data?.userCount + self.titleView.setRoomTitleLabelText(text: title) + self.titleView.setDurationDateLabel(text: roomInfo.roomInformation?.dateRange ?? "") + } + } + } catch NetworkError.serverError { + print("server Error") + } catch NetworkError.encodingError { + print("encoding Error") + } catch NetworkError.clientError(let message) { + print("client Error: \(String(describing: message))") + } + } + } + + private func requestStartManitto() { + Task { + do { + let data = try await self.detailWaitService.startManitto(roomId: "\(roomIndex)") + if let manittee = data { + guard let nickname = manittee.nickname else { return } + self.presentSelectManittoViewController(nickname: nickname) + } + } catch NetworkError.serverError { + print("server Error") + } catch NetworkError.encodingError { + print("encoding Error") + } catch NetworkError.clientError(let message) { + print("client Error: \(String(describing: message))") + } + } + } + + private func requestDeleteRoom() { + Task { + do { + let status = try await self.detailWaitService.deleteRoom(roomId: "\(roomIndex)") + if status == 204 { + self.navigationController?.popViewController(animated: true) + } + } catch NetworkError.serverError { + print("server Error") + } catch NetworkError.encodingError { + print("encoding Error") + } catch NetworkError.clientError(let message) { + print("client Error: \(String(describing: message))") + } + } + } + + private func requestDeleteLeaveRoom() { + Task { + do { + let status = try await self.detailWaitService.deleteLeaveRoom(roomId: "\(roomIndex)") + if status == 204 { + self.navigationController?.popViewController(animated: true) + } + } catch NetworkError.serverError { + print("server Error") + } catch NetworkError.encodingError { + print("encoding Error") + } catch NetworkError.clientError(let message) { + print("client Error: \(String(describing: message))") + } + } + } } extension DetailWaitViewController: UITableViewDelegate { From 656b798c2a02a7ab633b06ae763beafe28440984 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 00:09:19 +0900 Subject: [PATCH 43/69] =?UTF-8?q?[CHORE]=20override=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=20=EC=A3=BC=EC=84=9D=20=EB=B6=84=EB=A6=AC=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailEditViewController.swift | 6 ++++-- .../Screens/Detail-Wait/DetailWaitViewController.swift | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 43fc20654..86e86e57f 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -129,8 +129,8 @@ final class DetailEditViewController: BaseViewController { self.calendarView.setupDateRange() } } - - // MARK: - life cycle + + // MARK: - init init(editMode: EditMode, roomIndex: Int, title: String) { self.editMode = editMode @@ -147,6 +147,8 @@ final class DetailEditViewController: BaseViewController { print("\(#file) is dead") } + // MARK: - override + override func configureUI() { super.configureUI() self.navigationController?.isNavigationBarHidden = true diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index bb509a84e..16796b6c8 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -153,6 +153,8 @@ final class DetailWaitViewController: BaseViewController { self.setupDelegation() self.setupNotificationCenter() } + + // MARK: - override override func setupLayout() { self.view.addSubview(self.titleView) From 941223dc1493d593e2841e2229e27fee28843aa6 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:20:36 +0900 Subject: [PATCH 44/69] =?UTF-8?q?[CHORE]=20UIAction=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=EB=A1=9C=20=EB=B6=84=EB=A6=AC=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailEditViewController.swift | 32 ++++++++++++------- .../DetailWaitViewController.swift | 20 +++++++----- .../UIComponent/CalendarView.swift | 27 ++++++++++------ 3 files changed, 49 insertions(+), 30 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 86e86e57f..af7699e7a 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -14,15 +14,11 @@ final class DetailEditViewController: BaseViewController { // MARK: - ui component - private lazy var cancelButton: UIButton = { + private let cancelButton: UIButton = { let button = UIButton(type: .system) - let buttonAction = UIAction { [weak self] _ in - self?.dismiss(animated: true) - } button.setTitle(TextLiteral.cancel, for: .normal) button.setTitleColor(.white, for: .normal) button.titleLabel?.font = .font(.regular, ofSize: 16) - button.addAction(buttonAction, for: .touchUpInside) return button }() private let topIndicatorView: UIView = { @@ -31,15 +27,11 @@ final class DetailEditViewController: BaseViewController { view.layer.cornerRadius = 1.5 return view }() - private lazy var changeButton: UIButton = { + private let changeButton: UIButton = { let button = UIButton(type: .system) - let buttonAction = UIAction { [weak self] _ in - self?.didTapChangeButton() - } button.setTitle(TextLiteral.change, for: .normal) button.setTitleColor(.subBlue, for: .normal) button.titleLabel?.font = .font(.regular, ofSize: 16) - button.addAction(buttonAction, for: .touchUpInside) return button }() private let titleLabel: UILabel = { @@ -154,7 +146,9 @@ final class DetailEditViewController: BaseViewController { self.navigationController?.isNavigationBarHidden = true self.presentationController?.delegate = self self.isModalInPresentation = true - self.setupChangedButton() + self.setupCalendarChangedButton() + self.setupCancleButton() + self.setupChangeChangeButton() } override func setupLayout() { @@ -241,6 +235,20 @@ final class DetailEditViewController: BaseViewController { } // MARK: - func + + private func setupCancleButton() { + let action = UIAction { [weak self] _ in + self?.dismiss(animated: true) + } + self.cancelButton.addAction(action, for: .touchUpInside) + } + + private func setupChangeChangeButton() { + let action = UIAction { [weak self] _ in + self?.didTapChangeButton() + } + self.changeButton.addAction(action, for: .touchUpInside) + } private func presentationControllerDidAttemptToDismissAlert() { guard self.calendarView.isFirstTap else { @@ -261,7 +269,7 @@ final class DetailEditViewController: BaseViewController { actions: actions) } - private func setupChangedButton() { + private func setupCalendarChangedButton() { self.calendarView.changeButtonState = { [weak self] value in self?.changeButton.isEnabled = value self?.changeButton.setTitleColor(.subBlue, for: .normal) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 16796b6c8..6828c550c 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -73,17 +73,9 @@ final class DetailWaitViewController: BaseViewController { }() private lazy var copyButton: UIButton = { let button = UIButton(type: .system) - let buttonAction = UIAction { [weak self] _ in - if let code = self?.room?.invitation?.code { - ToastView.showToast(code: code , - message: TextLiteral.detailWaitViewControllerCopyCode, - controller: self ?? UIViewController()) - } - } button.setTitle(TextLiteral.copyCode, for: .normal) button.setTitleColor(.subBlue, for: .normal) button.titleLabel?.font = .font(.regular, ofSize: 16) - button.addAction(buttonAction, for: .touchUpInside) return button }() private let listTableView: UITableView = { @@ -152,6 +144,7 @@ final class DetailWaitViewController: BaseViewController { self.requestWaitRoomInfo() self.setupDelegation() self.setupNotificationCenter() + self.setupCopyButton() } // MARK: - override @@ -209,6 +202,17 @@ final class DetailWaitViewController: BaseViewController { self.listTableView.dataSource = self self.listTableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") } + + private func setupCopyButton() { + let action = UIAction { [weak self] _ in + if let code = self?.room?.invitation?.code { + ToastView.showToast(code: code, + message: TextLiteral.detailWaitViewControllerCopyCode, + controller: self ?? UIViewController()) + } + } + copyButton.addAction(action, for: .touchUpInside) + } private func presentDetailEditViewController(startString: String, endString: String, isDateEdit: Bool) { guard let title = self.titleView.roomTitleLabel.text else { return } diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index 477f8e62d..7ffc6e3d2 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -28,22 +28,14 @@ final class CalendarView: UIView { // MARK: - ui component - private lazy var previousButton: UIButton = { + private let previousButton: UIButton = { let button = UIButton() - let action = UIAction { [weak self] _ in - self?.changeMonth(with: CalendarMoveType.previous) - } button.setImage(ImageLiterals.icBack, for: .normal) - button.addAction(action, for: .touchUpInside) return button }() - private lazy var nextButton: UIButton = { + private let nextButton: UIButton = { let button = UIButton() - let action = UIAction { [weak self] _ in - self?.changeMonth(with: CalendarMoveType.next) - } button.setImage(ImageLiterals.icRight, for: .normal) - button.addAction(action, for: .touchUpInside) return button }() private var calendar: FSCalendar = { @@ -85,6 +77,8 @@ final class CalendarView: UIView { self.setupLayout() self.setupDelegation() self.setupDateRange() + self.setupPreviousButton() + self.setupNextButton() } required init?(coder: NSCoder) { @@ -112,6 +106,19 @@ final class CalendarView: UIView { } } + private func setupPreviousButton() { + let action = UIAction { [weak self] _ in + self?.changeMonth(with: CalendarMoveType.previous) + } + self.previousButton.addAction(action, for: .touchUpInside) + } + private func setupNextButton() { + let action = UIAction { [weak self] _ in + self?.changeMonth(with: CalendarMoveType.next) + } + self.nextButton.addAction(action, for: .touchUpInside) + } + func setupButtonState() { let hasDate = self.tempStartDateText != "" && self.tempEndDateText != "" self.changeButtonState?(hasDate) From 8e719b6b7583b20c6b4c4ebad462c242ec3be1c0 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:29:14 +0900 Subject: [PATCH 45/69] =?UTF-8?q?[CHORE]=20UISlider=20addTarget=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20addAction=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailEditViewController.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index af7699e7a..d5965ec29 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -85,7 +85,6 @@ final class DetailEditViewController: BaseViewController { slider.value = Float(self.sliderValue) slider.isContinuous = true slider.setThumbImage(ImageLiterals.imageSliderThumb, for: .normal) - slider.addTarget(self, action: #selector(self.changeMemberCount(sender:)), for: .valueChanged) return slider }() private lazy var memberCountLabel: UILabel = { @@ -149,6 +148,7 @@ final class DetailEditViewController: BaseViewController { self.setupCalendarChangedButton() self.setupCancleButton() self.setupChangeChangeButton() + self.setupMemberSlider() } override func setupLayout() { @@ -249,6 +249,14 @@ final class DetailEditViewController: BaseViewController { } self.changeButton.addAction(action, for: .touchUpInside) } + + private func setupMemberSlider() { + let valueChangeAction = UIAction { [weak self] action in + guard let sender = action.sender as? UISlider else { return } + self?.changeMemberCount(sender: sender) + } + self.memberSlider.addAction(valueChangeAction, for: .valueChanged) + } private func presentationControllerDidAttemptToDismissAlert() { guard self.calendarView.isFirstTap else { From 9a45dbada8afede18a8739264aca2ab9afa6d689 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:30:03 +0900 Subject: [PATCH 46/69] =?UTF-8?q?[CHORE]=20enum=20=EC=9C=84=EC=B9=98=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailEditViewController.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index d5965ec29..09e2f9506 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -11,6 +11,11 @@ import FSCalendar import SnapKit final class DetailEditViewController: BaseViewController { + + enum EditMode { + case date + case information + } // MARK: - ui component @@ -101,10 +106,6 @@ final class DetailEditViewController: BaseViewController { var didTappedChangeButton: (() -> ())? private let roomIndex: Int private let roomTitle: String - enum EditMode { - case date - case information - } var editMode: EditMode var currentUserCount: Int = 0 var sliderValue: Int = 10 From 7cc0c913e73ed6a73993aa2061100b442f4c7f5e Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:32:14 +0900 Subject: [PATCH 47/69] =?UTF-8?q?[CHORE]=20=EB=88=84=EB=9D=BD=EB=90=9C=20s?= =?UTF-8?q?elf=20=EC=B6=94=EA=B0=80=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailEditViewController.swift | 2 +- .../Screens/Detail-Wait/DetailWaitViewController.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 09e2f9506..72d085d06 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -287,7 +287,7 @@ final class DetailEditViewController: BaseViewController { } private func didTapChangeButton() { - let dto = RoomDTO(title: roomTitle, + let dto = RoomDTO(title: self.roomTitle, capacity: Int(self.memberSlider.value), startDate: "20\(self.calendarView.getTempStartDate())", endDate: "20\(self.calendarView.getTempEndDate())") diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 6828c550c..641845abe 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -304,11 +304,11 @@ final class DetailWaitViewController: BaseViewController { let action: ((UIAlertAction) -> ()) = { [weak self] _ in self?.editInfoFromDefaultDate(isDateEdit: true) } - makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, + self.makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, message: TextLiteral.detailWaitViewControllerPastOwnerAlertMessage, okAction: action) case .member: - makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, + self.makeAlert(title: TextLiteral.detailWaitViewControllerPastAlertTitle, message: TextLiteral.detailWaitViewControllerPastAlertMessage) } } @@ -354,7 +354,7 @@ final class DetailWaitViewController: BaseViewController { viewController.modalPresentationStyle = .fullScreen viewController.manitteeName = nickname viewController.roomId = self.roomInformation?.id?.description - present(viewController, animated: true) + self.present(viewController, animated: true) } // MARK: - selector From ef7497a1a3b941666c7cf30e76970701383451f7 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:33:21 +0900 Subject: [PATCH 48/69] =?UTF-8?q?[CHORE]=20render=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EB=B3=80=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 641845abe..48a254351 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -111,7 +111,7 @@ final class DetailWaitViewController: BaseViewController { private var roomInfo: RoomDTO? private var userArr: [String] = [] { didSet { - self.renderTableView() + self.setupLayoutTableView() } } private var detectStartableStatus: ((Bool) -> ())? @@ -323,7 +323,7 @@ final class DetailWaitViewController: BaseViewController { } } - private func renderTableView() { + private func setupLayoutTableView() { DispatchQueue.main.async { self.listTableView.reloadData() self.view.addSubview(self.listTableView) From ae19a0f0779b8560e1f1e3fea84145856aeabdd5 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:34:01 +0900 Subject: [PATCH 49/69] =?UTF-8?q?[CHORE]=20objc=20=ED=95=A8=EC=88=98=202?= =?UTF-8?q?=EC=A4=84=EB=A1=9C=20=EB=B6=84=EB=A6=AC=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailEditViewController.swift | 3 ++- .../Screens/Detail-Wait/DetailWaitViewController.swift | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 72d085d06..178e319fe 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -306,7 +306,8 @@ final class DetailEditViewController: BaseViewController { // MARK: - selector - @objc private func changeMemberCount(sender: UISlider) { + @objc + private func changeMemberCount(sender: UISlider) { self.sliderValue = Int(sender.value) self.memberCountLabel.text = String(Int(sender.value)) + TextLiteral.per self.memberCountLabel.font = .font(.regular, ofSize: 24) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 48a254351..b3d2521dd 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -359,7 +359,8 @@ final class DetailWaitViewController: BaseViewController { // MARK: - selector - @objc private func didTapEnterButton() { + @objc + private func didTapEnterButton() { guard let roomInfo = self.roomInfo, let code = self.room?.invitation?.code else { return } @@ -374,7 +375,8 @@ final class DetailWaitViewController: BaseViewController { self.present(viewController, animated: true) } - @objc private func presentEditViewController() { + @objc + private func presentEditViewController() { guard let startDate = self.room?.roomInformation?.startDate, let endDate = self.room?.roomInformation?.endDate else { return } self.presentDetailEditViewController(startString: startDate, @@ -382,7 +384,8 @@ final class DetailWaitViewController: BaseViewController { isDateEdit: false) } - @objc private func changeStartButton() { + @objc + private func changeStartButton() { self.setStartButton() } From 8b8f5dd0036003ba0ed1fd53681e3b33152d6117 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:42:59 +0900 Subject: [PATCH 50/69] =?UTF-8?q?[CHORE]=20self=20=ED=82=A4=EC=9B=8C?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index 7ffc6e3d2..0948e05c2 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -209,7 +209,7 @@ extension CalendarView: FSCalendarDelegate { self.tempEndDateText = date.dateToString if self.countDateRange() > 7 { calendar.deselect(date) - viewController?.makeAlert(title: TextLiteral.calendarViewAlertMaxTitle, + self.viewController?.makeAlert(title: TextLiteral.calendarViewAlertMaxTitle, message: TextLiteral.maxMessage) } else { self.setDateRange() @@ -243,7 +243,7 @@ extension CalendarView: FSCalendarDelegate { func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool { if date < Date() - self.oneDayInterval { - viewController?.makeAlert(title: TextLiteral.calendarViewAlertPastTitle, + self.viewController?.makeAlert(title: TextLiteral.calendarViewAlertPastTitle, message: TextLiteral.calendarViewAlertPastMessage) return false } else { From e0291b969a2827bab25f98c228b89e8d3a72accf Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 14 Feb 2023 19:45:21 +0900 Subject: [PATCH 51/69] =?UTF-8?q?[CHORE]=20if=20let=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=20=EC=82=AC=EC=9A=A9=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index b3d2521dd..8c2b62cd0 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -408,7 +408,7 @@ final class DetailWaitViewController: BaseViewController { DispatchQueue.main.async { self.isPastStartDate() self.titleView.setStartState(state: state) - self.comeInLabel.text = data?.userCount + self.comeInLabel.text = roomInfo.userCount self.titleView.setRoomTitleLabelText(text: title) self.titleView.setDurationDateLabel(text: roomInfo.roomInformation?.dateRange ?? "") } From c1bc87c4487031c89889577d26abfffe75b3799e Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 15 Feb 2023 15:26:32 +0900 Subject: [PATCH 52/69] =?UTF-8?q?[CHORE]=20=EC=98=A4=ED=83=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailEditViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 178e319fe..bc71abb86 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -146,9 +146,9 @@ final class DetailEditViewController: BaseViewController { self.navigationController?.isNavigationBarHidden = true self.presentationController?.delegate = self self.isModalInPresentation = true - self.setupCalendarChangedButton() + self.setupCalendarChangeButton() self.setupCancleButton() - self.setupChangeChangeButton() + self.setupChangeButton() self.setupMemberSlider() } @@ -244,7 +244,7 @@ final class DetailEditViewController: BaseViewController { self.cancelButton.addAction(action, for: .touchUpInside) } - private func setupChangeChangeButton() { + private func setupChangeButton() { let action = UIAction { [weak self] _ in self?.didTapChangeButton() } @@ -278,7 +278,7 @@ final class DetailEditViewController: BaseViewController { actions: actions) } - private func setupCalendarChangedButton() { + private func setupCalendarChangeButton() { self.calendarView.changeButtonState = { [weak self] value in self?.changeButton.isEnabled = value self?.changeButton.setTitleColor(.subBlue, for: .normal) From 2efb3857e13c7518eff2a132cced71a07fb52e2a Mon Sep 17 00:00:00 2001 From: chemi Date: Wed, 15 Feb 2023 15:31:19 +0900 Subject: [PATCH 53/69] =?UTF-8?q?[CHORE]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=ED=82=A4=EC=9B=8C=EB=93=9C=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailEditViewController.swift | 3 --- .../Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index bc71abb86..6aa585f1b 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -304,9 +304,6 @@ final class DetailEditViewController: BaseViewController { } } - // MARK: - selector - - @objc private func changeMemberCount(sender: UISlider) { self.sliderValue = Int(sender.value) self.memberCountLabel.text = String(Int(sender.value)) + TextLiteral.per diff --git a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift index 0948e05c2..13c09f43a 100644 --- a/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift +++ b/Manito/Manito/Screens/Detail-Wait/UIComponent/CalendarView.swift @@ -108,7 +108,7 @@ final class CalendarView: UIView { private func setupPreviousButton() { let action = UIAction { [weak self] _ in - self?.changeMonth(with: CalendarMoveType.previous) + self?.changeMonth(with: .previous) } self.previousButton.addAction(action, for: .touchUpInside) } From a0f18b408bd826548feaf91a482b7a730eb2607f Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 21:45:24 +0900 Subject: [PATCH 54/69] =?UTF-8?q?[CHORE]=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B8=B8=EC=9D=B4=EC=97=90=20=EB=94=B0=EB=9D=BC=20=ED=8F=B0?= =?UTF-8?q?=ED=8A=B8=20=ED=81=AC=EA=B8=B0=20=EC=A1=B0=EC=A0=88=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80=20(#382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Interaction/OpenManittoPopupViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift index 55346eaee..bf19e5d41 100644 --- a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift +++ b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift @@ -19,6 +19,7 @@ final class OpenManittoPopupViewController: BaseViewController { let label = UILabel() label.numberOfLines = 2 label.font = .font(.regular, ofSize: 30) + label.adjustsFontSizeToFitWidth = true label.textAlignment = .center return label }() From 6026b68abba0f827cbe12393da90f330f50e7735 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 21:45:54 +0900 Subject: [PATCH 55/69] =?UTF-8?q?[CHORE]=20=EC=A2=8C=EC=9A=B0=20inset?= =?UTF-8?q?=EA=B0=92=20=EC=88=98=EC=A0=95=20(#382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Interaction/OpenManittoPopupViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift index bf19e5d41..74cdd387d 100644 --- a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift +++ b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift @@ -81,7 +81,7 @@ final class OpenManittoPopupViewController: BaseViewController { typingLabel.snp.makeConstraints { $0.top.equalToSuperview().inset(popupView.frame.height * 0.36) $0.centerX.equalToSuperview() - $0.leading.trailing.equalToSuperview().inset(10) + $0.leading.trailing.equalToSuperview().inset(24) } popupView.addSubview(openMentLabel) From 7529ff455951bb4f6ecf51d48b04da2207ab2e84 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 23:49:01 +0900 Subject: [PATCH 56/69] =?UTF-8?q?[CHORE]=20setting=20button=20->=20more=20?= =?UTF-8?q?button=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailWaitViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 8c2b62cd0..1ab1af62f 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -47,7 +47,7 @@ final class DetailWaitViewController: BaseViewController { // MARK: - ui component - private lazy var settingButton: UIButton = { + private lazy var moreButton: UIButton = { let button = MoreButton() button.showsMenuAsPrimaryAction = true return button @@ -117,7 +117,7 @@ final class DetailWaitViewController: BaseViewController { private var detectStartableStatus: ((Bool) -> ())? private var memberType = UserStatus.member { didSet { - self.settingButton.menu = self.setExitButtonMenu() + self.moreButton.menu = self.setExitButtonMenu() self.setupTitleViewGesture() } } @@ -232,7 +232,7 @@ final class DetailWaitViewController: BaseViewController { } private func setupSettingButton() { - let rightOffsetSettingButton = super.removeBarButtonItemOffset(with: settingButton, + let rightOffsetSettingButton = super.removeBarButtonItemOffset(with: moreButton, offsetX: -10) let settingButton = super.makeBarButtonItem(with: rightOffsetSettingButton) From f89e31e0861243efd4760f3a3e479a424d34c264 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 23:50:30 +0900 Subject: [PATCH 57/69] =?UTF-8?q?[CHORE]=20property=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=20=ED=83=80=EC=9E=85=20=EB=AA=85=EC=8B=9C=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailEditViewController.swift | 2 +- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 6aa585f1b..d18ba0a60 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -52,7 +52,7 @@ final class DetailEditViewController: BaseViewController { label.textColor = .white return label }() - private lazy var calendarView = CalendarView() + private let calendarView: CalendarView = CalendarView() private let tipLabel: UILabel = { let label = UILabel() label.text = TextLiteral.maxMessage diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 1ab1af62f..2ea5573fd 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -52,7 +52,7 @@ final class DetailWaitViewController: BaseViewController { button.showsMenuAsPrimaryAction = true return button }() - private let titleView = DetailWaitTitleView() + private let titleView: DetailWaitTitleView = DetailWaitTitleView() private let togetherFriendLabel: UILabel = { let label = UILabel() label.text = TextLiteral.togetherFriend From 3cc8b7ca32d48503c3128c6fd632a690e06291e2 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 23:51:45 +0900 Subject: [PATCH 58/69] =?UTF-8?q?[CHORE]=20lazy=20var=20->=20let=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailEditViewController.swift | 2 +- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index d18ba0a60..9c47a6a8f 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -60,7 +60,7 @@ final class DetailEditViewController: BaseViewController { label.font = .font(.regular, ofSize: 14) return label }() - private lazy var setMemberLabel: UILabel = { + private let setMemberLabel: UILabel = { let label = UILabel() label.text = TextLiteral.detailEditViewControllerSetMember label.font = .font(.regular, ofSize: 18) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 2ea5573fd..b390ebd4f 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -47,7 +47,7 @@ final class DetailWaitViewController: BaseViewController { // MARK: - ui component - private lazy var moreButton: UIButton = { + private let moreButton: UIButton = { let button = MoreButton() button.showsMenuAsPrimaryAction = true return button @@ -71,7 +71,7 @@ final class DetailWaitViewController: BaseViewController { label.font = .font(.regular, ofSize: 14) return label }() - private lazy var copyButton: UIButton = { + private let copyButton: UIButton = { let button = UIButton(type: .system) button.setTitle(TextLiteral.copyCode, for: .normal) button.setTitleColor(.subBlue, for: .normal) From c841f03c36768a5313f9f652743d603484a653e8 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 23:54:10 +0900 Subject: [PATCH 59/69] =?UTF-8?q?[CHORE]=20=EB=AA=A8=ED=98=B8=ED=95=9C=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=EB=AA=85=20=EB=B3=80=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Detail-Wait/DetailWaitViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index b390ebd4f..502044daf 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -65,7 +65,7 @@ final class DetailWaitViewController: BaseViewController { imageView.image = ImageLiterals.imgNi return imageView }() - private let comeInLabel: UILabel = { + private let userCountLabel: UILabel = { let label = UILabel() label.textColor = .white label.font = .font(.regular, ofSize: 14) @@ -170,8 +170,8 @@ final class DetailWaitViewController: BaseViewController { $0.width.height.equalTo(30) } - self.view.addSubview(self.comeInLabel) - self.comeInLabel.snp.makeConstraints { + self.view.addSubview(self.userCountLabel) + self.userCountLabel.snp.makeConstraints { $0.leading.equalTo(self.imgNiView.snp.trailing) $0.centerY.equalTo(self.imgNiView.snp.centerY) } @@ -408,7 +408,7 @@ final class DetailWaitViewController: BaseViewController { DispatchQueue.main.async { self.isPastStartDate() self.titleView.setStartState(state: state) - self.comeInLabel.text = roomInfo.userCount + self.userCountLabel.text = roomInfo.userCount self.titleView.setRoomTitleLabelText(text: title) self.titleView.setDurationDateLabel(text: roomInfo.roomInformation?.dateRange ?? "") } From c24e5cb2f832398a2b6b4b55de9d23dc4ecd6bb4 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 23:56:07 +0900 Subject: [PATCH 60/69] =?UTF-8?q?[CHORE]=20=EA=B0=80=EB=8F=85=EC=84=B1=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0=20=EC=A4=84=EB=B0=94=EA=BF=88=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index 502044daf..fd2086fa6 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -362,8 +362,7 @@ final class DetailWaitViewController: BaseViewController { @objc private func didTapEnterButton() { guard let roomInfo = self.roomInfo, - let code = self.room?.invitation?.code - else { return } + let code = self.room?.invitation?.code else { return } let viewController = InvitedCodeViewController(roomInfo: RoomDTO(title: roomInfo.title, capacity: roomInfo.capacity, startDate: roomInfo.startDate, From 2faafa4c0f60af40d84f0ec0898c4911fb7ea4de Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 20 Feb 2023 23:57:39 +0900 Subject: [PATCH 61/69] =?UTF-8?q?[CHORE]=20viewDidLoad=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EB=B6=84=EB=A6=AC=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Detail-Wait/DetailEditViewController.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift index 9c47a6a8f..9f09850ee 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailEditViewController.swift @@ -141,15 +141,19 @@ final class DetailEditViewController: BaseViewController { // MARK: - override + override func viewDidLoad() { + super.viewDidLoad() + self.setupCalendarChangeButton() + self.setupCancleButton() + self.setupChangeButton() + self.setupMemberSlider() + } + override func configureUI() { super.configureUI() self.navigationController?.isNavigationBarHidden = true self.presentationController?.delegate = self self.isModalInPresentation = true - self.setupCalendarChangeButton() - self.setupCancleButton() - self.setupChangeButton() - self.setupMemberSlider() } override func setupLayout() { From a634b0b8d30c9276a5b6ae58309d5a5380a828c7 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 21 Feb 2023 00:10:03 +0900 Subject: [PATCH 62/69] =?UTF-8?q?[CHORE]=20register=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD=20(#376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manito/Screens/Detail-Wait/DetailWaitViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift index fd2086fa6..2443ec176 100644 --- a/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift +++ b/Manito/Manito/Screens/Detail-Wait/DetailWaitViewController.swift @@ -82,6 +82,7 @@ final class DetailWaitViewController: BaseViewController { let tableView = UITableView() tableView.layer.cornerRadius = 10 tableView.isScrollEnabled = false + tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") return tableView }() private lazy var startButton: UIButton = { @@ -200,7 +201,6 @@ final class DetailWaitViewController: BaseViewController { private func setupDelegation() { self.listTableView.delegate = self self.listTableView.dataSource = self - self.listTableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") } private func setupCopyButton() { From 18d632a41270e069a7f2d08b07681946d5ed21f9 Mon Sep 17 00:00:00 2001 From: chemi Date: Tue, 21 Feb 2023 00:12:23 +0900 Subject: [PATCH 63/69] =?UTF-8?q?[CHORE]=20=EA=B8=80=EC=9E=90=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=20=EC=88=98=EC=A0=95=20(#382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Screens/Interaction/OpenManittoPopupViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift index 74cdd387d..18cda66c2 100644 --- a/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift +++ b/Manito/Manito/Screens/Interaction/OpenManittoPopupViewController.swift @@ -18,7 +18,7 @@ final class OpenManittoPopupViewController: BaseViewController { private lazy var typingLabel: UILabel = { let label = UILabel() label.numberOfLines = 2 - label.font = .font(.regular, ofSize: 30) + label.font = .font(.regular, ofSize: 24) label.adjustsFontSizeToFitWidth = true label.textAlignment = .center return label From a95cbd33605584cb6c2ce3f369a6e9649c9e1931 Mon Sep 17 00:00:00 2001 From: chemi Date: Mon, 27 Feb 2023 12:12:04 +0900 Subject: [PATCH 64/69] =?UTF-8?q?[CHORE]=20v1.2.1=20=EC=B6=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Manito/Manito.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Manito/Manito.xcodeproj/project.pbxproj b/Manito/Manito.xcodeproj/project.pbxproj index 60a2388de..0b5278e95 100644 --- a/Manito/Manito.xcodeproj/project.pbxproj +++ b/Manito/Manito.xcodeproj/project.pbxproj @@ -1323,7 +1323,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2; + MARKETING_VERSION = 1.2.1; PRODUCT_BUNDLE_IDENTIFIER = com.TeamFirefighter.Manito; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1360,7 +1360,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2; + MARKETING_VERSION = 1.2.1; PRODUCT_BUNDLE_IDENTIFIER = com.TeamFirefighter.Manito; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; From d86bd5c19cead2304d9bdefd36c7ccdf23be37c6 Mon Sep 17 00:00:00 2001 From: Yoonah Shin Date: Tue, 28 Feb 2023 08:04:05 +0900 Subject: [PATCH 65/69] =?UTF-8?q?[DOCS]=20release.yml=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1=20=EB=B0=8F=20=EB=82=B4=EC=9A=A9=20?= =?UTF-8?q?=EA=B5=AC=EC=84=B1=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..cf874da80 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,25 @@ +# .github/release.yml + +changelog: + exclude: + labels: + - Main + authors: + - octocat + categories: + - title: 🆕 새로운 기능이 추가되었어요! + labels: + - ✨ Feature + - title: 🐞 자잘한 버그를 수정했습니다. + labels: + - 🐞 Bugfix + - title: 🫶🏻 앱 사용성 개선에 힘썼습니다. + labels: + - 🫶🏻 Improvement + - title: 🛠️ 더 나은 코드를 위해 노력하고 있습니다. + labels: + - 🔨 Refactor + - ⚙️ Setting + - title: Others + labels: + - "*" From 04ad2176c309a11450242908bda14daeaef354bf Mon Sep 17 00:00:00 2001 From: Yoonah Shin Date: Tue, 28 Feb 2023 08:19:19 +0900 Subject: [PATCH 66/69] =?UTF-8?q?[DOCS]=20release-drafter=20YAML=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=83=9D=EC=84=B1(#389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-drafter.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 000000000..9867c25e7 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,21 @@ +name: Release Drafter + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + config-name: release.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1f97d42ca3c24d3681da05af4b0f69b5578f8d32 Mon Sep 17 00:00:00 2001 From: Yoonah Shin Date: Tue, 28 Feb 2023 08:24:57 +0900 Subject: [PATCH 67/69] =?UTF-8?q?[CHORE]=20Github=20Token=EB=A5=BC=20Acces?= =?UTF-8?q?s=20Token=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD(#389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 9867c25e7..969f56c1f 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -18,4 +18,4 @@ jobs: with: config-name: release.yml env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} From a266148db1ec72f86463d4c8214834c28d923704 Mon Sep 17 00:00:00 2001 From: Yoonah Shin Date: Tue, 28 Feb 2023 09:00:10 +0900 Subject: [PATCH 68/69] =?UTF-8?q?[CHORE]=20release.yml=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20drafter=EC=97=90=20=EB=A7=9E=EC=B6=B0=EC=84=9C=20?= =?UTF-8?q?=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95(#389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.yml | 54 +++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index cf874da80..6e3497af4 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,25 +1,35 @@ # .github/release.yml -changelog: - exclude: +name-template: '애니또 v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: '🆕 새로운 기능이 추가되었어요!' + label: '✨ Feature' + - title: '🐞 자잘한 버그를 수정했습니다.' + label: '🐞 Bugfix' + - title: '🫶🏻 앱 사용성 개선에 힘썼습니다.' + label: '🫶🏻 Improvement' + - title: '🛠️ 더 나은 코드를 위해 노력하고 있습니다.' labels: - - Main - authors: - - octocat - categories: - - title: 🆕 새로운 기능이 추가되었어요! - labels: - - ✨ Feature - - title: 🐞 자잘한 버그를 수정했습니다. - labels: - - 🐞 Bugfix - - title: 🫶🏻 앱 사용성 개선에 힘썼습니다. - labels: - - 🫶🏻 Improvement - - title: 🛠️ 더 나은 코드를 위해 노력하고 있습니다. - labels: - - 🔨 Refactor - - ⚙️ Setting - - title: Others - labels: - - "*" + - '🔨 Refactor' + - '⚙️ Setting' + - title: 'ETC' + labels: + - "*" +change-template: '* $TITLE (#$NUMBER) by @$AUTHOR' +change-title-escapes: '\<*_&#@`' +exclude-labels: + - 'Main' +version-resolver: + major: + labels: + - 'Major' + minor: + labels: + - 'Minor' + patch: + labels: + - 'Patch' + default: patch +template: | + $CHANGES From 2d410fc24f168332ef1d4a4d2fe39593e84468df Mon Sep 17 00:00:00 2001 From: Yoonah Shin Date: Tue, 28 Feb 2023 12:31:49 +0900 Subject: [PATCH 69/69] =?UTF-8?q?[DEL]=20Main=20exclude=20label=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C(#389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 6e3497af4..65bf8baca 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -18,8 +18,6 @@ categories: - "*" change-template: '* $TITLE (#$NUMBER) by @$AUTHOR' change-title-escapes: '\<*_&#@`' -exclude-labels: - - 'Main' version-resolver: major: labels: