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

[fix] 코딩 컨벤션 맞추기 #169

Merged
merged 5 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
204 changes: 138 additions & 66 deletions KkuMulKum.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion KkuMulKum/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}

// 카카오 로그인
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
func application(
_ app: UIApplication,
Copy link
Member

Choose a reason for hiding this comment

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

갱!

open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
if AuthApi.isKakaoTalkLoginUrl(url) {
return AuthController.handleOpenUrl(url: url)
}
Expand Down
6 changes: 3 additions & 3 deletions KkuMulKum/Source/Core/MainTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class MainTabBarController: UITabBarController {
$0.tabBarItem.image = .iconHome
}

let groupListViewController: MeetingListViewController = MeetingListViewController().then {
let meetingListViewController: MeetingListViewController = MeetingListViewController().then {
$0.tabBarItem.title = "내 모임"
$0.tabBarItem.image = .iconGroup
}
Expand All @@ -54,7 +54,7 @@ final class MainTabBarController: UITabBarController {
$0.navigationBar.tintColor = .black
}

let groupListNavigationController = UINavigationController(rootViewController: groupListViewController).then {
let meetingListNavigationController = UINavigationController(rootViewController: meetingListViewController).then {
$0.navigationBar.topItem?.backButtonDisplayMode = .minimal
$0.navigationBar.tintColor = .black
}
Expand All @@ -66,7 +66,7 @@ final class MainTabBarController: UITabBarController {

setViewControllers([
homeNavigationController,
groupListNavigationController,
meetingListNavigationController,
myPageViewNavigationController
], animated: true)
}
Expand Down

This file was deleted.

5 changes: 4 additions & 1 deletion KkuMulKum/Source/Home/View/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ final class HomeView: BaseView {
}

private let promiseView = UIView(backgroundColor: .gray0).then {
$0.roundCorners(cornerRadius: 16, maskedCorners: [.layerMinXMinYCorner, .layerMaxXMinYCorner])
$0.roundCorners(
cornerRadius: 16,
maskedCorners: [.layerMinXMinYCorner, .layerMaxXMinYCorner]
)
}

private let todayLabel = UILabel().then {
Expand Down
81 changes: 48 additions & 33 deletions KkuMulKum/Source/Home/ViewController/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,22 @@ class HomeViewController: BaseViewController {
self.view = rootView
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(false)
navigationController?.isNavigationBarHidden = true
}

override func viewDidLoad() {
super.viewDidLoad()

view.backgroundColor = .white
register()
setupDelegate()
setupAction()

register()
updateUI()
updateUpcomingPromise()
viewModel.dummy()
}


// MARK: - Function

private func register() {
rootView.upcomingPromiseView.register(UpcomingPromiseCollectionViewCell.self,
forCellWithReuseIdentifier: UpcomingPromiseCollectionViewCell.reuseIdentifier
)
}

override func setupDelegate() {
rootView.upcomingPromiseView.delegate = self
rootView.upcomingPromiseView.dataSource = self
rootView.scrollView.delegate = self
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.isNavigationBarHidden = true
}


// MARK: - Function

override func setupAction() {
rootView.todayPromiseView.prepareButton.addTarget(
self,
Expand All @@ -83,6 +63,24 @@ class HomeViewController: BaseViewController {
)
}

override func setupDelegate() {
rootView.upcomingPromiseView.delegate = self
rootView.upcomingPromiseView.dataSource = self
rootView.scrollView.delegate = self
}


// MARK: - Function

private func register() {
rootView.upcomingPromiseView.register(UpcomingPromiseCollectionViewCell.self,
forCellWithReuseIdentifier: UpcomingPromiseCollectionViewCell.reuseIdentifier
)
}


// MARK: - Function
Copy link
Member

Choose a reason for hiding this comment

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

Function 마크 주석이 두 번 들어가서 이 주석은 삭제해도 좋을 것 같습니다!


private func setDisableButton(_ sender: UIButton) {
sender.setTitleColor(.gray3, for: .normal)
sender.layer.borderColor = UIColor.gray3.cgColor
Expand Down Expand Up @@ -222,32 +220,49 @@ class HomeViewController: BaseViewController {
}


// MARK: - UICollectionViewDelegate
// MARK: - UICollectionViewDelegateFlowLayout

extension HomeViewController: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath) -> CGSize {
func collectionView(
_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath
) -> CGSize {
return CGSize(width: cellWidth, height: cellHeight)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
minimumLineSpacingForSectionAt section: Int) -> CGFloat {
func collectionView(
_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
minimumLineSpacingForSectionAt section: Int
) -> CGFloat {
return contentInterSpacing
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
func collectionView(
_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
insetForSectionAt section: Int
) -> UIEdgeInsets {
return contentInset
}
}

extension HomeViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
func collectionView(
_ collectionView: UICollectionView,
numberOfItemsInSection section: Int
) -> Int {
return viewModel.upcomingPromiseData.value.count
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
func collectionView(
_ collectionView: UICollectionView,
cellForItemAt indexPath: IndexPath
) -> UICollectionViewCell {
guard let cell = collectionView.dequeueReusableCell(
withReuseIdentifier: UpcomingPromiseCollectionViewCell.reuseIdentifier, for: indexPath
withReuseIdentifier: UpcomingPromiseCollectionViewCell.reuseIdentifier,
for: indexPath
) as? UpcomingPromiseCollectionViewCell else { return UICollectionViewCell() }
cell.dataBind(viewModel.upcomingPromiseData.value[indexPath.item])
return cell
Expand Down
1 change: 0 additions & 1 deletion KkuMulKum/Source/Home/ViewModel/HomeViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ enum ReadyState {

final class HomeViewModel {
var currentState = ObservablePattern<ReadyState>(.none)
//var upComingPromiseData = ObservablePattern<[UpcomingPromiseModel]>(UpcomingPromiseModel.dummy())
var upcomingPromiseData = ObservablePattern<[UpcomingPromiseModel]>([])

var homePrepareTime: String = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class CheckInviteCodeView: BaseView {
$0.setJoinButtonViewStatus(isReceived: true)
}

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

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

Expand All @@ -41,7 +41,7 @@ class CheckInviteCodeView: BaseView {
$0.leading.trailing.equalToSuperview().inset(20)
}

createGroupView.snp.makeConstraints {
createMeetingView.snp.makeConstraints {
$0.top.equalTo(enterInviteCodeView.snp.bottom).offset(12)
$0.leading.trailing.equalToSuperview().inset(20)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ class JoinButtonView: BaseView {
}

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)
}
subTitleLabel.setText(
isReceived ? "초대 코드를 받았다면" : "초대 코드가 없다면",
Copy link
Member

Choose a reason for hiding this comment

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

생각보다 엄청 간단하게 삼항연산자를 구현할 수 있었네요 ,,, 감사합니다!

style: .caption02,
color: .gray5
)

mainTitleLabel.setText(
isReceived ? "초대 코드 입력하기" : "직접 모임 추가하기",
style: .body03,
color: .gray8
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,35 @@ class CheckInviteCodeViewController: BaseViewController {
target: self,
action: #selector(inviteCodeViewDidTap)
))
checkInviteCodeView.createGroupView.addGestureRecognizer(UITapGestureRecognizer(
checkInviteCodeView.createMeetingView.addGestureRecognizer(UITapGestureRecognizer(
target: self,
action: #selector(createGroupViewDidTap)
action: #selector(createMeetingViewDidTap)
))
}

@objc private func inviteCodeViewDidTap() {
let inviteCodeViewController = InviteCodeViewController()
let inviteCodeViewController = InviteCodeViewController(
viewModel: InviteCodeViewModel(
service: MockInviteCodeService()
)
)

inviteCodeViewController.modalTransitionStyle = .crossDissolve
inviteCodeViewController.modalPresentationStyle = .fullScreen

navigationController?.pushViewController(inviteCodeViewController, animated: true)
}

@objc private func createGroupViewDidTap() {
let createGroupViewController = CreateGroupViewController()
@objc private func createMeetingViewDidTap() {
let createMeetingViewController = CreateMeetingViewController(
viewModel: CreateMeetingViewModel(
service: CreateMeetingService()
)
)

createGroupViewController.modalTransitionStyle = .crossDissolve
createGroupViewController.modalPresentationStyle = .fullScreen
createMeetingViewController.modalTransitionStyle = .crossDissolve
createMeetingViewController.modalPresentationStyle = .fullScreen

navigationController?.pushViewController(createGroupViewController, animated: true)
navigationController?.pushViewController(createMeetingViewController, animated: true)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// CreateMeetingService.swift
// KkuMulKum
//
// Created by YOUJIM on 7/13/24.
//

import Foundation

protocol CreateMeetingServiceType {

}

final class CreateMeetingService: CreateMeetingServiceType {

}

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// CreateGroupView.swift
// CreateMeetingView.swift
// KkuMulKum
//
// Created by YOUJIM on 7/12/24.
//

import UIKit

class CreateGroupView: BaseView {
class CreateMeetingView: BaseView {
private let mainTitleLabel: UILabel = UILabel().then {
$0.setText("모임 이름을\n입력해 주세요", style: .head01)
}
Expand Down
Loading