From 347a4bcad521a7a826d47b1eeb49213517325dff Mon Sep 17 00:00:00 2001 From: devxsby Date: Sun, 1 Jan 2023 21:39:38 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[Add]=20#60=20-=20=EA=B3=84=EC=A0=95=20?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0=20=EB=B7=B0=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Projects/Core/Sources/Literals/StringLiterals.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index afa2e4b53..afd29a103 100644 --- a/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -47,6 +47,9 @@ public struct I18N { public static let findAccount = "계정 찾기" public static let signIn = "로그인" public static let signUp = "회원가입" + public static let findDescription = "아래 구글 폼을 제출해 주시면\n평일 기준 3-5일 이내로\n아이디 / 임시 비밀번호를 전송 드립니다." + public static let findEmail = "이메일 찾기" + public static let findPassword = "비밀번호 찾기" } public struct SignUp { From ba9d998b3b2c774ada703393f6b15b0c79a5e2bc Mon Sep 17 00:00:00 2001 From: devxsby Date: Sun, 1 Jan 2023 21:41:17 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[Feat]=20#60-=20=EA=B3=84=EC=A0=95=20?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0=20=EB=B7=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SignInScene/VC/FindAccountVC.swift | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift new file mode 100644 index 000000000..4256f5861 --- /dev/null +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift @@ -0,0 +1,125 @@ +// +// FindAccountVC.swift +// Presentation +// +// Created by devxsby on 2023/01/01. +// Copyright © 2023 SOPT-Stamp-iOS. All rights reserved. +// + +import UIKit +import DSKit + +import Core + +public class FindAccountVC: UIViewController { + + // MARK: - Properties + + public var factory: ModuleFactoryInterface! + + // MARK: - UI Components + + private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton) + .setTitle(I18N.SignIn.findAccount) + + private let descriptionLabel = UILabel().then { + $0.text = I18N.SignIn.findDescription + $0.textColor = DSKitAsset.Colors.gray700.color + $0.textAlignment = .left + $0.numberOfLines = 3 + $0.font = UIFont.subtitle3 + $0.setLineSpacing(lineSpacing: 10) + } + + private lazy var findEmailButton = UIButton(type: .system).then { + $0.setTitle(I18N.SignIn.findEmail, for: .normal) + $0.addTarget(self, action: #selector(findEmailButtonDidTap), for: .touchUpInside) + } + + private lazy var findPasswordButton = UIButton(type: .system).then { + $0.setTitle(I18N.SignIn.findPassword, for: .normal) + $0.addTarget(self, action: #selector(findPasswordButtonDidTap), for: .touchUpInside) + } + + // MARK: - View Life Cycle + + public override func viewDidLoad() { + super.viewDidLoad() + self.setUI() + self.setLayout() + } + + // MARK: - @objc Function + + @objc + private func findEmailButtonDidTap() { + self.openExternalLink(urlStr: "https://forms.gle/XkVFMUPsWWV1DXU38") + } + + @objc + private func findPasswordButtonDidTap() { + self.openExternalLink(urlStr: "https://forms.gle/bUgTG9ooRVgPZ8K39") + } +} + +// MARK: - UI & Layout + +extension FindAccountVC { + + private func setUI() { + self.view.backgroundColor = .white + [findEmailButton, findPasswordButton].forEach { + $0.layer.cornerRadius = 9 + $0.backgroundColor = DSKitAsset.Colors.purple200.color + $0.setTitleColor(DSKitAsset.Colors.purple300.color, for: .normal) + $0.contentHorizontalAlignment = .left + $0.titleEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 0) + $0.titleLabel!.setTypoStyle(.h3) + } + } + + private func setLayout() { + self.view.addSubviews(naviBar, descriptionLabel, findEmailButton, findPasswordButton) + + naviBar.snp.makeConstraints { make in + make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + } + + descriptionLabel.snp.makeConstraints { make in + make.top.equalTo(naviBar.snp.bottom).offset(24) + make.leading.equalToSuperview().offset(20) + } + + findEmailButton.snp.makeConstraints { make in + make.top.equalTo(descriptionLabel.snp.bottom).offset(48) + make.leading.trailing.equalToSuperview().inset(20) + make.height.equalTo(56) + } + + findPasswordButton.snp.makeConstraints { make in + make.top.equalTo(findEmailButton.snp.bottom).offset(12) + make.leading.trailing.equalToSuperview().inset(20) + make.height.equalTo(56) + } + } +} + +// MARK: - Methods + +extension FindAccountVC { + + public func openExternalLink(urlStr: String, _ handler: (() -> Void)? = nil) { + guard let url = URL(string: urlStr) else { + return + } + + if #available(iOS 10.0, *) { + UIApplication.shared.open(url, options: [:]) { _ in + handler?() + } + } else { + UIApplication.shared.openURL(url) + handler?() + } + } +} From 5a16afd96ceef0089d4fe915dad82ccd2249ad93 Mon Sep 17 00:00:00 2001 From: devxsby Date: Sun, 1 Jan 2023 21:41:45 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[Feat]=20#60=20-=20=EB=B7=B0=20=EC=97=B0?= =?UTF-8?q?=EA=B2=B0=20=EB=B0=8F=20=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=A3=BC?= =?UTF-8?q?=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Sources/ModuleFactoryInterface.swift | 1 + .../Presentation/Sources/SignInScene/VC/SignInVC.swift | 4 ++-- .../Sources/ModuleFactory/ModuleFactory.swift | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift index 96a5b4367..3fddee2a0 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/ModuleFactoryInterface.swift @@ -14,6 +14,7 @@ public protocol ModuleFactoryInterface { func makeSplashVC() -> SplashVC func makeOnboardingVC() -> OnboardingVC func makeSignInVC() -> SignInVC + func makeFindAccountVC() -> FindAccountVC func makeSignUpVC() -> SignUpVC func makeSignUpCompleteVC() -> SignUpCompleteVC func makeMissionListVC(sceneType: MissionListSceneType) -> MissionListVC diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/SignInVC.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/SignInVC.swift index a92d4e756..95c7e6b93 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/SignInVC.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/SignInVC.swift @@ -85,8 +85,8 @@ public class SignInVC: UIViewController { @objc private func findAccountButtonDidTap() { - print("find account btn did tap") - // 화면전환 + let findAccountVC = self.factory.makeFindAccountVC() + self.navigationController?.pushViewController(findAccountVC, animated: true) } @objc diff --git a/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift b/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift index 4bbc13c8a..0755f1fd3 100644 --- a/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift +++ b/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift @@ -48,6 +48,12 @@ extension ModuleFactory: ModuleFactoryInterface { return signinVC } + public func makeFindAccountVC() -> Presentation.FindAccountVC { + let findAccountVC = FindAccountVC() + findAccountVC.factory = self + return findAccountVC + } + public func makeSignUpVC() -> Presentation.SignUpVC { let repository = SignUpRepository(service: authService, userService: userService) let useCase = DefaultSignUpUseCase(repository: repository) From 5ea08e2823c62a04e29f680b4c3c04f0c39f5923 Mon Sep 17 00:00:00 2001 From: devxsby Date: Sun, 1 Jan 2023 22:02:30 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[Chore]=20#60-=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20factory=20=EB=B3=80=EC=88=98=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Sources/SignInScene/VC/FindAccountVC.swift | 4 ---- .../SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift | 1 - 2 files changed, 5 deletions(-) diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift index 4256f5861..cd91c59e4 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift @@ -13,10 +13,6 @@ import Core public class FindAccountVC: UIViewController { - // MARK: - Properties - - public var factory: ModuleFactoryInterface! - // MARK: - UI Components private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton) diff --git a/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift b/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift index 0755f1fd3..1cc309f01 100644 --- a/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift +++ b/SOPT-Stamp-iOS/Projects/SOPT-Stamp-iOS/Sources/ModuleFactory/ModuleFactory.swift @@ -50,7 +50,6 @@ extension ModuleFactory: ModuleFactoryInterface { public func makeFindAccountVC() -> Presentation.FindAccountVC { let findAccountVC = FindAccountVC() - findAccountVC.factory = self return findAccountVC } From 2e6b4e414e0c8ca6258756261422cf17c38c6762 Mon Sep 17 00:00:00 2001 From: devxsby Date: Sun, 1 Jan 2023 22:31:51 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[Chore]=20#60=20-=20=EC=99=B8=EB=B6=80=20?= =?UTF-8?q?=EB=A7=81=ED=81=AC=20=ED=8C=8C=EC=9D=BC=20=EB=94=B0=EB=A1=9C=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=ED=95=98=EB=8A=94=20Literals=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 --- .../Core/Sources/Literals/ExternalURL.swift | 33 +++++++++++++++++++ .../Sources/Literals/StringLiterals.swift | 2 ++ .../SignInScene/VC/FindAccountVC.swift | 4 +-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 SOPT-Stamp-iOS/Projects/Core/Sources/Literals/ExternalURL.swift diff --git a/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/ExternalURL.swift b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/ExternalURL.swift new file mode 100644 index 000000000..923544cce --- /dev/null +++ b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/ExternalURL.swift @@ -0,0 +1,33 @@ +// +// ExternalURL.swift +// Core +// +// Created by devxsby on 2023/01/01. +// Copyright © 2023 SOPT-Stamp-iOS. All rights reserved. +// + +import UIKit + +public struct ExternalURL { + + public struct GoogleForms { + + public static let findEmail = "https://forms.gle/XkVFMUPsWWV1DXU38" + public static let findPassword = "https://forms.gle/bUgTG9ooRVgPZ8K39" + } + + public func openExternalLink(urlStr: String, _ handler: (() -> Void)? = nil) { + guard let url = URL(string: urlStr) else { + return + } + + if #available(iOS 10.0, *) { + UIApplication.shared.open(url, options: [:]) { _ in + handler?() + } + } else { + UIApplication.shared.openURL(url) + handler?() + } + } +} diff --git a/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift index 0f530278d..56a9e0e48 100644 --- a/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift +++ b/SOPT-Stamp-iOS/Projects/Core/Sources/Literals/StringLiterals.swift @@ -105,7 +105,9 @@ public struct I18N { public static let passwordEditSuccess = "비밀번호가 변경되었습니다." public static let passwordEditFail = "비밀번호 변경 실패" } +} +extension I18N { public struct serviceUsagePolicy { public static let termsOfService = """ 제 1장 총칙 diff --git a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift index cd91c59e4..b4e41712c 100644 --- a/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift +++ b/SOPT-Stamp-iOS/Projects/Presentation/Sources/SignInScene/VC/FindAccountVC.swift @@ -49,12 +49,12 @@ public class FindAccountVC: UIViewController { @objc private func findEmailButtonDidTap() { - self.openExternalLink(urlStr: "https://forms.gle/XkVFMUPsWWV1DXU38") + self.openExternalLink(urlStr: ExternalURL.GoogleForms.findEmail) } @objc private func findPasswordButtonDidTap() { - self.openExternalLink(urlStr: "https://forms.gle/bUgTG9ooRVgPZ8K39") + self.openExternalLink(urlStr: ExternalURL.GoogleForms.findPassword) } }