From 1cb84d91b3e38dedc0572e8614408434de10d7b4 Mon Sep 17 00:00:00 2001 From: Suyeon Date: Fri, 8 Nov 2024 16:55:54 +0900 Subject: [PATCH 01/13] =?UTF-8?q?Add:=20Checkmark=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=EC=BD=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Checkmark.imageset/Checkmark.png | Bin 0 -> 206 bytes .../Checkmark.imageset/Checkmark@2x.png | Bin 0 -> 258 bytes .../Checkmark.imageset/Checkmark@3x.png | Bin 0 -> 321 bytes .../Checkmark.imageset/Contents.json | 23 ++++++++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.png create mode 100644 pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png create mode 100644 pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@3x.png create mode 100644 pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Contents.json diff --git a/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.png b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark.png new file mode 100644 index 0000000000000000000000000000000000000000..b1f8f34d344d4cf2376cbfca22b0978bc6c379a5 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CJ!3HGRcAO0XaSA*liy0WWg+Z8+Vb&Z8pde#$ zkh>GZx^prwfgF}}M_)$E)e-c@N{A5oT$B+ufsplDa8x#as12P;~lq3#vm|akF zF>Vs6PdxjeqvQC-+nhB@=LOu9iWK$qxAT>8iv5Vb=Mi8S xs~4jrBki*^^dD!--axyGC6oGAPv7-}HT6W}fxh1FVnFK{JYD@<);T3K0RWilKb8Oh literal 0 HcmV?d00001 diff --git a/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png b/pochak/pochak/Resources/Assets.xcassets/Checkmark.imageset/Checkmark@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f5a5ca27cb3d159f487ea917990dc041c1e1dc49 GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^5{rmVTlu`V9lXu>x}LNwsx0H3m)1m zlkdwF$?Fp7zG=sCq&N#aB8wRq6fHoQ(RG?(0#J~# zILO_JVcj{Imp~3nx}&cn1H;CC?mvmFK>jsP7srqa#<$l3d7BLc*dEmLsWEbT%n&Zv zV9CIK=3s#lkkjJ1Bi31d*QI4k_QrlcFyBPw$-3`*9k~Al`mK;rvih9-=<0$ro|fxQ zW-CPHgQP#Ru55d_lmFJT_A40cXvyM9~DU%*4`h}pfp z%NSWtw%vGUcVP~zR+Gi-o}~(c9V{LqlNd@bv{}qPU+wtkpVW%EiZeN0Ji1z9-)?bu z-aUoS`dL>M%N{%vN^xw~QephG*+F}YocMZ)mTTQx Date: Fri, 8 Nov 2024 16:56:32 +0900 Subject: [PATCH 02/13] =?UTF-8?q?Feat:=20=EC=B2=B4=ED=81=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EB=B2=84=ED=8A=BC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pochak/pochak.xcodeproj/project.pbxproj | 10 ++- .../pochak/UI/Login/Views/CheckButton.swift | 63 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 pochak/pochak/UI/Login/Views/CheckButton.swift diff --git a/pochak/pochak.xcodeproj/project.pbxproj b/pochak/pochak.xcodeproj/project.pbxproj index 18fcc3e7..95674f1a 100644 --- a/pochak/pochak.xcodeproj/project.pbxproj +++ b/pochak/pochak.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ @@ -470,6 +470,10 @@ F9A6AE07B1A942C2FFC48F28 /* Pods-pochak-pochakUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-pochak-pochakUITests.release.xcconfig"; path = "Target Support Files/Pods-pochak-pochakUITests/Pods-pochak-pochakUITests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 082638162CDDEDE000EE1521 /* Views */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Views; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ EA1B0B542A49D23A00F86FBC /* Frameworks */ = { isa = PBXFrameworksBuildPhase; @@ -853,6 +857,7 @@ 373815142A89E6BE0032066A /* Login */ = { isa = PBXGroup; children = ( + 082638162CDDEDE000EE1521 /* Views */, EAAACDB42A5168280041B1B9 /* Login.storyboard */, 373815152A89E6D30032066A /* SocialJoinViewController.swift */, 3766F4122C3A69E5001DD239 /* TermsOfAgreeViewController.swift */, @@ -1373,6 +1378,9 @@ ); dependencies = ( ); + fileSystemSynchronizedGroups = ( + 082638162CDDEDE000EE1521 /* Views */, + ); name = pochak; productName = pochak; productReference = EA1B0B572A49D23A00F86FBC /* pochak.app */; diff --git a/pochak/pochak/UI/Login/Views/CheckButton.swift b/pochak/pochak/UI/Login/Views/CheckButton.swift new file mode 100644 index 00000000..f9a557e5 --- /dev/null +++ b/pochak/pochak/UI/Login/Views/CheckButton.swift @@ -0,0 +1,63 @@ +// +// CheckButton.swift +// pochak +// +// Created by Suyeon Hwang on 11/8/24. +// + +import UIKit + +final class CheckButton: UIButton { + + var isChecked: Bool = false { + didSet { + updateButtonConfiguration() + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + + initButton() + +// if isSelected { +// self.layer.backgroundColor = UIColor(named: "yellow00")?.cgColor +// self.layer.borderColor = nil +// print("isSelected") +// } +// else { +// self.layer.borderWidth = 1.2 +// self.layer.borderColor = UIColor(named: "gray03")?.cgColor +// self.layer.backgroundColor = nil +// print("is not selected") +// } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Functions + + private func initButton() { + self.isEnabled = true + self.clipsToBounds = true + self.layer.cornerRadius = 10 + updateButtonConfiguration() + } + + private func updateButtonConfiguration() { + self.isSelected = isChecked + self.layer.borderWidth = isChecked ? 0 : 1.2 + self.layer.borderColor = isChecked ? nil : UIColor(named: "gray03")?.cgColor + self.layer.backgroundColor = isChecked ? UIColor(named: "yellow00")?.cgColor : nil + + if isChecked { + self.setImage(UIImage(named: "Checkmark"), for: .normal) + self.imageView?.contentMode = .scaleAspectFit + } + else { + self.setImage(nil, for: .normal) + } + } +} From 81a9f09a2d24926f355db8a63cefb60247b727b3 Mon Sep 17 00:00:00 2001 From: Suyeon Date: Fri, 8 Nov 2024 16:57:11 +0900 Subject: [PATCH 03/13] =?UTF-8?q?Feat:=20=EC=B2=B4=ED=81=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EB=B2=84=ED=8A=BC=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pochak/UI/Login/Views/CheckButton.swift | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 pochak/pochak/UI/Login/Views/CheckButton.swift diff --git a/pochak/pochak/UI/Login/Views/CheckButton.swift b/pochak/pochak/UI/Login/Views/CheckButton.swift new file mode 100644 index 00000000..f9a557e5 --- /dev/null +++ b/pochak/pochak/UI/Login/Views/CheckButton.swift @@ -0,0 +1,63 @@ +// +// CheckButton.swift +// pochak +// +// Created by Suyeon Hwang on 11/8/24. +// + +import UIKit + +final class CheckButton: UIButton { + + var isChecked: Bool = false { + didSet { + updateButtonConfiguration() + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + + initButton() + +// if isSelected { +// self.layer.backgroundColor = UIColor(named: "yellow00")?.cgColor +// self.layer.borderColor = nil +// print("isSelected") +// } +// else { +// self.layer.borderWidth = 1.2 +// self.layer.borderColor = UIColor(named: "gray03")?.cgColor +// self.layer.backgroundColor = nil +// print("is not selected") +// } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Functions + + private func initButton() { + self.isEnabled = true + self.clipsToBounds = true + self.layer.cornerRadius = 10 + updateButtonConfiguration() + } + + private func updateButtonConfiguration() { + self.isSelected = isChecked + self.layer.borderWidth = isChecked ? 0 : 1.2 + self.layer.borderColor = isChecked ? nil : UIColor(named: "gray03")?.cgColor + self.layer.backgroundColor = isChecked ? UIColor(named: "yellow00")?.cgColor : nil + + if isChecked { + self.setImage(UIImage(named: "Checkmark"), for: .normal) + self.imageView?.contentMode = .scaleAspectFit + } + else { + self.setImage(nil, for: .normal) + } + } +} From 2956078ecc4f404f413f30e217fc70683c52c4e7 Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 16:37:41 +0900 Subject: [PATCH 04/13] =?UTF-8?q?Feat:=20UILabel=20=EB=82=B4=EC=9D=98=20?= =?UTF-8?q?=ED=8A=B9=EC=A0=95=20=EB=AC=B8=EC=9E=90=EC=97=B4=EC=9D=98=20CGR?= =?UTF-8?q?ect=EB=A5=BC=20=EB=B0=98=ED=99=98=ED=95=98=EB=8A=94=20extension?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pochak/Global/Extensions/UILabel+.swift | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/pochak/pochak/Global/Extensions/UILabel+.swift b/pochak/pochak/Global/Extensions/UILabel+.swift index 79b93fb3..8ab0f122 100644 --- a/pochak/pochak/Global/Extensions/UILabel+.swift +++ b/pochak/pochak/Global/Extensions/UILabel+.swift @@ -23,4 +23,42 @@ extension UILabel { attributedText = attributeString } } + + /// UILabel 내의 특정 문자열의 CGRect를 반환하는 메소드 + /// - Parameter subText: CGRect값을 알고 싶은 특정 문자열 + /// - Returns: 해당 문자열의 CGRect + func boundingRectForCharacterRange(subText: String) -> CGRect? { + guard let attributedText = attributedText else { return nil } + guard let text = self.text else { return nil } + + guard let subRange = text.range(of: subText) else { return nil } + let range = NSRange(subRange, in: text) + + // attributedText를 기반으로 한 NSTextStorage를 선언하고 NSLayoutManager를 추가 + let layoutManager = NSLayoutManager() + let textStorage = NSTextStorage(attributedString: attributedText) + textStorage.addLayoutManager(layoutManager) + + // instrinsicContentSize를 기반으로 NSTextContainer를 선언 + let textContainer = NSTextContainer(size: intrinsicContentSize) + + // 정확한 CGRect를 구해야하므로 padding 값은 0 + textContainer.lineFragmentPadding = 0.0 + + // layoutManager에 추가 + layoutManager.addTextContainer(textContainer) + var glyphRange = NSRange() + + // 주어진 범위(rage)에 대한 실질적인 glyphRange 구하기 + layoutManager.characterRange( + forGlyphRange: range, + actualGlyphRange: &glyphRange + ) + + // textContainer 내의 지정된 glyphRange에 대한 CGRect 값 반환 + return layoutManager.boundingRect( + forGlyphRange: glyphRange, + in: textContainer + ) + } } From 973be322f7ef3b5412b50afb88231a897866fee5 Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 17:31:36 +0900 Subject: [PATCH 05/13] =?UTF-8?q?Feat:=20'=EB=8B=A4=EC=9D=8C'=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=BB=A4=EC=8A=A4=ED=85=80=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pochak/pochak/UI/Login/Views/NextButton.swift | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 pochak/pochak/UI/Login/Views/NextButton.swift diff --git a/pochak/pochak/UI/Login/Views/NextButton.swift b/pochak/pochak/UI/Login/Views/NextButton.swift new file mode 100644 index 00000000..6866215b --- /dev/null +++ b/pochak/pochak/UI/Login/Views/NextButton.swift @@ -0,0 +1,61 @@ +// +// NextButton.swift +// pochak +// +// Created by Suyeon Hwang on 11/10/24. +// + +import UIKit + +final class NextButton: UIButton { + + // MARK: - Properties + + var isActive: Bool = false { + didSet { + setNeedsUpdateConfiguration() + } + } + + // MARK: - Initialization + + init(_ title: String = "다음", _ font: UIFont = UIFont(name: "Pretendard-Bold", size: 16)!) { + super.init(frame: .zero) + + var config = UIButton.Configuration.filled() + config.contentInsets = .init(top: 13, leading: 0, bottom: 13, trailing: 0) + config.attributedTitle = AttributedString(title) + config.attributedTitle?.setAttributes(AttributeContainer([NSAttributedString.Key.font: font])) + self.configuration = config + + let buttonStateHandler: UIButton.ConfigurationUpdateHandler = { button in + switch self.isActive { + case true: + self.isEnabled = true + button.configuration?.background.backgroundColor = UIColor(named: "yellow00") + //button.configuration?.baseForegroundColor = .white + button.configuration?.attributedTitle?.setAttributes(AttributeContainer([NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.font: font])) + case false: + self.isEnabled = false + button.configuration?.background.backgroundColor = UIColor(named: "gray03") + //button.configuration?.baseForegroundColor = UIColor(hexCode: "D2C2FF") + button.configuration?.attributedTitle?.setAttributes(AttributeContainer([NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.font: font])) + } + } + + self.configurationUpdateHandler = buttonStateHandler + setupButton() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Functions + + private func setupButton() { + self.clipsToBounds = true + self.layer.cornerRadius = 10 + self.isEnabled = false // 초기 상태 + } +} From 9e9b1542a0565c295265e9215499bf4f78a7bedc Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 17:32:01 +0900 Subject: [PATCH 06/13] =?UTF-8?q?Feat:=20=EA=B0=9C=EC=9D=B8=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=B0=8F=20=EC=9D=B4=EC=9A=A9=EC=95=BD=EA=B4=80=20?= =?UTF-8?q?=EB=8F=99=EC=9D=98=20=ED=8E=98=EC=9D=B4=EC=A7=80=20UI=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Login/TermsOfAgreeViewController.swift | 395 +++++++++++++++--- 1 file changed, 341 insertions(+), 54 deletions(-) diff --git a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift index 4695cfb4..9c1b53f5 100644 --- a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift +++ b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift @@ -8,8 +8,86 @@ import UIKit import SafariServices -class TermsOfAgreeViewController: UIViewController, UIViewControllerTransitioningDelegate { - +final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransitioningDelegate { + + // MARK: - Properties + + var didAgreeForPrivacyPolicy: Bool = false { + didSet { + + } + } + var didAgreeForTermsOfUse: Bool = false + var delegate: SendDelegate? + + // MARK: - Views + + private let pochakLetterLogoImageView: UIImageView = { + let view = UIImageView() + view.image = UIImage(named: "logo_full") + return view + }() + + private let guideLabel: UILabel = { + let label = UILabel() + label.text = "서비스 이용을 위해\n이용약관 동의가 필요합니다." + label.font = UIFont(name: "Pretendard-Bold", size: 26) + label.numberOfLines = 2 + return label + }() + + private let agreeToAllLabel: UILabel = { + let label = UILabel() + label.text = "약관 전체 동의" + label.font = UIFont(name: "Pretendard-Bold", size: 20) + return label + }() + + private let agreeToAllButton: CheckButton = { + let button = CheckButton() + button.addTarget(self, action: #selector(agreeToAllButtonDidTap), for: .touchUpInside) + button.isChecked = false + return button + }() + + private let borderLine: UIView = { + let view = UIView() + view.backgroundColor = UIColor(named: "gray00") + return view + }() + + private let termsOfUseAgreeLabel: UILabel = { + let label = UILabel() + label.isUserInteractionEnabled = true + return label + }() + + private let termsOfUseAgreeButton: CheckButton = { + let button = CheckButton() + button.addTarget(self, action: #selector(termsOfUseAgreeButtonDidTap), for: .touchUpInside) + button.isChecked = false + return button + }() + + private let privacyPolicyAgreeLabel: UILabel = { + let label = UILabel() + label.isUserInteractionEnabled = true + return label + }() + + private let privacyPolicyAgreeButton: CheckButton = { + let button = CheckButton() + button.addTarget(self, action: #selector(privacyPolicyAgreeButtonDidTap), for: .touchUpInside) + button.isChecked = false + return button + }() + + private let nextButton: NextButton = { + let button = NextButton() + button.isActive = false + return button + }() + @IBOutlet weak var pochakLabel: UILabel! @IBOutlet weak var pochakCorpLabel: UILabel! @IBOutlet weak var titleLabel: UILabel! @@ -22,49 +100,69 @@ class TermsOfAgreeViewController: UIViewController, UIViewControllerTransitionin @IBOutlet weak var backgroundView: UIView! - - var didAgreeForPrivacyPolicy : Bool = false - var didAgreeForTermsOfUse : Bool = false - var delegate : SendDelegate? - + // MARK: - Lifecycle override func viewDidLoad() { super.viewDidLoad() - backgroundView.layer.cornerRadius = 8 - appIcon.layer.cornerRadius = 5 - agreeAndContinueButton.layer.cornerRadius = 5 - seePrivacyPolicy.setUnderline() - seeTermsOfUse.setUnderline() - - pochakLabel.text = "Pochak" - pochakLabel.font = UIFont(name: "Pretendard-SemiBold", size: 20) - pochakLabel.textColor = .black - - pochakCorpLabel.text = "Pochak Corp." - pochakCorpLabel.font = UIFont(name: "Pretendard-Light", size: 16) - pochakCorpLabel.textColor = UIColor(named: "gray04") - - titleLabel.text = "개인정보 및 이용약관 동의 항목" - titleLabel.font = UIFont(name: "Pretendard-SemiBold", size: 18) - titleLabel.textColor = .black - - - agreeForPrivacyPolicy.setTitle(" [필수] 개인정보 제3자 제공 동의", for: .normal) - agreeForPrivacyPolicy.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) - agreeForPrivacyPolicy.titleLabel?.font = UIFont(name: "Pretendard-Medium", size: 15) - agreeForPrivacyPolicy.setTitleColor(UIColor(named: "gray04"), for: .normal) - agreeForPrivacyPolicy.tintColor = UIColor(named: "gray04") - - agreeForTermsOfUSe.setTitle(" [필수] 이용약관 항목", for: .normal) - agreeForTermsOfUSe.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) - agreeForTermsOfUSe.titleLabel?.font = UIFont(name: "Pretendard-Medium", size: 15) - agreeForTermsOfUSe.setTitleColor(UIColor(named: "gray04"), for: .normal) - agreeForTermsOfUSe.tintColor = UIColor(named: "gray04") + view.backgroundColor = .white + + setupPochakLogoImageView() + setupGuideLabel() + setupAgreeToAllLabel() + setupAgreeToAllButton() + setupBorderLine() + setupTermsOfUseAgreeLabel() + setupTermsOfUseAgreeButton() + setupPrivacyPolicyAgreeLabel() + setupPrivacyPolicyAgreeButton() + setupNextButton() + +// backgroundView.layer.cornerRadius = 8 +// appIcon.layer.cornerRadius = 5 +// agreeAndContinueButton.layer.cornerRadius = 5 +// seePrivacyPolicy.setUnderline() +// seeTermsOfUse.setUnderline() +// +// pochakLabel.text = "Pochak" +// pochakLabel.font = UIFont(name: "Pretendard-SemiBold", size: 20) +// pochakLabel.textColor = .black +// +// pochakCorpLabel.text = "Pochak Corp." +// pochakCorpLabel.font = UIFont(name: "Pretendard-Light", size: 16) +// pochakCorpLabel.textColor = UIColor(named: "gray04") +// +// titleLabel.text = "개인정보 및 이용약관 동의 항목" +// titleLabel.font = UIFont(name: "Pretendard-SemiBold", size: 18) +// titleLabel.textColor = .black +// +// +// agreeForPrivacyPolicy.setTitle(" [필수] 개인정보 제3자 제공 동의", for: .normal) +// agreeForPrivacyPolicy.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) +// agreeForPrivacyPolicy.titleLabel?.font = UIFont(name: "Pretendard-Medium", size: 15) +// agreeForPrivacyPolicy.setTitleColor(UIColor(named: "gray04"), for: .normal) +// agreeForPrivacyPolicy.tintColor = UIColor(named: "gray04") +// +// +// agreeForTermsOfUSe.setTitle(" [필수] 이용약관 항목", for: .normal) +// agreeForTermsOfUSe.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) +// agreeForTermsOfUSe.titleLabel?.font = UIFont(name: "Pretendard-Medium", size: 15) +// agreeForTermsOfUSe.setTitleColor(UIColor(named: "gray04"), for: .normal) +// agreeForTermsOfUSe.tintColor = UIColor(named: "gray04") // Do any additional setup after loading the view. } + // MARK: - Actions + + @objc private func termsOfUseAgreeButtonDidTap() { + print("이용약관 선택됨") + print(termsOfUseAgreeButton.isSelected) + termsOfUseAgreeButton.isChecked.toggle() + + print(termsOfUseAgreeButton.isSelected) + } + @IBAction func pressAgreeForPrivacyPolicy(_ sender: Any) { if !didAgreeForPrivacyPolicy { didAgreeForPrivacyPolicy = true @@ -80,6 +178,14 @@ class TermsOfAgreeViewController: UIViewController, UIViewControllerTransitionin } + @objc private func privacyPolicyAgreeButtonDidTap() { + print("개인정보 동의 선택됨") + print(privacyPolicyAgreeButton.isSelected) + privacyPolicyAgreeButton.isChecked.toggle() + + print(privacyPolicyAgreeButton.isSelected) + } + @IBAction func pressAgreeForTermsOfUSe(_ sender: Any) { if !didAgreeForTermsOfUse { didAgreeForTermsOfUse = true @@ -94,26 +200,31 @@ class TermsOfAgreeViewController: UIViewController, UIViewControllerTransitionin } } - - @IBAction func openPrivacyPolicy(_ sender: Any) { - guard let url = URL(string: "https://pochak.notion.site/e365e34f018949b88543adbe6b0b3746") else { return } - let safariVC = SFSafariViewController(url: url) - // delegate 지정 및 presentation style 설정. - safariVC.transitioningDelegate = self - safariVC.modalPresentationStyle = .pageSheet + @objc private func termsOfUseLabelDidTap(_ sender: UITapGestureRecognizer) { + // termsOfUseAgreeLabel에서 선택된 부분의 CGPoint 구하기 + let point = sender.location(in: termsOfUseAgreeLabel) + + if let rect = termsOfUseAgreeLabel.boundingRectForCharacterRange(subText: "이용약관"), rect.contains(point) { + guard let url = URL(string: "https://pochak.notion.site/6520996186464c36a8b3a04bc17fa000?pvs=74") else { return } + let safariVC = SFSafariViewController(url: url) + safariVC.transitioningDelegate = self + safariVC.modalPresentationStyle = .pageSheet - present(safariVC, animated: true, completion: nil) + present(safariVC, animated: true, completion: nil) + } } - - @IBAction func openTermsOfUSe(_ sender: Any) { - guard let url = URL(string: "https://pochak.notion.site/6520996186464c36a8b3a04bc17fa000?pvs=74") else { return } - let safariVC = SFSafariViewController(url: url) - // delegate 지정 및 presentation style 설정. - safariVC.transitioningDelegate = self - safariVC.modalPresentationStyle = .pageSheet - - present(safariVC, animated: true, completion: nil) + @objc private func privacyPolicyLabelDidTap(_ sender: UITapGestureRecognizer) { + // privacyPolicyAgreeLabel에서 선택된 부분의 CGPoint 구하기 + let point = sender.location(in: privacyPolicyAgreeLabel) + + if let rect = privacyPolicyAgreeLabel.boundingRectForCharacterRange(subText: "개인정보 수집 및 제공"), rect.contains(point) { + guard let url = URL(string: "https://pochak.notion.site/e365e34f018949b88543adbe6b0b3746") else { return } + let safariVC = SFSafariViewController(url: url) + safariVC.transitioningDelegate = self + safariVC.modalPresentationStyle = .pageSheet + present(safariVC, animated: true, completion: nil) + } } @IBAction func agreeAndContinue(_ sender: Any) { @@ -124,7 +235,183 @@ class TermsOfAgreeViewController: UIViewController, UIViewControllerTransitionin print("not agreed yet") } } + + @objc private func agreeToAllButtonDidTap() { + print("전체 동의 눌림") + print(agreeToAllButton.isSelected) + agreeToAllButton.isChecked.toggle() + + print(agreeToAllButton.isSelected) + } + + // MARK: - Layout + + private func setupPochakLogoImageView() { + view.addSubview(pochakLetterLogoImageView) + + pochakLetterLogoImageView.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + pochakLetterLogoImageView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 44), + pochakLetterLogoImageView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 20), + ]) + } + + private func setupGuideLabel() { + view.addSubview(guideLabel) + + guideLabel.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + guideLabel.leadingAnchor.constraint(equalTo: pochakLetterLogoImageView.leadingAnchor), + guideLabel.topAnchor.constraint(equalTo: pochakLetterLogoImageView.bottomAnchor, constant: 8), + + ]) + } + + private func setupAgreeToAllLabel() { + view.addSubview(agreeToAllLabel) + + agreeToAllLabel.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + agreeToAllLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 26), + agreeToAllLabel.topAnchor.constraint(equalTo: guideLabel.bottomAnchor, constant: 127), + ]) + } + + private func setupAgreeToAllButton() { + view.addSubview(agreeToAllButton) + + agreeToAllButton.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + agreeToAllButton.widthAnchor.constraint(equalToConstant: 20), + agreeToAllButton.heightAnchor.constraint(equalTo: agreeToAllButton.widthAnchor, multiplier: 1), + agreeToAllButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -24), + agreeToAllButton.centerYAnchor.constraint(equalTo: agreeToAllLabel.centerYAnchor) + ]) + } + + private func setupBorderLine() { + view.addSubview(borderLine) + + borderLine.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + borderLine.heightAnchor.constraint(equalToConstant: 1), + borderLine.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 20), + borderLine.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -20), + borderLine.topAnchor.constraint(equalTo: agreeToAllLabel.bottomAnchor, constant: 13) + ]) + } + + private func setupTermsOfUseAgreeLabel() { + view.addSubview(termsOfUseAgreeLabel) + + termsOfUseAgreeLabel.translatesAutoresizingMaskIntoConstraints = false + + configureUnderlineAttributes(linkText: "이용약관", + generalText: String(format: "[필수] %@ 동의", "이용약관"), + label: termsOfUseAgreeLabel) + + let recognizer = UITapGestureRecognizer(target: self, action: #selector(termsOfUseLabelDidTap(_: ))) + termsOfUseAgreeLabel.addGestureRecognizer(recognizer) + + NSLayoutConstraint.activate([ + termsOfUseAgreeLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 22), + termsOfUseAgreeLabel.topAnchor.constraint(equalTo: borderLine.bottomAnchor, constant: 17) + ]) + } + + private func setupTermsOfUseAgreeButton() { + view.addSubview(termsOfUseAgreeButton) + + termsOfUseAgreeButton.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + termsOfUseAgreeButton.trailingAnchor.constraint(equalTo: agreeToAllButton.trailingAnchor), + termsOfUseAgreeButton.centerYAnchor.constraint(equalTo: termsOfUseAgreeLabel.centerYAnchor), + termsOfUseAgreeButton.widthAnchor.constraint(equalToConstant: 20), + termsOfUseAgreeButton.heightAnchor.constraint(equalTo: termsOfUseAgreeButton.widthAnchor, multiplier: 1) + ]) + } + + private func setupPrivacyPolicyAgreeLabel() { + view.addSubview(privacyPolicyAgreeLabel) + + privacyPolicyAgreeLabel.translatesAutoresizingMaskIntoConstraints = false + + configureUnderlineAttributes(linkText: "개인정보 수집 및 제공", + generalText: String(format: "[필수] %@ 동의", "개인정보 수집 및 제공"), + label: privacyPolicyAgreeLabel) + + let recognizer = UITapGestureRecognizer(target: self, action: #selector(privacyPolicyLabelDidTap(_: ))) + privacyPolicyAgreeLabel.addGestureRecognizer(recognizer) + + NSLayoutConstraint.activate([ + privacyPolicyAgreeLabel.leadingAnchor.constraint(equalTo: termsOfUseAgreeLabel.leadingAnchor), + privacyPolicyAgreeLabel.topAnchor.constraint(equalTo: termsOfUseAgreeLabel.bottomAnchor, constant: 16) + ]) + } + + private func setupPrivacyPolicyAgreeButton() { + view.addSubview(privacyPolicyAgreeButton) + + privacyPolicyAgreeButton.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + privacyPolicyAgreeButton.trailingAnchor.constraint(equalTo: termsOfUseAgreeButton.trailingAnchor), + privacyPolicyAgreeButton.centerYAnchor.constraint(equalTo: privacyPolicyAgreeLabel.centerYAnchor), + privacyPolicyAgreeButton.widthAnchor.constraint(equalToConstant: 20), + privacyPolicyAgreeButton.heightAnchor.constraint(equalTo: privacyPolicyAgreeButton.widthAnchor, multiplier: 1) + ]) + } + + private func setupNextButton() { + view.addSubview(nextButton) + + nextButton.translatesAutoresizingMaskIntoConstraints = false + + NSLayoutConstraint.activate([ + nextButton.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 20), + nextButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -20), + nextButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16), + nextButton.heightAnchor.constraint(equalToConstant: 48) + ]) + } + + // MARK: - Functions + + private func configureUnderlineAttributes(linkText: String, generalText: String, label: UILabel) { + let generalFont = UIFont(name: "Pretendard-Medium", size: 16) + + // NSAttributedString.Key, Value 속성 정의 + let generalAttributes: [NSAttributedString.Key: Any] = [ + .foregroundColor: UIColor(named: "gray05"), + .font: generalFont + ] + let linkAttributes: [NSAttributedString.Key: Any] = [ + .underlineStyle: NSUnderlineStyle.single.rawValue, + .foregroundColor: UIColor(named: "gray05"), + .font: generalFont + ] + + let mutableString = NSMutableAttributedString() + // generalAttributes(기본 스타일) 적용 + mutableString.append( + NSAttributedString(string: generalText, attributes: generalAttributes) + ) + + // 각 문자열의 range에 linkAttributes 적용 + mutableString.setAttributes( + linkAttributes, + range: (generalText as NSString).range(of: linkText) + ) + + label.attributedText = mutableString + } } extension UIButton { From 7359d619d118db63ee16d1c10bf86b333f6d1b9c Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 17:56:54 +0900 Subject: [PATCH 07/13] =?UTF-8?q?Feat:=20=EC=A0=84=EC=B2=B4=20=EB=8F=99?= =?UTF-8?q?=EC=9D=98,=20=EB=B6=80=EB=B6=84=20=EB=8F=99=EC=9D=98,=20?= =?UTF-8?q?=EB=8B=A4=EC=9D=8C=20=EB=B2=84=ED=8A=BC=20=ED=99=9C=EC=84=B1?= =?UTF-8?q?=ED=99=94=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Login/TermsOfAgreeViewController.swift | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift index 9c1b53f5..655eb61b 100644 --- a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift +++ b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift @@ -12,12 +12,30 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi // MARK: - Properties + var didAgreeForAll: Bool = false { + didSet { + if didAgreeForAll { + agreeToAllButton.isChecked = true + nextButton.isActive = true + } + else { + agreeToAllButton.isChecked = false + nextButton.isActive = false + } + } + } + var didAgreeForPrivacyPolicy: Bool = false { didSet { - + privacyPolicyAgreeButton.isChecked = didAgreeForPrivacyPolicy + } + } + + var didAgreeForTermsOfUse: Bool = false { + didSet { + termsOfUseAgreeButton.isChecked = didAgreeForTermsOfUse } } - var didAgreeForTermsOfUse: Bool = false var delegate: SendDelegate? // MARK: - Views @@ -157,10 +175,9 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi @objc private func termsOfUseAgreeButtonDidTap() { print("이용약관 선택됨") - print(termsOfUseAgreeButton.isSelected) termsOfUseAgreeButton.isChecked.toggle() - - print(termsOfUseAgreeButton.isSelected) + didAgreeForTermsOfUse = termsOfUseAgreeButton.isChecked + checkEachAgreeStatus() } @IBAction func pressAgreeForPrivacyPolicy(_ sender: Any) { @@ -180,10 +197,9 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi @objc private func privacyPolicyAgreeButtonDidTap() { print("개인정보 동의 선택됨") - print(privacyPolicyAgreeButton.isSelected) privacyPolicyAgreeButton.isChecked.toggle() - - print(privacyPolicyAgreeButton.isSelected) + didAgreeForPrivacyPolicy = privacyPolicyAgreeButton.isChecked + checkEachAgreeStatus() } @IBAction func pressAgreeForTermsOfUSe(_ sender: Any) { @@ -238,10 +254,9 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi @objc private func agreeToAllButtonDidTap() { print("전체 동의 눌림") - print(agreeToAllButton.isSelected) agreeToAllButton.isChecked.toggle() - - print(agreeToAllButton.isSelected) + didAgreeForAll = agreeToAllButton.isChecked + changeAllAgreeStatus() } // MARK: - Layout @@ -412,6 +427,15 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi label.attributedText = mutableString } + + private func changeAllAgreeStatus() { + didAgreeForTermsOfUse = didAgreeForAll + didAgreeForPrivacyPolicy = didAgreeForAll + } + + private func checkEachAgreeStatus() { + didAgreeForAll = didAgreeForTermsOfUse && didAgreeForPrivacyPolicy + } } extension UIButton { From 0c958b9cc85ea47428954230dcd6fb0f974e74dd Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 18:00:21 +0900 Subject: [PATCH 08/13] =?UTF-8?q?Feat:=20'=EB=8B=A4=EC=9D=8C'=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=95=A1=EC=85=98=20=ED=95=A8=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pochak/pochak/UI/Login/TermsOfAgreeViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift index 655eb61b..b1303aa6 100644 --- a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift +++ b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift @@ -103,6 +103,7 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi private let nextButton: NextButton = { let button = NextButton() button.isActive = false + button.addTarget(self, action: #selector(nextButtonDidTap), for: .touchUpInside) return button }() @@ -259,6 +260,13 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi changeAllAgreeStatus() } + @objc private func nextButtonDidTap() { + if didAgreeForAll { + self.dismiss(animated: true) + delegate?.sendAgreed(agree: true) + } + } + // MARK: - Layout private func setupPochakLogoImageView() { From c94c7b907a286155709c644c3fcfa7fdb31ee3c5 Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 18:02:09 +0900 Subject: [PATCH 09/13] =?UTF-8?q?Chore:=20=EC=9D=B4=EC=A0=84=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Login/TermsOfAgreeViewController.swift | 84 ------------------- 1 file changed, 84 deletions(-) diff --git a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift index b1303aa6..7d96934b 100644 --- a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift +++ b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift @@ -107,18 +107,6 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi return button }() - @IBOutlet weak var pochakLabel: UILabel! - @IBOutlet weak var pochakCorpLabel: UILabel! - @IBOutlet weak var titleLabel: UILabel! - @IBOutlet weak var appIcon: UIImageView! - @IBOutlet weak var agreeForPrivacyPolicy: UIButton! - @IBOutlet weak var agreeForTermsOfUSe: UIButton! - @IBOutlet weak var seePrivacyPolicy: UIButton! - @IBOutlet weak var seeTermsOfUse: UIButton! - @IBOutlet weak var agreeAndContinueButton: UIButton! - - @IBOutlet weak var backgroundView: UIView! - // MARK: - Lifecycle override func viewDidLoad() { @@ -136,40 +124,6 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi setupPrivacyPolicyAgreeLabel() setupPrivacyPolicyAgreeButton() setupNextButton() - -// backgroundView.layer.cornerRadius = 8 -// appIcon.layer.cornerRadius = 5 -// agreeAndContinueButton.layer.cornerRadius = 5 -// seePrivacyPolicy.setUnderline() -// seeTermsOfUse.setUnderline() -// -// pochakLabel.text = "Pochak" -// pochakLabel.font = UIFont(name: "Pretendard-SemiBold", size: 20) -// pochakLabel.textColor = .black -// -// pochakCorpLabel.text = "Pochak Corp." -// pochakCorpLabel.font = UIFont(name: "Pretendard-Light", size: 16) -// pochakCorpLabel.textColor = UIColor(named: "gray04") -// -// titleLabel.text = "개인정보 및 이용약관 동의 항목" -// titleLabel.font = UIFont(name: "Pretendard-SemiBold", size: 18) -// titleLabel.textColor = .black -// -// -// agreeForPrivacyPolicy.setTitle(" [필수] 개인정보 제3자 제공 동의", for: .normal) -// agreeForPrivacyPolicy.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) -// agreeForPrivacyPolicy.titleLabel?.font = UIFont(name: "Pretendard-Medium", size: 15) -// agreeForPrivacyPolicy.setTitleColor(UIColor(named: "gray04"), for: .normal) -// agreeForPrivacyPolicy.tintColor = UIColor(named: "gray04") -// -// -// agreeForTermsOfUSe.setTitle(" [필수] 이용약관 항목", for: .normal) -// agreeForTermsOfUSe.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) -// agreeForTermsOfUSe.titleLabel?.font = UIFont(name: "Pretendard-Medium", size: 15) -// agreeForTermsOfUSe.setTitleColor(UIColor(named: "gray04"), for: .normal) -// agreeForTermsOfUSe.tintColor = UIColor(named: "gray04") - - // Do any additional setup after loading the view. } // MARK: - Actions @@ -181,21 +135,6 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi checkEachAgreeStatus() } - @IBAction func pressAgreeForPrivacyPolicy(_ sender: Any) { - if !didAgreeForPrivacyPolicy { - didAgreeForPrivacyPolicy = true - agreeForPrivacyPolicy.setTitleColor(UIColor.black, for: .normal) - agreeForPrivacyPolicy.setImage(UIImage(systemName: "checkmark.circle.fill"), for: .normal) - agreeForPrivacyPolicy.tintColor = UIColor.black - } else if didAgreeForPrivacyPolicy { - didAgreeForPrivacyPolicy = false - agreeForPrivacyPolicy.setTitleColor(UIColor(named: "gray04"), for: .normal) - agreeForPrivacyPolicy.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) - agreeForPrivacyPolicy.tintColor = UIColor(named: "gray04") - } - - } - @objc private func privacyPolicyAgreeButtonDidTap() { print("개인정보 동의 선택됨") privacyPolicyAgreeButton.isChecked.toggle() @@ -203,20 +142,6 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi checkEachAgreeStatus() } - @IBAction func pressAgreeForTermsOfUSe(_ sender: Any) { - if !didAgreeForTermsOfUse { - didAgreeForTermsOfUse = true - agreeForTermsOfUSe.setTitleColor(UIColor.black, for: .normal) - agreeForTermsOfUSe.setImage(UIImage(systemName: "checkmark.circle.fill"), for: .normal) - agreeForTermsOfUSe.tintColor = UIColor.black - } else if didAgreeForTermsOfUse { - didAgreeForTermsOfUse = false - agreeForTermsOfUSe.setTitleColor(UIColor(named: "gray04"), for: .normal) - agreeForTermsOfUSe.setImage(UIImage(systemName: "checkmark.circle"), for: .normal) - agreeForTermsOfUSe.tintColor = UIColor(named: "gray04") - } - } - @objc private func termsOfUseLabelDidTap(_ sender: UITapGestureRecognizer) { // termsOfUseAgreeLabel에서 선택된 부분의 CGPoint 구하기 let point = sender.location(in: termsOfUseAgreeLabel) @@ -244,15 +169,6 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi } } - @IBAction func agreeAndContinue(_ sender: Any) { - if didAgreeForPrivacyPolicy && didAgreeForTermsOfUse { - self.dismiss(animated: true) - delegate?.sendAgreed(agree: true) - } else { - print("not agreed yet") - } - } - @objc private func agreeToAllButtonDidTap() { print("전체 동의 눌림") agreeToAllButton.isChecked.toggle() From a51533d94c8bbc68f4235b72e49d26fc44137cc3 Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 18:03:58 +0900 Subject: [PATCH 10/13] =?UTF-8?q?Feat:=20=EB=B3=80=EC=88=98=20private?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=84=A0=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pochak/pochak/UI/Login/TermsOfAgreeViewController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift index 7d96934b..1500945b 100644 --- a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift +++ b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift @@ -12,7 +12,7 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi // MARK: - Properties - var didAgreeForAll: Bool = false { + private var didAgreeForAll: Bool = false { didSet { if didAgreeForAll { agreeToAllButton.isChecked = true @@ -25,17 +25,18 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi } } - var didAgreeForPrivacyPolicy: Bool = false { + private var didAgreeForPrivacyPolicy: Bool = false { didSet { privacyPolicyAgreeButton.isChecked = didAgreeForPrivacyPolicy } } - var didAgreeForTermsOfUse: Bool = false { + private var didAgreeForTermsOfUse: Bool = false { didSet { termsOfUseAgreeButton.isChecked = didAgreeForTermsOfUse } } + var delegate: SendDelegate? // MARK: - Views From 28408bcb928ceded03b06f44665ce2411064ec0e Mon Sep 17 00:00:00 2001 From: Suyeon Date: Sun, 10 Nov 2024 18:05:32 +0900 Subject: [PATCH 11/13] =?UTF-8?q?Feat:=20=EC=86=8C=EC=85=9C=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=A0=95=EB=B3=B4=20=EB=8F=99=EC=9D=98=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pochak/pochak/UI/Login/SocialJoinViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pochak/pochak/UI/Login/SocialJoinViewController.swift b/pochak/pochak/UI/Login/SocialJoinViewController.swift index 472a23fa..856831ea 100644 --- a/pochak/pochak/UI/Login/SocialJoinViewController.swift +++ b/pochak/pochak/UI/Login/SocialJoinViewController.swift @@ -119,7 +119,7 @@ class SocialJoinViewController: UIViewController, SendDelegate { private func changeViewControllerAccordingToisNewMemeberStateForGoogle(_ isNewMember : Bool, _ resultDataForGoogle : GoogleLoginModel){ if isNewMember == true { - guard let termsOfAgreeVC = self.storyboard?.instantiateViewController(withIdentifier: "TermsOfAgreeVC") as? TermsOfAgreeViewController else {return} + let termsOfAgreeVC = TermsOfAgreeViewController() termsOfAgreeVC.modalPresentationStyle = .overCurrentContext // 투명도가 있으면 투명도에 맞춰서 나오게 해주는 코드(뒤에있는 배경이 보일 수 있게) termsOfAgreeVC.delegate = self self.present(termsOfAgreeVC, animated: false, completion: nil) @@ -144,7 +144,7 @@ class SocialJoinViewController: UIViewController, SendDelegate { if isNewMember == true { print("inside changeVCForApple") // 프로필 설정 페이지로 이동 - guard let termsOfAgreeVC = self.storyboard?.instantiateViewController(withIdentifier: "TermsOfAgreeVC") as? TermsOfAgreeViewController else {return} + let termsOfAgreeVC = TermsOfAgreeViewController() termsOfAgreeVC.modalPresentationStyle = .overCurrentContext // 투명도가 있으면 투명도에 맞춰서 나오게 해주는 코드(뒤에있는 배경이 보일 수 있게) termsOfAgreeVC.delegate = self self.present(termsOfAgreeVC, animated: false, completion: nil) From 419a5cde17713b6d247900af929b3dec5c439aee Mon Sep 17 00:00:00 2001 From: Suyeon Date: Tue, 26 Nov 2024 10:58:03 +0900 Subject: [PATCH 12/13] =?UTF-8?q?Fix:=20=EC=B2=B4=ED=81=AC=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=EA=B3=BC=20=EB=9D=BC=EB=B2=A8=20top=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC,=20=EC=B2=B4=ED=81=AC=EB=B2=84=ED=8A=BC=20leading=20?= =?UTF-8?q?=EC=A0=9C=EC=95=BD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pochak/UI/Login/TermsOfAgreeViewController.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift index 1500945b..ec7106cf 100644 --- a/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift +++ b/pochak/pochak/UI/Login/TermsOfAgreeViewController.swift @@ -228,8 +228,9 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi NSLayoutConstraint.activate([ agreeToAllButton.widthAnchor.constraint(equalToConstant: 20), agreeToAllButton.heightAnchor.constraint(equalTo: agreeToAllButton.widthAnchor, multiplier: 1), + agreeToAllButton.leadingAnchor.constraint(greaterThanOrEqualTo: agreeToAllLabel.trailingAnchor, constant: 50), agreeToAllButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -24), - agreeToAllButton.centerYAnchor.constraint(equalTo: agreeToAllLabel.centerYAnchor) + agreeToAllButton.topAnchor.constraint(equalTo: agreeToAllLabel.topAnchor), ]) } @@ -252,7 +253,7 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi termsOfUseAgreeLabel.translatesAutoresizingMaskIntoConstraints = false configureUnderlineAttributes(linkText: "이용약관", - generalText: String(format: "[필수] %@ 동의", "이용약관"), + generalText: String(format: "[필수] 서비스 %@ 동의", "이용약관"), label: termsOfUseAgreeLabel) let recognizer = UITapGestureRecognizer(target: self, action: #selector(termsOfUseLabelDidTap(_: ))) @@ -270,8 +271,9 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi termsOfUseAgreeButton.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ + termsOfUseAgreeButton.leadingAnchor.constraint(greaterThanOrEqualTo: termsOfUseAgreeLabel.trailingAnchor, constant: 50), termsOfUseAgreeButton.trailingAnchor.constraint(equalTo: agreeToAllButton.trailingAnchor), - termsOfUseAgreeButton.centerYAnchor.constraint(equalTo: termsOfUseAgreeLabel.centerYAnchor), + termsOfUseAgreeButton.topAnchor.constraint(equalTo: termsOfUseAgreeLabel.topAnchor), termsOfUseAgreeButton.widthAnchor.constraint(equalToConstant: 20), termsOfUseAgreeButton.heightAnchor.constraint(equalTo: termsOfUseAgreeButton.widthAnchor, multiplier: 1) ]) @@ -301,8 +303,9 @@ final class TermsOfAgreeViewController: UIViewController, UIViewControllerTransi privacyPolicyAgreeButton.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ + privacyPolicyAgreeButton.leadingAnchor.constraint(greaterThanOrEqualTo: privacyPolicyAgreeLabel.trailingAnchor, constant: 50), privacyPolicyAgreeButton.trailingAnchor.constraint(equalTo: termsOfUseAgreeButton.trailingAnchor), - privacyPolicyAgreeButton.centerYAnchor.constraint(equalTo: privacyPolicyAgreeLabel.centerYAnchor), + privacyPolicyAgreeButton.topAnchor.constraint(equalTo: privacyPolicyAgreeLabel.topAnchor), privacyPolicyAgreeButton.widthAnchor.constraint(equalToConstant: 20), privacyPolicyAgreeButton.heightAnchor.constraint(equalTo: privacyPolicyAgreeButton.widthAnchor, multiplier: 1) ]) From 4ff351be8042eec5295e74fe5a664ff4c485ea76 Mon Sep 17 00:00:00 2001 From: Suyeon Date: Tue, 26 Nov 2024 11:08:38 +0900 Subject: [PATCH 13/13] =?UTF-8?q?Fix:=20=EC=95=BD=EA=B4=80=20=EB=8F=99?= =?UTF-8?q?=EC=9D=98=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=8A=A4=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=EB=B3=B4=EB=93=9C=20=EC=88=98=EC=A0=95..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Login/Base.lproj/Login.storyboard | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pochak/pochak/UI/Login/Base.lproj/Login.storyboard b/pochak/pochak/UI/Login/Base.lproj/Login.storyboard index ccab4f0d..b4f400c0 100644 --- a/pochak/pochak/UI/Login/Base.lproj/Login.storyboard +++ b/pochak/pochak/UI/Login/Base.lproj/Login.storyboard @@ -1,9 +1,9 @@ - + - + @@ -14,9 +14,15 @@ Pretendard-Bold + + Pretendard-Light + Pretendard-Medium + + Pretendard-SemiBold + @@ -422,9 +428,6 @@ - - -