Skip to content

Commit

Permalink
feat/#157 모임 초대 코드 확인 뷰 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
youz2me committed Jul 10, 2024
1 parent 9719dfb commit 0018940
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 10 deletions.
4 changes: 4 additions & 0 deletions KkuMulKum.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
DDAF1C932C3D6E3D008A37D3 /* PromiseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDAF1C8D2C3D6E3D008A37D3 /* PromiseViewController.swift */; };
DDDEDDD72C3F031F0094681A /* CheckInviteCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDEDDD62C3F031F0094681A /* CheckInviteCodeViewController.swift */; };
DDDEDDD92C3F03CF0094681A /* JoinButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDEDDD82C3F03CF0094681A /* JoinButtonView.swift */; };
DDDEDDDB2C3F09DC0094681A /* CheckInviteCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDEDDDA2C3F09DC0094681A /* CheckInviteCodeView.swift */; };
DE254AA52C31131600A4015E /* Color.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DE254AA42C31131600A4015E /* Color.xcassets */; };
DE254AA82C3118EA00A4015E /* UIView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE254AA72C3118EA00A4015E /* UIView+.swift */; };
DE254AAA2C31190E00A4015E /* UIStackView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE254AA92C31190E00A4015E /* UIStackView+.swift */; };
Expand Down Expand Up @@ -172,6 +173,7 @@
DDAF1C8D2C3D6E3D008A37D3 /* PromiseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PromiseViewController.swift; sourceTree = "<group>"; };
DDDEDDD62C3F031F0094681A /* CheckInviteCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckInviteCodeViewController.swift; sourceTree = "<group>"; };
DDDEDDD82C3F03CF0094681A /* JoinButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinButtonView.swift; sourceTree = "<group>"; };
DDDEDDDA2C3F09DC0094681A /* CheckInviteCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckInviteCodeView.swift; sourceTree = "<group>"; };
DE254AA42C31131600A4015E /* Color.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Color.xcassets; sourceTree = "<group>"; };
DE254AA72C3118EA00A4015E /* UIView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+.swift"; sourceTree = "<group>"; };
DE254AA92C31190E00A4015E /* UIStackView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -422,6 +424,7 @@
isa = PBXGroup;
children = (
DDDEDDD62C3F031F0094681A /* CheckInviteCodeViewController.swift */,
DDDEDDDA2C3F09DC0094681A /* CheckInviteCodeView.swift */,
DDDEDDD82C3F03CF0094681A /* JoinButtonView.swift */,
);
path = GroupCreate;
Expand Down Expand Up @@ -813,6 +816,7 @@
DE32D1D42C3BFB56006848DF /* UpdateProfileNameModel.swift in Sources */,
DDAF1C932C3D6E3D008A37D3 /* PromiseViewController.swift in Sources */,
DE9E18922C3BCC9D00DB76B4 /* SocialLoginRequestModel.swift in Sources */,
DDDEDDDB2C3F09DC0094681A /* CheckInviteCodeView.swift in Sources */,
DE254AA82C3118EA00A4015E /* UIView+.swift in Sources */,
DE254AAE2C31193600A4015E /* UIFont+.swift in Sources */,
DE9E189A2C3BCCBE00DB76B4 /* UtilsTemp.swift in Sources */,
Expand Down
43 changes: 43 additions & 0 deletions KkuMulKum/Source/GroupCreate/CheckInviteCodeView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// CheckInviteCodeView.swift
// KkuMulKum
//
// Created by YOUJIM on 7/11/24.
//

import UIKit

class CheckInviteCodeView: BaseView {
private let checkInviteLabel: UILabel = UILabel().then {
$0.setText("친구에게 받은\n모임 초대 코드가 있으신가요?", style: .head01, color: .gray8)
}

let enterInviteCodeView: JoinButtonView = JoinButtonView().then {
$0.setJoinButtonViewStatus(isReceived: true)
}

let createGroupView: JoinButtonView = JoinButtonView().then {
$0.setJoinButtonViewStatus(isReceived: false)
}

override func setupView() {
self.addSubviews(checkInviteLabel, enterInviteCodeView, createGroupView)
}

override func setupAutoLayout() {
checkInviteLabel.snp.makeConstraints {
$0.top.equalToSuperview().offset(32)
$0.leading.equalToSuperview().offset(20)
}

enterInviteCodeView.snp.makeConstraints {
$0.top.equalTo(checkInviteLabel.snp.bottom).offset(24)
$0.leading.trailing.equalToSuperview().inset(20)
}

createGroupView.snp.makeConstraints {
$0.top.equalTo(enterInviteCodeView.snp.bottom).offset(12)
$0.leading.trailing.equalToSuperview().inset(20)
}
}
}
17 changes: 12 additions & 5 deletions KkuMulKum/Source/GroupCreate/CheckInviteCodeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
import UIKit

class CheckInviteCodeViewController: BaseViewController {

override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
private let checkInviteCodeView: CheckInviteCodeView = CheckInviteCodeView()

override func setupView() {
view.backgroundColor = .white
self.navigationItem.title = "내 모임 추가하기"
self.tabBarController?.tabBar.isHidden = true

view.addSubview(checkInviteCodeView)

checkInviteCodeView.snp.makeConstraints {
$0.edges.equalTo(view.safeAreaLayoutGuide)
}
}
}
20 changes: 16 additions & 4 deletions KkuMulKum/Source/GroupCreate/JoinButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import UIKit

class JoinButtonView: BaseView {
private let subTitleLabel: UILabel = UILabel().then {
$0.setText("초대 코드를 받았다면", style: .caption02)
$0.setText("subTitleLabel", style: .caption02, color: .gray5)
}

private let mainTitleLabel: UILabel = UILabel().then {
$0.setText("초대 코드 입력하기", style: .body03)
$0.setText("mainTitleLabel", style: .body03, color: .gray8)
}

private let chevronImageView: UIImageView = UIImageView().then {
$0.image = .iconRight
$0.image = .iconRight.withTintColor(.gray3)
$0.contentMode = .scaleAspectFit
}

Expand All @@ -35,7 +35,8 @@ class JoinButtonView: BaseView {

mainTitleLabel.snp.makeConstraints {
$0.bottom.equalToSuperview().inset(18)
$0.top.equalTo(subTitleLabel).offset(14)
$0.leading.equalToSuperview().offset(20)
$0.top.equalTo(subTitleLabel.snp.bottom).offset(8)
}

chevronImageView.snp.makeConstraints {
Expand All @@ -45,4 +46,15 @@ class JoinButtonView: BaseView {
$0.width.equalTo(chevronImageView.snp.height)
}
}

func setJoinButtonViewStatus(isReceived: Bool) {
if isReceived {
subTitleLabel.setText("초대 코드를 받았다면", style: .caption02, color: .gray5)
mainTitleLabel.setText("초대 코드 입력하기", style: .body03, color: .gray8)
}
else {
subTitleLabel.setText("초대 코드가 없다면", style: .caption02, color: .gray5)
mainTitleLabel.setText("직접 모임 추가하기", style: .body03, color: .gray8)
}
}
}
2 changes: 1 addition & 1 deletion KkuMulKum/Source/GroupList/GroupListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GroupListViewController: BaseViewController {
}

@objc private func didAddScheduleButtonTapped() {
let scheduleViewController = PromiseViewController()
let scheduleViewController = CheckInviteCodeViewController()

self.navigationController?.pushViewController(scheduleViewController, animated: true)
}
Expand Down

0 comments on commit 0018940

Please sign in to comment.