-
Notifications
You must be signed in to change notification settings - Fork 79
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
[Team01][iOS] 로그인 기능 구현, SPM 적용 및 임시 달력 적용 #310
base: team01
Are you sure you want to change the base?
Changes from all commits
002d9e2
73051cf
f5fc894
85138b5
1ad34ad
a14ba9a
e620030
8a9d0d8
8e8b9f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "alamofire", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/Alamofire/Alamofire.git", | ||
"state" : { | ||
"revision" : "354dda32d89fc8cd4f5c46487f64957d355f53d8", | ||
"version" : "5.6.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "fscalendar", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/WenchaoD/FSCalendar.git", | ||
"state" : { | ||
"revision" : "0fbdec5172fccb90f707472eeaea4ffe095278f6", | ||
"version" : "2.8.4" | ||
} | ||
}, | ||
{ | ||
"identity" : "horizoncalendar", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/airbnb/HorizonCalendar.git", | ||
"state" : { | ||
"revision" : "93b188c52650b3999eeb20cf256b69715de515ef", | ||
"version" : "1.13.4" | ||
} | ||
}, | ||
{ | ||
"identity" : "snapkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/SnapKit/SnapKit.git", | ||
"state" : { | ||
"revision" : "f222cbdf325885926566172f6f5f06af95473158", | ||
"version" : "5.6.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "GitHub-Emblem.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Google_Logo.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// CalendarViewController.swift | ||
// airbnb | ||
// | ||
// Created by Jihee hwang on 2022/06/07. | ||
// | ||
|
||
import UIKit | ||
import SnapKit | ||
import FSCalendar | ||
|
||
final class CalendarViewController: UIViewController { | ||
|
||
private let clearButton: UIBarButtonItem = { | ||
let buttonItem = UIBarButtonItem(title: "지우기", style: .plain, target: nil, action: nil) | ||
buttonItem.tintColor = .gray3 | ||
return buttonItem | ||
}() | ||
|
||
private let nextButton: UIBarButtonItem = { | ||
let buttonItem = UIBarButtonItem(title: "다음", style: .plain, target: nil, action: nil) | ||
buttonItem.tintColor = .black | ||
return buttonItem | ||
}() | ||
|
||
private lazy var toolBar: UIToolbar = { | ||
let toolBar = UIToolbar() | ||
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: self, action: nil) | ||
toolBar.setItems([clearButton, flexibleSpace, nextButton], animated: true) | ||
return toolBar | ||
}() | ||
|
||
private let calendarView = FSCalendar(frame: .zero) | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
configureView() | ||
layout() | ||
} | ||
|
||
override func viewWillDisappear(_ animated: Bool) { | ||
super.viewWillDisappear(false) | ||
navigationController?.tabBarController?.tabBar.isHidden = false | ||
Comment on lines
+42
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. animated는 무조건 false로 하는 걸까요? |
||
} | ||
|
||
private func configureView() { | ||
view.backgroundColor = .white | ||
title = "숙소 찾기" | ||
|
||
navigationController?.tabBarController?.tabBar.isHidden = true | ||
} | ||
|
||
private func layout() { | ||
view.addSubview(toolBar) | ||
view.addSubview(calendarView) | ||
|
||
toolBar.snp.makeConstraints { | ||
$0.bottom.leading.trailing.equalTo(view.safeAreaLayoutGuide) | ||
} | ||
|
||
calendarView.snp.makeConstraints { | ||
$0.top.leading.trailing.bottom.equalTo(view.safeAreaLayoutGuide) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이렇게 모든 변에 같은 constraint를 설정하는 경우에는 edges를 사용할 수 있습니다 :) |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// LoginViewController.swift | ||
// airbnb | ||
// | ||
// Created by Jihee hwang on 2022/06/10. | ||
// | ||
|
||
import UIKit | ||
import SnapKit | ||
|
||
final class LoginViewController: UIViewController { | ||
|
||
private let gitHubLoginButton: UIButton = { | ||
var config = UIButton.Configuration.bordered() | ||
config.baseBackgroundColor = .white | ||
config.cornerStyle = .capsule | ||
config.background.cornerRadius = 20 | ||
config.background.strokeColor = .line | ||
config.baseForegroundColor = .black | ||
config.image = UIImage(named: "GitHub_Logo") | ||
config.imagePadding = 10 | ||
config.imagePlacement = .leading | ||
|
||
let button = UIButton(configuration: config) | ||
button.addTarget(self, action: #selector(didTabGithubLogin(_:)), for: .touchUpInside) | ||
return button | ||
}() | ||
|
||
private let googleLoginButton: UIButton = { | ||
var config = UIButton.Configuration.bordered() | ||
config.baseBackgroundColor = .white | ||
config.cornerStyle = .capsule | ||
config.background.cornerRadius = 20 | ||
config.background.strokeColor = .line | ||
config.baseForegroundColor = .black | ||
config.image = UIImage(named: "Google_Logo") | ||
config.imagePadding = 10 | ||
config.imagePlacement = .leading | ||
|
||
let button = UIButton(configuration: config) | ||
button.addTarget(self, action: #selector(didTabGithubLogin(_:)), for: .touchUpInside) | ||
return button | ||
}() | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
configureView() | ||
layout() | ||
} | ||
|
||
private func configureView() { | ||
view.backgroundColor = .white | ||
title = "로그인" | ||
navigationItem.backBarButtonItem = UIComponents.backButton | ||
|
||
navigationController?.tabBarController?.tabBar.isHidden = true | ||
} | ||
|
||
private func layout() { | ||
view.addSubview(UIComponents.navigationBarUnderLineView) | ||
view.addSubview(gitHubLoginButton) | ||
view.addSubview(googleLoginButton) | ||
|
||
UIComponents.navigationBarUnderLineView.snp.makeConstraints { | ||
$0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) | ||
$0.height.equalTo(1) | ||
} | ||
|
||
gitHubLoginButton.snp.makeConstraints { | ||
$0.centerX.equalToSuperview() | ||
$0.centerY.equalToSuperview().offset(-40) | ||
$0.width.equalTo(300) | ||
$0.height.equalTo(60) | ||
} | ||
|
||
googleLoginButton.snp.makeConstraints { | ||
$0.centerX.equalToSuperview() | ||
$0.centerY.equalToSuperview().offset(40) | ||
$0.width.equalTo(300) | ||
$0.height.equalTo(60) | ||
} | ||
Comment on lines
+69
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이런 경우에는 StackView를 만들어서 묶어주는 것도 좋아 보입니다! |
||
} | ||
|
||
@objc func didTabGithubLogin(_ sender: Any) { | ||
LoginManager.shared.requestCode() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
View가 Static하게 선언된다면 해당 View를 사용하는 모든 곳에서 변경 사항의 영향을 받게될 것 같네요..!
View의 생성 코드를 줄이고 싶으신 의도라면 factory method를 작성하는 게 방법이 될 것 같습니다.