Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat [#49] SignInCompleteViewController 회원가입 완료 화면 구현 #50

Merged
merged 3 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HMH_iOS/HMH_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
0BC0EBD42B494459003EF5D4 /* OnboardingSwipeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BC0EBD32B494459003EF5D4 /* OnboardingSwipeView.swift */; };
0BD98DB92B4D671600E35188 /* SplashViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD98DB82B4D671600E35188 /* SplashViewController.swift */; };
0BD98DBE2B4D6AB700E35188 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BD98DBD2B4D6AB700E35188 /* LoginViewController.swift */; };
0BFD2FB42B4EE71900C6327F /* SignInCompleteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BFD2FB32B4EE71900C6327F /* SignInCompleteViewController.swift */; };
17314F7F2B485E150089A551 /* CustomAlertButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17314F7E2B485E150089A551 /* CustomAlertButton.swift */; };
17314F832B486BEC0089A551 /* AlertViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17314F822B486BEC0089A551 /* AlertViewController.swift */; };
17314F852B497FDE0089A551 /* HMHLogoutAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17314F842B497FDE0089A551 /* HMHLogoutAlert.swift */; };
Expand Down Expand Up @@ -190,6 +191,7 @@
0BC0EBD32B494459003EF5D4 /* OnboardingSwipeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingSwipeView.swift; sourceTree = "<group>"; };
0BD98DB82B4D671600E35188 /* SplashViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashViewController.swift; sourceTree = "<group>"; };
0BD98DBD2B4D6AB700E35188 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = "<group>"; };
0BFD2FB32B4EE71900C6327F /* SignInCompleteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInCompleteViewController.swift; sourceTree = "<group>"; };
17314F7E2B485E150089A551 /* CustomAlertButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAlertButton.swift; sourceTree = "<group>"; };
17314F822B486BEC0089A551 /* AlertViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertViewController.swift; sourceTree = "<group>"; };
17314F842B497FDE0089A551 /* HMHLogoutAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMHLogoutAlert.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -417,6 +419,7 @@
0B78174D2B4BD96D0078E925 /* OnboardingBaseViewControllers.swift */,
0BA193B32B4D089C007E3F9C /* TimeSurveyViewController.swift */,
0BA193B52B4D08B7007E3F9C /* ProblemSurveyViewController.swift */,
0BFD2FB32B4EE71900C6327F /* SignInCompleteViewController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -1050,6 +1053,7 @@
17314FAF2B4D3E1C0089A551 /* LogoutAndQuitFooterView.swift in Sources */,
0B78174E2B4BD96D0078E925 /* OnboardingBaseViewControllers.swift in Sources */,
0B8A89B12B369E4C00688BA6 /* HomeView.swift in Sources */,
0BFD2FB42B4EE71900C6327F /* SignInCompleteViewController.swift in Sources */,
36A3D9B62B3EBBF7007EA272 /* Adjust+.swift in Sources */,
36A3D9BC2B3EBD2D007EA272 /* UIScreen+.swift in Sources */,
0B7817502B4BD9F10078E925 /* OnboardingButton.swift in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions HMH_iOS/HMH_iOS/Global/Literals/String/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ enum StringLiteral {
static let selectTotalTime = "총 목표 이용 시간을\n설정해 주세요"
static let approvePermision = "스크린타임 권한 허용이 필요해요"
static let appSelect = "중독에서 탈출하고 싶은\n앱을 선택해 주세요"
static let signInComplete = "회원가입 완료"
}

enum OnboardigSub {
Expand All @@ -87,6 +88,7 @@ enum StringLiteral {
static let selectTotalTime = "목표 이용 시간은 최대 6시간까지 설정할 수 있어요"
static let approvePermision = "언제든지 설정에서 스크린타임 권한을\n변경할 수 있어요"
static let appSelect = "목표 이용 시간이 지나면 앱이 잠겨요\n선택하고 싶은 앱은 언제든지 추가할 수 있어요"
static let signInComplete = "이제 하면함에서 블랙홀 탈출을 위한\n여정을 시작해 볼까요?"
}

enum TimeSurveySelect {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
//
// SignInSuccessViewController.swift
// HMH_iOS
//
// Created by Seonwoo Kim on 1/10/24.
//

import UIKit

import SnapKit
import Then

final class SignInCompleteViewController: OnboardingBaseViewController {
private let SignInMainLabel = UILabel().then {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1. 여기 빈 줄 하나 넣어주세요!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1. 아래에도 모두 적용되는데, 변수명은 lowerCamelCase 사용해주세요!

$0.textColor = .whiteText
$0.font = .iosTitle3Semibold22
$0.text = StringLiteral.OnboardigMain.signInComplete
}
private let SignInSubLabel = UILabel().then {
$0.textColor = .gray2
$0.font = .iosText6Medium14
$0.text = StringLiteral.OnboardigSub.signInComplete
$0.setTextWithLineHeight(text: $0.text, lineHeight: 21)
}

private let SignInImageView = UIImageView().then {
$0.image = ImageLiterals.myPage.icBadge
$0.contentMode = .scaleAspectFit
}

override func viewDidLoad() {
super.viewDidLoad()
configureBaseView()
setDelegate()
setUI()
}

private func setUI() {
setHierarchy()
setConstraints()
}

private func setHierarchy() {
view.addSubviews(SignInMainLabel,SignInSubLabel,SignInImageView)
}

private func setConstraints() {
SignInImageView.snp.makeConstraints {
$0.top.equalTo(navigationBar.snp.bottom).offset(126.adjustedHeight)
$0.size.equalTo(150.adjusted)
$0.centerX.equalToSuperview()
}

SignInMainLabel.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(SignInImageView.snp.bottom).offset(27.adjustedHeight)
}

SignInSubLabel.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(SignInMainLabel.snp.bottom).offset(8.adjustedHeight)
}
}

private func setDelegate() {
self.delegate = self
}

private func configureBaseView() {
view.backgroundColor = .background
progressBar.isHidden = true
nextButton.setButtonText(buttonTitle: StringLiteral.OnboardingButton.confirm)
nextButton.updateStatus(isEnabled: true)
}
}

extension SignInCompleteViewController: NextViewPushDelegate {
func didTapButton() {
let nextViewController = TabBarController()
let navigationController = UINavigationController(rootViewController: nextViewController)
let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate
guard let delegate = sceneDelegate else {
return
}
delegate.window?.rootViewController = navigationController
}
}