Skip to content

Commit

Permalink
feat/#154 환영합니다 화면 UI 구현완료
Browse files Browse the repository at this point in the history
  • Loading branch information
hooni0918 committed Jul 10, 2024
1 parent a6e7d00 commit cb2c7b6
Show file tree
Hide file tree
Showing 7 changed files with 268 additions and 3 deletions.
40 changes: 40 additions & 0 deletions KkuMulKum.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
782B406F2C3DBF93008B0CA7 /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 782B406E2C3DBF93008B0CA7 /* ProfileViewController.swift */; };
782B40722C3DBFA3008B0CA7 /* ProfileViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 782B40712C3DBFA3008B0CA7 /* ProfileViewModel.swift */; };
782B40752C3DBFBA008B0CA7 /* ProfileVIew.swift in Sources */ = {isa = PBXBuildFile; fileRef = 782B40742C3DBFBA008B0CA7 /* ProfileVIew.swift */; };
782B407B2C3E395A008B0CA7 /* WelcomeVIew.swift in Sources */ = {isa = PBXBuildFile; fileRef = 782B407A2C3E395A008B0CA7 /* WelcomeVIew.swift */; };
782B407D2C3E3984008B0CA7 /* WelcomeViewcontroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 782B407C2C3E3984008B0CA7 /* WelcomeViewcontroller.swift */; };
784E4D942C3B1C7F00BC943C /* KakaoSDK in Frameworks */ = {isa = PBXBuildFile; productRef = 784E4D932C3B1C7F00BC943C /* KakaoSDK */; };
784E4D962C3B1C7F00BC943C /* KakaoSDKAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 784E4D952C3B1C7F00BC943C /* KakaoSDKAuth */; };
784E4D992C3B95A900BC943C /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 784E4D982C3B95A900BC943C /* KeychainAccess */; };
Expand Down Expand Up @@ -128,6 +130,8 @@
782B406E2C3DBF93008B0CA7 /* ProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewController.swift; sourceTree = "<group>"; };
782B40712C3DBFA3008B0CA7 /* ProfileViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewModel.swift; sourceTree = "<group>"; };
782B40742C3DBFBA008B0CA7 /* ProfileVIew.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileVIew.swift; sourceTree = "<group>"; };
782B407A2C3E395A008B0CA7 /* WelcomeVIew.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeVIew.swift; sourceTree = "<group>"; };
782B407C2C3E3984008B0CA7 /* WelcomeViewcontroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeViewcontroller.swift; sourceTree = "<group>"; };
785AE1D02C3B07A600677CA0 /* PrivacyInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = PrivacyInfo.plist; sourceTree = "<group>"; };
7898732F2C3D1A7B00435E96 /* LoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = "<group>"; };
789873302C3D1A7B00435E96 /* LoginViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -290,6 +294,39 @@
path = View;
sourceTree = "<group>";
};
782B40762C3E389F008B0CA7 /* Welcome */ = {
isa = PBXGroup;
children = (
782B40792C3E38C3008B0CA7 /* ViewController */,
782B40782C3E38BC008B0CA7 /* ViewModel */,
782B40772C3E38B5008B0CA7 /* View */,
);
path = Welcome;
sourceTree = "<group>";
};
782B40772C3E38B5008B0CA7 /* View */ = {
isa = PBXGroup;
children = (
782B407A2C3E395A008B0CA7 /* WelcomeVIew.swift */,
);
path = View;
sourceTree = "<group>";
};
782B40782C3E38BC008B0CA7 /* ViewModel */ = {
isa = PBXGroup;
children = (
);
path = ViewModel;
sourceTree = "<group>";
};
782B40792C3E38C3008B0CA7 /* ViewController */ = {
isa = PBXGroup;
children = (
782B407C2C3E3984008B0CA7 /* WelcomeViewcontroller.swift */,
);
path = ViewController;
sourceTree = "<group>";
};
789873352C3D1B3000435E96 /* View */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -370,6 +407,7 @@
DD865B652C3920F600C351A2 /* Onboarding */ = {
isa = PBXGroup;
children = (
782B40762C3E389F008B0CA7 /* Welcome */,
782B406C2C3DBF72008B0CA7 /* Profile */,
78AED1322C3D9514000AD80A /* Nickname */,
DD865B662C39210E00C351A2 /* Login */,
Expand Down Expand Up @@ -817,6 +855,7 @@
78AED1342C3D951F000AD80A /* NicknameViewController.swift in Sources */,
DE254AB42C31199B00A4015E /* UITextField+.swift in Sources */,
DDAF1C912C3D6E3D008A37D3 /* TardyViewController.swift in Sources */,
782B407D2C3E3984008B0CA7 /* WelcomeViewcontroller.swift in Sources */,
DE8248002C36E857000601BC /* ObservablePattern.swift in Sources */,
DDAF1C902C3D6E3D008A37D3 /* PromiseViewModel.swift in Sources */,
DE254AAA2C31190E00A4015E /* UIStackView+.swift in Sources */,
Expand All @@ -827,6 +866,7 @@
DE254AA82C3118EA00A4015E /* UIView+.swift in Sources */,
DE254AAE2C31193600A4015E /* UIFont+.swift in Sources */,
DE9E189A2C3BCCBE00DB76B4 /* UtilsTemp.swift in Sources */,
782B407B2C3E395A008B0CA7 /* WelcomeVIew.swift in Sources */,
DD3072142C3BF87A00416D9F /* NearestPromiseResponseModel.swift in Sources */,
DD3072162C3BFE4E00416D9F /* UpcomingPromiseListResponseModel.swift in Sources */,
A3FB18572C3BF704001483E5 /* MeetingListResponseModel.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion KkuMulKum/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
) {
guard let windowScene = (scene as? UIWindowScene) else { return }
self.window = UIWindow(windowScene: windowScene)
self.window?.rootViewController = NicknameViewController()
self.window?.rootViewController = WelcomeViewController()
self.window?.makeKeyAndVisible()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,38 @@
//
// Created by 이지훈 on 7/10/24.
//
import UIKit

import Foundation
class ProfileSetupViewController: BaseViewController {
private let rootView = ProfileSetupView()

override func loadView() {
view = rootView
}

override func setupView() {
// 추가적인 UI 설정이 필요하다면 여기에 구현
}

override func setupAction() {
rootView.confirmButton.addTarget(self, action: #selector(confirmButtonTapped), for: .touchUpInside)
rootView.skipButton.addTarget(self, action: #selector(skipButtonTapped), for: .touchUpInside)
rootView.cameraButton.addTarget(self, action: #selector(cameraButtonTapped), for: .touchUpInside)
}

override func setupDelegate() {
// Delegate 설정이 필요하다면 여기에 구현
}

@objc private func confirmButtonTapped() {
// 확인 버튼 탭 시 동작 구현
}

@objc private func skipButtonTapped() {
// 건너뛰기 버튼 탭 시 동작 구현
}

@objc private func cameraButtonTapped() {
// 카메라 버튼 탭 시 동작 구현
}
}
84 changes: 83 additions & 1 deletion KkuMulKum/Source/Onboarding/Profile/View/ProfileVIew.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,86 @@
// Created by 이지훈 on 7/10/24.
//

import Foundation
import UIKit

import SnapKit
import Then

class ProfileSetupView: BaseView {

let titleLabel = UILabel().then {
$0.text = "프로필 설정"
$0.font = .systemFont(ofSize: 18, weight: .medium)
$0.textAlignment = .center
}

let subtitleLabel = UILabel().then {
$0.text = "프로필을 설정해 주세요"
$0.font = .systemFont(ofSize: 16)
$0.textAlignment = .center
}

let profileImageView = UIImageView().then {
$0.image = UIImage(named: "defaultProfile")
$0.contentMode = .scaleAspectFit
$0.layer.cornerRadius = 50
$0.clipsToBounds = true
}

let cameraButton = UIButton().then {
$0.setImage(UIImage(systemName: "camera.fill"), for: .normal)
$0.tintColor = .white
$0.backgroundColor = .lightGray
$0.layer.cornerRadius = 15
}

let skipButton = UIButton().then {
$0.setTitle("지금은 넘어가기", for: .normal)
$0.setTitleColor(.gray, for: .normal)
$0.titleLabel?.font = .systemFont(ofSize: 14)
}

let confirmButton = UIButton().then {
$0.setTitle("확인", for: .normal)
$0.backgroundColor = .maincolor
$0.layer.cornerRadius = 8
}

override func setupView() {
backgroundColor = .white
[titleLabel, subtitleLabel, profileImageView, cameraButton, skipButton, confirmButton].forEach { addSubview($0) }
}

override func setupAutoLayout() {
titleLabel.snp.makeConstraints {
$0.top.equalTo(safeAreaLayoutGuide).offset(20)
$0.centerX.equalToSuperview()
}

subtitleLabel.snp.makeConstraints {
$0.top.equalTo(titleLabel.snp.bottom).offset(20)
$0.centerX.equalToSuperview()
}

profileImageView.snp.makeConstraints {
$0.center.equalToSuperview()
$0.size.equalTo(100)
}

cameraButton.snp.makeConstraints {
$0.bottom.trailing.equalTo(profileImageView)
$0.size.equalTo(30)
}

skipButton.snp.makeConstraints {
$0.bottom.equalTo(confirmButton.snp.top).offset(-20)
$0.centerX.equalToSuperview()
}

confirmButton.snp.makeConstraints {
$0.bottom.equalTo(safeAreaLayoutGuide).offset(-20)
$0.left.right.equalToSuperview().inset(20)
$0.height.equalTo(50)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@
//

import Foundation

class ProfileViewModel {

var nickname: String = ""

func setNickname(_ nickname: String) {
self.nickname = nickname
}

func getNickname() -> String {
return nickname
}
}
56 changes: 56 additions & 0 deletions KkuMulKum/Source/Onboarding/Welcome/View/WelcomeVIew.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// WelcomeVIew.swift
// KkuMulKum
//
// Created by 이지훈 on 7/10/24.
//

import UIKit

import SnapKit
import Then

class WelcomeView: BaseView {
let characterImageView = UIImageView().then {
$0.image = UIImage(named: "img_logo")
$0.contentMode = .scaleAspectFit
}

let welcomeLabel = UILabel().then {
$0.text = "이름이름이님 반가워요!"
$0.textAlignment = .center
$0.font = UIFont.pretendard(.body01)
}

let confirmButton = UIButton().then {
$0.setTitle("확인", for: .normal)
$0.setTitleColor(.white, for: .normal)
$0.backgroundColor = .maincolor
$0.layer.cornerRadius = 8
}

override func setupView() {
addSubview(characterImageView)
addSubview(welcomeLabel)
addSubview(confirmButton)
}

override func setupAutoLayout() {
characterImageView.snp.makeConstraints {
$0.top.equalTo(safeAreaLayoutGuide).offset(200)
$0.centerX.equalToSuperview()
$0.height.width.equalTo(150)
}

welcomeLabel.snp.makeConstraints {
$0.top.equalTo(characterImageView.snp.bottom).offset(20)
$0.centerX.equalToSuperview()
}

confirmButton.snp.makeConstraints {
$0.bottom.equalTo(safeAreaLayoutGuide).offset(-20)
$0.leading.trailing.equalToSuperview().inset(20)
$0.height.equalTo(50)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// WelcomeViewController.swift
// KkuMulKum
//
// Created by 이지훈 on 7/10/24.
//

import UIKit

class WelcomeViewController: BaseViewController {

private let welcomeView = WelcomeView()

override func loadView() {
view = welcomeView
}

override func viewDidLoad() {
super.viewDidLoad()
setupView()
setupAction()
setupDelegate()
}

override func setupView() {
// 배경색상 설정
view.backgroundColor = .green2
}

override func setupAction() {
welcomeView.confirmButton.addTarget(self, action: #selector(confirmButtonTapped), for: .touchUpInside)
}

override func setupDelegate() {
// 필요한 경우 delegate 설정
}

@objc private func confirmButtonTapped() {
print("확인 버튼이 탭되었습니다.")
}
}

0 comments on commit cb2c7b6

Please sign in to comment.