-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from OMZigak/feat/157-group-create-ui
[feat] 모임 추가 뷰 구현
- Loading branch information
Showing
19 changed files
with
1,003 additions
and
29 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
KkuMulKum/Resource/Assets.xcassets/Image/img_create_group.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "img_create_group.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...m/Resource/Assets.xcassets/Image/img_create_group.imageset/img_create_group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
KkuMulKum/Source/GroupCreate/CheckInviteCode/View/CheckInviteCodeView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// 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() { | ||
let safeArea = safeAreaLayoutGuide | ||
|
||
checkInviteLabel.snp.makeConstraints { | ||
$0.top.equalTo(safeArea).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) | ||
} | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
KkuMulKum/Source/GroupCreate/CheckInviteCode/View/JoinButtonView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// JoinButtonView.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/11/24. | ||
// | ||
|
||
import UIKit | ||
|
||
class JoinButtonView: BaseView { | ||
private let subTitleLabel: UILabel = UILabel().then { | ||
$0.setText("subTitleLabel", style: .caption02, color: .gray5) | ||
} | ||
|
||
private let mainTitleLabel: UILabel = UILabel().then { | ||
$0.setText("mainTitleLabel", style: .body03, color: .gray8) | ||
} | ||
|
||
private let chevronImageView: UIImageView = UIImageView().then { | ||
$0.image = .iconRight.withTintColor(.gray3) | ||
$0.contentMode = .scaleAspectFit | ||
} | ||
|
||
override func setupView() { | ||
self.backgroundColor = .green1 | ||
|
||
self.addSubviews( | ||
subTitleLabel, | ||
mainTitleLabel, | ||
chevronImageView | ||
) | ||
} | ||
|
||
override func setupAutoLayout() { | ||
subTitleLabel.snp.makeConstraints { | ||
$0.top.equalToSuperview().offset(18) | ||
$0.leading.equalToSuperview().offset(20) | ||
} | ||
|
||
mainTitleLabel.snp.makeConstraints { | ||
$0.bottom.equalToSuperview().inset(18) | ||
$0.leading.equalToSuperview().offset(20) | ||
$0.top.equalTo(subTitleLabel.snp.bottom).offset(8) | ||
} | ||
|
||
chevronImageView.snp.makeConstraints { | ||
$0.trailing.equalToSuperview().inset(17) | ||
$0.centerY.equalToSuperview() | ||
$0.height.equalTo(Screen.height(24)) | ||
$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) | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...Kum/Source/GroupCreate/CheckInviteCode/ViewController/CheckInviteCodeViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// CheckInviteCodeViewController.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/11/24. | ||
// | ||
|
||
import UIKit | ||
|
||
class CheckInviteCodeViewController: BaseViewController { | ||
private let checkInviteCodeView: CheckInviteCodeView = CheckInviteCodeView() | ||
|
||
override func loadView() { | ||
view = checkInviteCodeView | ||
} | ||
|
||
override func setupView() { | ||
view.backgroundColor = .white | ||
self.tabBarController?.tabBar.isHidden = true | ||
|
||
setupNavigationBarTitle(with: "내 모임 추가하기") | ||
setupNavigationBarBackButton() | ||
} | ||
|
||
override func setupAction() { | ||
checkInviteCodeView.enterInviteCodeView.addGestureRecognizer(UITapGestureRecognizer( | ||
target: self, | ||
action: #selector(inviteCodeViewDidTap) | ||
)) | ||
checkInviteCodeView.createGroupView.addGestureRecognizer(UITapGestureRecognizer( | ||
target: self, | ||
action: #selector(createGroupViewDidTap) | ||
)) | ||
} | ||
|
||
@objc private func inviteCodeViewDidTap() { | ||
let inviteCodeViewController = InviteCodeViewController() | ||
|
||
inviteCodeViewController.modalTransitionStyle = .crossDissolve | ||
inviteCodeViewController.modalPresentationStyle = .fullScreen | ||
|
||
navigationController?.pushViewController(inviteCodeViewController, animated: true) | ||
} | ||
|
||
@objc private func createGroupViewDidTap() { | ||
let createGroupViewController = CreateGroupViewController() | ||
|
||
createGroupViewController.modalTransitionStyle = .crossDissolve | ||
createGroupViewController.modalPresentationStyle = .fullScreen | ||
|
||
navigationController?.pushViewController(createGroupViewController, animated: true) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
KkuMulKum/Source/GroupCreate/CreateGroup/Service/CreateGroupService.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// CreateGroupService.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/13/24. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol CreateGroupServiceType { | ||
|
||
} | ||
|
||
final class CreateGroupService: CreateGroupServiceType { | ||
|
||
} | ||
|
61 changes: 61 additions & 0 deletions
61
KkuMulKum/Source/GroupCreate/CreateGroup/View/CreateGroupView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// CreateGroupView.swift | ||
// KkuMulKum | ||
// | ||
// Created by YOUJIM on 7/12/24. | ||
// | ||
|
||
import UIKit | ||
|
||
class CreateGroupView: BaseView { | ||
private let mainTitleLabel: UILabel = UILabel().then { | ||
$0.setText("모임 이름을\n입력해 주세요", style: .head01) | ||
} | ||
|
||
let nameTextField: CustomTextField = CustomTextField( | ||
placeHolder: "모임 이름을 입력해 주세요" | ||
) | ||
|
||
let characterLabel: UILabel = UILabel().then { | ||
$0.setText("0/10", style: .body06, color: .gray3) | ||
} | ||
|
||
let presentButton: CustomButton = CustomButton( | ||
title: "다음", | ||
isEnabled: false | ||
) | ||
|
||
override func setupView() { | ||
addSubviews( | ||
mainTitleLabel, | ||
nameTextField, | ||
characterLabel, | ||
presentButton | ||
) | ||
} | ||
|
||
override func setupAutoLayout() { | ||
mainTitleLabel.snp.makeConstraints { | ||
$0.top.equalTo(safeAreaLayoutGuide).offset(32) | ||
$0.leading.equalToSuperview().offset(20) | ||
} | ||
|
||
nameTextField.snp.makeConstraints { | ||
$0.top.equalTo(mainTitleLabel.snp.bottom).offset(24) | ||
$0.width.equalTo(CustomTextField.defaultWidth) | ||
$0.height.equalTo(CustomTextField.defaultHeight) | ||
$0.leading.equalTo(mainTitleLabel) | ||
} | ||
|
||
characterLabel.snp.makeConstraints { | ||
$0.centerY.equalTo(nameTextField) | ||
$0.trailing.equalTo(nameTextField.snp.trailing).inset(12) | ||
} | ||
|
||
presentButton.snp.makeConstraints { | ||
$0.bottom.equalToSuperview().inset(50) | ||
$0.horizontalEdges.equalToSuperview().inset(14) | ||
$0.height.equalTo(Screen.height(50)) | ||
} | ||
} | ||
} |
Oops, something went wrong.