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

Feature/1st assignment #5

Merged
merged 28 commits into from
Oct 11, 2021
Merged

Feature/1st assignment #5

merged 28 commits into from
Oct 11, 2021

Conversation

YoonAh-dev
Copy link
Member

๐Ÿ“Œ ๊ด€๋ จ ์ด์Šˆ

close #1
close #2
close #3
close #4

๐Ÿ“Œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ ๋ฐ ์ด์œ 

1์ฃผ์ฐจ ๊ณผ์ œ๋ฅผ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ“Œ PR Point

  • iOS 15.0๋ฅผ ๋ฐ˜์˜ํ•ด์„œ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ดœ์ฐฎ์€์ง€ ๋ด์ฃผ์„ธ์š”!!

๐Ÿ“Œ ์ฐธ๊ณ  ์‚ฌํ•ญ

์—†์Šต๋‹ˆ๋‹ค~

Copy link

@pcsoyeon pcsoyeon left a comment

Choose a reason for hiding this comment

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

LGTM ๐Ÿ’–

@@ -104,6 +98,27 @@ class SignupVC: UIViewController {
passwordTextfield.delegate = self
}

private func setupButtonState(_ button: UIButton) {
if #available(iOS 15.0, *) {

Choose a reason for hiding this comment

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

์˜คํ˜ธ .. ์ด ๋ถ€๋ถ„์ธ๊ฐ€์š” ..

Copy link
Member Author

Choose a reason for hiding this comment

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

15.0 ์ •๋ง ์ง•ํ•˜๋„ค์š”..๐Ÿฅฒ

Copy link

@loinsir loinsir left a comment

Choose a reason for hiding this comment

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

์ฒซ ์ฝ”๋“œ ๋ฆฌ๋ทฐ ๋‚จ๊ฒจ๋ด…๋‹ˆ๋‹ค ใ…Žใ…Ž ๋ณ„๋กœ ๋„์›€์ด ์•ˆ๋ ์ง€๋ผ๋„ ์ž˜๋ถ€ํƒ ๋“œ๋ ค์—ฌ

let navi = UINavigationController.init(rootViewController: LoginVC())
window.rootViewController = navi
window.makeKeyAndVisible()
window.backgroundColor = .white
Copy link

Choose a reason for hiding this comment

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

์—ฌ๊ธฐ์„œ window์˜ backgroundColor๋ฅผ white๋กœ ์ง€์ •ํ•ด ์ค€ ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”? systemBackground๋Š” ์•ˆ๋ ๊นŒ์š”...?

Copy link
Member

Choose a reason for hiding this comment

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

๊ณ ๊ฑฐ ๋‚˜๋„ ์ข€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.. ์•„๋ฆ๊นŒ๋ฆ..๐Ÿ˜ตโ€๐Ÿ’ซ๐Ÿ˜ตโ€๐Ÿ’ซ

Copy link
Member Author

Choose a reason for hiding this comment

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

์—ฌ๊ธฐ์„œ window์˜ backgroundColor๋ฅผ white๋กœ ์ง€์ •ํ•ด ์ค€ ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”? systemBackground๋Š” ์•ˆ๋ ๊นŒ์š”...?

systemBackground๋„ ์ƒ๊ด€์—†์Šต๋‹ˆ๋‹ค!
์ € ๋ถ€๋ถ„์€ View์˜ ์ง„์ž…์ ์ด ๋˜๋Š” rootViewController์ธ navi์˜ ๋ฐฐ๊ฒฝ์ƒ‰์„ ์ง€์ •ํ•ด์ฃผ๋Š” ๋ถ€๋ถ„์ธ๋ฐ ์–ด์ฐจํ”ผ ์ด๋ฒˆ ๊ณผ์ œ์—์„œ ๋‹คํฌ๋ชจ๋“œ๋ฅผ ๊ตฌํ˜„ํ•  ํ•„์š”๋„ ์—†๊ณ  ๊ทธ๋ž˜์„œ white๋กœ ๋ฐฐ๊ฒฝ์ƒ‰์„ ์ง€์ •ํ•ด์ค€๊ฑฐ์˜ˆ์š”.
๋งŒ์•ฝ์— ๋‹คํฌ๋ชจ๋“œ๋ฅผ ๊ตฌํ˜„ํ•ด์•ผํ•œ๋‹ค๋ฉด systemBackground๋กœ ํ•˜๋Š” ๊ฒŒ ๋งž์ง€๋งŒ ๊ทธ๊ฒŒ ์•„๋‹ˆ๋ผ๋ฉด white๋‚˜ systemBackground๋‚˜ ์ƒ๊ด€์ด ์—†์–ด์„œ white๋กœ ์ƒ‰์„ ์ง€์ •ํ•ด์คฌ์Šต๋‹ˆ๋‹ค!

Comment on lines +79 to +103
logoLabel.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(view.safeAreaLayoutGuide).inset(30)
}
titleLabel.snp.makeConstraints {
$0.centerX.equalToSuperview()
$0.top.equalTo(logoLabel.snp.bottom).offset(15)
}
infoLabel.snp.makeConstraints {
$0.top.equalTo(titleLabel.snp.bottom).offset(40)
$0.leading.trailing.equalToSuperview().inset(20)
}
loginStackView.snp.makeConstraints {
$0.top.equalTo(infoLabel.snp.bottom).offset(40)
$0.leading.trailing.equalToSuperview().inset(30)
}
signupButton.snp.makeConstraints {
$0.top.equalTo(loginStackView.snp.bottom).offset(75)
$0.leading.equalToSuperview().inset(30)
}
signinButton.snp.makeConstraints {
$0.top.equalTo(loginStackView.snp.bottom).offset(70)
$0.trailing.equalToSuperview().inset(30)
$0.width.equalTo(70)
$0.height.equalTo(35)
Copy link

Choose a reason for hiding this comment

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

snapKit์„ ์‚ฌ์šฉํ•˜๋ฉด ์ด๋Ÿฐ์‹์œผ๋กœ ๊น”๋”ํ•˜๊ฒŒ ์ฝ”๋“œ๋กœ ์˜คํ† ๋ ˆ์ด์•„์›ƒ์„ ์žก์„ ์ˆ˜ ์žˆ๊ตฐ์š”?! ์ €๋„ ๋‹ค์Œ ๊ณผ์ œ์—์„œ ์จ๋จน์–ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!

Copy link
Member Author

Choose a reason for hiding this comment

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

๊น”๋”ํ•˜๊ฒŒ ์˜คํ† ๋ฅผ ์žก์„ ์ˆ˜ ์žˆ์ง€๋งŒ ์Šคํ† ๋ฆฌ๋ณด๋“œ๊ฐ€ ์žˆ๋‹ค๋ฉด ์Šคํ† ๋ฆฌ๋ณด๋“œ์—์„œ ์žก์•„์ฃผ๋Š” ๊ฒŒ ์ œ์ผ ์ข‹์Šต๋‹ˆ๋‹ค!
์ €๋Š” ์Šคํ† ๋ฆฌ๋ณด๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„์„œ ์ฝ”๋“œ๋กœ ๋ ˆ์ด์•„์›ƒ์„ ์ง์ ‘ ๊ตฌํ˜„ํ•ด์ค€๊ฒ๋‹ˆ๋‹ค!
์žˆ๋‹ค๋ฉด ์Šค๋ณด์—์„œ ํ•˜๋Š”๊ฒŒ ์ œ์ผ ๋ฒ ์ŠคํŠธ์ž…๋‹ˆ๋‹ค!!๐Ÿ‘

Comment on lines 142 to 147
if let isNameEmpty = nameTextfield.text?.isEmpty,
let isAccountEmpty = accountTextfield.text?.isEmpty,
let isPasswordEmpty = passwordTextfield.text?.isEmpty {
if isNameEmpty || isAccountEmpty || isPasswordEmpty {
signinButton.isEnabled = false
signinButton.backgroundColor = .lightGray
Copy link

Choose a reason for hiding this comment

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

Suggested change
if let isNameEmpty = nameTextfield.text?.isEmpty,
let isAccountEmpty = accountTextfield.text?.isEmpty,
let isPasswordEmpty = passwordTextfield.text?.isEmpty {
if isNameEmpty || isAccountEmpty || isPasswordEmpty {
signinButton.isEnabled = false
signinButton.backgroundColor = .lightGray
if nameTextfield.hasText &&
accountTextfield.hasText &&
passwordTextfield.hasText {
signinButton.isEnabled = false
signinButton.backgroundColor = .lightGray

UITextfield.text?.isEmpty ๋ณด๋‹ค๋Š” UITextfield.hasText ์†์„ฑ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š”???

Copy link
Member Author

Choose a reason for hiding this comment

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

์š”๋Ÿฐ ์ง€์  ๋„ˆ๋ฌด ์ข‹์Šต๋‹ˆ๋‹ค๐Ÿ‘ ๋ฐ˜์˜ํ•ด์„œ ๋จธ์ง€ํ• ๊ฒŒ์š”!

Comment on lines +11 to +13
func addSubviews(_ views: [UIView]) {
views.forEach { self.addSubview($0) }
}
Copy link

Choose a reason for hiding this comment

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

forEach๋กœ ํ•œ๋ฒˆ์— ์ถ”๊ฐ€ํ•˜๋Š” ๋กœ์ง์„ extension์„ ํ†ตํ•ด ๊ตฌํ˜„ํ•˜์…จ๋„ค์š” ๊ธฐ๋ฐœํ•ฉ๋‹ˆ๋‹ค.๐Ÿ‘ ์ €๋„ extension ์ž˜ ์จ๋จน์–ด ๋ณผ๊ฒŒ์š”!

Comment on lines +48 to +50
private let nameTextfield = LoginTextField(placeholder: "์ด๋ฆ„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”")
private let accountTextfield = LoginTextField(placeholder: "์ด๋ฉ”์ผ ๋˜๋Š” ํœด๋Œ€์ „ํ™”")
private let passwordTextfield = LoginTextField(placeholder: "๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ", isSecureTextEntry: true)
Copy link

Choose a reason for hiding this comment

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

textfield๋ฅผ ์ปค์Šคํ…€ ํ•˜์‹ ๊ฒŒ ์ธ์ƒ๊นŠ์–ด์š”๐Ÿ˜

Comment on lines +16 to +20
private let logoLabel = UILabel().then {
$0.text = "Google"
$0.font = .boldSystemFont(ofSize: 40)
$0.textColor = .black
}
Copy link

Choose a reason for hiding this comment

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

then ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ง๋กœ๋งŒ ๋“ค์—ˆ์—ˆ๋Š”๋ฐ ์ƒ๋‹นํžˆ ์ฝ”๋“œ๊ฐ€ ๊ฐ„๊ฒฐํ•ด์ง€๋„ค์š”. ๋‹ค์Œ ๊ณผ์ œ ๋ถ€ํ„ฐ ์ ์šฉํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!

Copy link
Member

Choose a reason for hiding this comment

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

์ธํ™˜์„ ๋ฐฐ์•ผ ์ค‘์ดˆ๋ณด ์Šคํ„ฐ๋”” ๋•Œ๋„ ๋งํ–ˆ์ง€๋งŒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์“ฐ์ง€ ์•Š๊ณ  ๊ทธ๋ƒฅ ๊ตฌํ˜„ํ•ด๋ณด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•ด!
๊ทธ๋ฆฌ๊ณ  ๋‚˜์„œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์จ๋„ ์ถฉ๋ถ„ํ•ด!
๋‚˜๋Š” ์†๋ฐฐ์˜ ๊ณจ๋“œ๊ทธ๋ž˜์ŠคํŒŒ๊ฐ€ ์•„๋‹ˆ์ง€๋งŒ... ์ฝ์–ด๋ณด๋ฉด ์ข‹์„ ๊ฑฐ ๊ฐ™์•„์„œ
https://brunch.co.kr/@advisor/11

Copy link

Choose a reason for hiding this comment

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

@heerucan ์ข‹์€ ์ง€์  ๊ณ ๋งˆ์šฐ~

Copy link
Member

@seondal seondal left a comment

Choose a reason for hiding this comment

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

๊ฐ™์€ ๊ณผ์ œ๋ฅผ ํ–ˆ๋Š”๋ฐ.. ์ „ํ˜€ ๋‹ค๋ฅธ ์ฝ”๋“œ์˜ ์ˆ˜์ค€์„ ๋ณด๋ฉฐ ์ •๋ง ๋†€๋ž์–ด์š”.... ์œค์•„๋‹˜ ์ฝ”๋“œ ํ†ตํ•ด์„œ ์Šคํ† ๋ฆฌ๋ณด๋“œ ์—†์ด ์ƒ์ฝ”๋“œ๋กœ ๊ฐœ๋ฐœํ•œ๊ฑธ ์ง์ ‘ ๋ณด๋ฉด์„œ ์ •๋ง ๋งŽ์€ ๊ฑธ ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค.. ์กด๊ฒฝํ•ด์š”ใ… ใ…‡ใ… 

Comment on lines +9 to 10
|`1์ฃผ์ฐจ`| iOS ์ปดํฌ๋„ŒํŠธ ์ดํ•ด, Xcode ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•, View ํ™”๋ฉด ์ „ํ™˜| [feature/1st-Assignment](https://github.com/29th-WE-SOPT-iOS-Part/ShinYunA/tree/feature/1st-Assignment) | | [๐Ÿ’Basic](https://github.com/29th-WE-SOPT-iOS-Part/ShinYunA/blob/feature/second-seminar/README/Assignment1-Basic.md) <br/> [โœˆ๏ธAdvanced](https://github.com/29th-WE-SOPT-iOS-Part/ShinYunA/blob/feature/second-seminar/README/Assignment1-Advanced.md) |
|`2์ฃผ์ฐจ`| AutoLayout, StackView, TabBarController | | | |
Copy link
Member

Choose a reason for hiding this comment

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

์ด ๊นƒํ—ˆ๋ธŒ ๋งํฌ๋Š” ์–ด๋””์— ์—ฐ๊ฒฐ๋˜๋Š”๊ฑด์ง€ ๊ถ๊ธˆํ•ด์š”..!

Copy link
Member

Choose a reason for hiding this comment

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

๊ทธ๋Ÿฌ๊ฒŒ ์ €๋‘ ๊ถ๊ธˆํ•œ๋ฐ ํ˜น์‹€.. ๋…ธ์…˜๋งํฌ ์ข€ ์ „๋ถ€ ๋‹ค.. ์ฃผ์‹œ๊ฒŒ์จ์—ฌ?๐Ÿฅถ๐Ÿฅถ

Copy link
Member Author

Choose a reason for hiding this comment

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

์ œ๊ฐ€ ๋งŒ๋“  READMEํŒŒ์ผ์— ์ž‘์„ฑํ•ด๋‘” ๊ณผ์ œ ๋ฆฌ๋“œ๋ฏธ๋ฅผ ์ €์žฅํ•ด๋‘๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค!
๊ทธ๊ณณ์œผ๋กœ ์ด๋™ํ•ด์ฃผ๋Š” ๋งํฌ์ž…๋‹ˆ๋‹ค!!

@@ -1 +1,5 @@
## 1์ฃผ์ฐจ - iOS Assignment(๋„์ „๊ณผ์ œ)

๐Ÿ’ [1์ฃผ์ฐจ ๊ณผ์ œ - Advanced ๋…ธ์…˜ ์ •๋ฆฌ >>>>>](https://yxxnaxxin.notion.site/1-bc06e54b37c44fada320440dd908759e)
Copy link
Member

Choose a reason for hiding this comment

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

๋…ธ์…˜์ด๋ž‘ ๋ฆฌ๋“œ๋ฏธ ์ด๋ ‡๊ฒŒ ์˜ˆ์˜๊ฒŒ ์ •๋ฆฌํ•˜์‹œ๋Š”๊ฑฐ ๋ณธ๋ฐ›๊ณ  ์‹ถ์–ด์š”..

Comment on lines +1 to +11
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Copy link
Member

Choose a reason for hiding this comment

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

์Šคํ† ๋ฆฌ๋ณด๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์ƒ ์ฝ”๋“œ๋กœ๋งŒ ์ž‘์„ฑํ•˜์‹œ๋Š” ์ด์œ ๊ฐ€ ๋”ฐ๋กœ ์žˆ์œผ์‹ค๊นŒ์š”?!

Copy link
Member Author

Choose a reason for hiding this comment

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

์ฝ”๋“œ๋กœ๋งŒ ์ž‘์„ฑํ•˜๋Š” ์ด์œ ๊ฐ€ ์žˆ๋‹ค๋ฉด

  • ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์ƒ๊ฒผ์„ ๋•Œ ์Šคํ† ๋ฆฌ๋ณด๋“œ๋ณด๋‹ค ์ˆ˜์ •ํ•˜๊ธฐ ์ข‹์•„์š”!
  • UI์†์„ฑ๋“ค์„ ๋ณด๊ธฐ ์œ„ํ•ด์„œ ์Šคํ† ๋ฆฌ๋ณด๋“œ๋กœ ์™”๋‹ค๊ฐ”๋‹ค ํ•˜๋Š” ๊ฒŒ ์‹ซ์–ด์š”..๐Ÿฅฒ
  • storyboard, xib๊นŒ์ง€ ์ƒ๊ธฐ๋ฉด์„œ Resource ํŒŒ์ผ ์ž์ฒด์˜ ํฌ๊ธฐ๊ฐ€ ์ปค์ง€๋Š” ๊ฒŒ ์‹ซ์–ด์š”..๐Ÿฅฒ
  • ๋ณต์žกํ•œ ๋ ˆ์ด์•„์›ƒ์— ๊ฒฝ์šฐ์—๋Š” ์Šคํ† ๋ฆฌ๋ณด๋“œ์™€ ์ฝ”๋“œ๋ฅผ ๋ชจ๋‘ ์จ์„œ ๋ ˆ์ด์•„์›ƒ์„ ์žก๋Š”๋ฐ "๊ทธ๋Ÿด๋ฐ”์—๋Š” ์ฝ”๋“œ๋กœ๋งŒ ์งœ์ง€" ๋ผ๊ณ  ์ƒ๊ฐ์ด ๋“ญ๋‹ˆ๋‹ค!

์ €์ŠคํŠธ ์ €์˜ ์ƒ๊ฐ์ž…๋‹ˆ๋‹ค..๐Ÿ™„
์Šคํ† ๋ฆฌ๋ณด๋“œ๋„, ์ฝ”๋“œ๋„ ๋‹ค ํ•  ์ค„ ์•Œ์•„์•ผํ•˜๊ณ  ๋ญ ํ•˜๋‚˜ ์•ˆ ์ข‹์€ ๊ฒŒ ์•„๋‹ˆ๋‹ˆ ์Šค๋ณด ๋งŽ์ด ๋งŽ์ด ์‚ฌ๋ž‘ํ•ด์ฃผ์„ธ์š”.. ๐Ÿ™Œ

Choose a reason for hiding this comment

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

์œค์•„์–ธ๋‹ˆ์˜ ๋ง์— ๋ง๋ถ™์—ฌ์„œ ์Šค๋ณด/์ฝ”๋“œ ํŒ€์˜ ํ˜‘์—… ์Šคํƒ€์ผ, ์„œ๋น„์Šค ๊ทœ๋ชจ, ๋ทฐ์˜ ๊ตฌ์„ฑ ๋“ฑ๋“ฑ ์ƒํ™ฉ์— ๋”ฐ๋ผ ์ ์žฌ์ ์†Œ์— ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค ~ ๋ญ๋“  .. no ๋งน์‹  .. It's up to you ..

Copy link
Member

@heerucan heerucan left a comment

Choose a reason for hiding this comment

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

๋“€๋‚˜๋ ˆ์ด๋”” ๋•์— ๋‚ด ์ž”๋””๋Š” ์˜ค๋Š˜๋„ ์‘ฅ์‘ฅ ์ž๋ผ๋‚˜.. ๊ทธ๋‚˜์ €๋‚˜ ์—ฌ์ „ํžˆ ์†๋ฐฐ ์ฝ”๋“œ๋Š” ๊ฐˆ๊ณฐ๊ฐˆ๊ณฐํ•˜๋„ค..
๋‚˜๋ ˆ์ด๋”” ์šฐ๋ฆฌ ์บ์น˜๋ฏธ์คŒ๋ณด๊ฑธ์ฆˆ-๋“€๋‚˜๊ฑธํ•œํ…Œ๋Š” ํ•ญ์‹œ ๋ฐœ๋„์žฅ์„ ์ฐ๊ณ  ๊ฐ€~^^*

Comment on lines +9 to 10
|`1์ฃผ์ฐจ`| iOS ์ปดํฌ๋„ŒํŠธ ์ดํ•ด, Xcode ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•, View ํ™”๋ฉด ์ „ํ™˜| [feature/1st-Assignment](https://github.com/29th-WE-SOPT-iOS-Part/ShinYunA/tree/feature/1st-Assignment) | | [๐Ÿ’Basic](https://github.com/29th-WE-SOPT-iOS-Part/ShinYunA/blob/feature/second-seminar/README/Assignment1-Basic.md) <br/> [โœˆ๏ธAdvanced](https://github.com/29th-WE-SOPT-iOS-Part/ShinYunA/blob/feature/second-seminar/README/Assignment1-Advanced.md) |
|`2์ฃผ์ฐจ`| AutoLayout, StackView, TabBarController | | | |
Copy link
Member

Choose a reason for hiding this comment

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

๊ทธ๋Ÿฌ๊ฒŒ ์ €๋‘ ๊ถ๊ธˆํ•œ๋ฐ ํ˜น์‹€.. ๋…ธ์…˜๋งํฌ ์ข€ ์ „๋ถ€ ๋‹ค.. ์ฃผ์‹œ๊ฒŒ์จ์—ฌ?๐Ÿฅถ๐Ÿฅถ

}
}

internal extension UIColor {
Copy link
Member

Choose a reason for hiding this comment

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

์ด internal ํ‚ค์›Œ๋“œ๋Š” ๋ชจ๋ž€ ๋ง์•ผ!
ํ•ด๋‹น ๋ชจ๋“ˆ ์™ธ๋ถ€์—์„œ๋Š” ์‚ฌ์šฉ๋˜์ง€ ์•Š๊ฒŒ ํ•˜๊ธฐ ์œ„ํ•ด์„œ ๋ถ™์—ฌ์คฌ๊ตฐ์š”.
๋‚˜์˜ ๋“€๋‚˜๊ฑธ ๊ทธ๋…€๋Š” ์ œ๋ฒ• ์ฉœ ๋ฉ‹์ ธ..๐Ÿ˜ตโ€๐Ÿ’ซ๐Ÿฅถ๐Ÿ˜Š

self.leftViewMode = .always
}

func setRightPaddingPoints(_ amount:CGFloat) {
Copy link
Member

Choose a reason for hiding this comment

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

right๊นŒ์ง€ ์ฑ™๊ฒจ์ฃผ๋‹ค๋‹ˆ ์„ธ์‹ฌ๊ฑธ

Comment on lines +15 to +18
func constraint(_ anchor: NSLayoutDimension, constant: CGFloat) {
self.translatesAutoresizingMaskIntoConstraints = false
anchor.constraint(equalToConstant: constant).isActive = true
}
Copy link
Member

Choose a reason for hiding this comment

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

์†๋ฐฐ ์Šค๋ƒ…ํ‚ท์„ ์ผ๋Š”๋ฐ ์ด๊ฑฐ๋Š” ์™œ ํ•ด์ค€ ๊ฒƒ์ด์•ผ?? ์š” ์•„์ด๋Š” ์™œ??

Copy link
Member Author

Choose a reason for hiding this comment

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

์†๋ฐฐ ์Šค๋ƒ…ํ‚ท์„ ์ผ๋Š”๋ฐ ์ด๊ฑฐ๋Š” ์™œ ํ•ด์ค€ ๊ฒƒ์ด์•ผ?? ์š” ์•„์ด๋Š” ์™œ??

Component ๋‚ด๋ถ€์—์„œ ๋†’์ด๋ฅผ ์žก์•„์ฃผ๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ ๊ตณ์ด ๋†’์ด๋ฅผ ์œ„ํ•ด์„œ SnapKit importํ•ด์„œ ์“ฐ๊ณ  ์‹ถ์ง€ ์•Š์•„๊ฐ€์ฆค๊ณ 
constraint(heightAnchor, constant: 100) ์š”๋ ‡๊ฒŒ๋งŒ ์“ฐ๋ฉด ๋†’์ด๊ฐ€ ์ง€์ •๋˜๋Š” ํ•จ์ˆ˜๋ฅผ ๊ตณ์ด Extensionํ–ˆ์„ฌ๋‹ˆ๋‹ค.

Copy link
Member

Choose a reason for hiding this comment

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

์˜ค ๋ช…์พŒํ•œ ์„ค๋ช…, ์ดํ•ด๊ฐ€ ํ‰ ๋˜์—ˆ๋”ฐ.

let navi = UINavigationController.init(rootViewController: LoginVC())
window.rootViewController = navi
window.makeKeyAndVisible()
window.backgroundColor = .white
Copy link
Member

Choose a reason for hiding this comment

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

๊ณ ๊ฑฐ ๋‚˜๋„ ์ข€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.. ์•„๋ฆ๊นŒ๋ฆ..๐Ÿ˜ตโ€๐Ÿ’ซ๐Ÿ˜ตโ€๐Ÿ’ซ

Comment on lines +16 to +20
private let logoLabel = UILabel().then {
$0.text = "Google"
$0.font = .boldSystemFont(ofSize: 40)
$0.textColor = .black
}
Copy link
Member

Choose a reason for hiding this comment

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

์ธํ™˜์„ ๋ฐฐ์•ผ ์ค‘์ดˆ๋ณด ์Šคํ„ฐ๋”” ๋•Œ๋„ ๋งํ–ˆ์ง€๋งŒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์“ฐ์ง€ ์•Š๊ณ  ๊ทธ๋ƒฅ ๊ตฌํ˜„ํ•ด๋ณด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•ด!
๊ทธ๋ฆฌ๊ณ  ๋‚˜์„œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์จ๋„ ์ถฉ๋ถ„ํ•ด!
๋‚˜๋Š” ์†๋ฐฐ์˜ ๊ณจ๋“œ๊ทธ๋ž˜์ŠคํŒŒ๊ฐ€ ์•„๋‹ˆ์ง€๋งŒ... ์ฝ์–ด๋ณด๋ฉด ์ข‹์„ ๊ฑฐ ๊ฐ™์•„์„œ
https://brunch.co.kr/@advisor/11

$0.textColor = .black
}
private let infoLabel = UILabel().then {
$0.text = "Continue to YouTube. You'll also sign in to Google services in your apps & Safari."
Copy link
Member

Choose a reason for hiding this comment

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

์˜์–ด๋กœ ์จ์ค€ ๊ฑฐ ์ข€. . ganzi.hoonzi.girl

Comment on lines +35 to +47
private lazy var showPasswordButton = UIButton().then {
setupButtonState($0)
$0.addTarget(self, action: #selector(touchUpShowPassword), for: .touchUpInside)
}
private lazy var loginStackView = UIStackView().then {
$0.alignment = .fill
$0.axis = .vertical
$0.distribution = .fillEqually
$0.spacing = 15
$0.addArrangedSubview(nameTextfield)
$0.addArrangedSubview(accountTextfield)
$0.addArrangedSubview(passwordTextfield)
}
Copy link
Member

Choose a reason for hiding this comment

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

์ด๊ฑฐ private lazy var ์จ์ค€ ์ด์œ ๊ฐ€ ๋ฌด์—‡์ธ๊ฐ€์˜..?โ‰๏ธ๐Ÿคทโ€โ™€๏ธ

Copy link
Member

Choose a reason for hiding this comment

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

์šฐ์„  private์€ ํ•ด๋‹น ํŒŒ์ผ์˜ extension ์•ˆ์—์„œ๊นŒ์ง€๋งŒ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์žˆ๊ณ ,
lazy var๋Š” ๋ถˆ๋Ÿฌ์˜ค๊ธฐ ์ „๊นŒ์ง€ ์ดˆ๊ธฐํ™”๊ฐ€ ๋˜์ง€ ์•Š๋Š”๋‹ค. ์ด ์ •๋„๊นŒ์ง€ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค๋ฆฅ.
ํ•„์š”ํ•  ๋•Œ ๋„ˆ ์ƒ์„ฑ์‹œํ‚จ๋‹ค. ํ  button์— ๋ถ™์ด๋Š” ๊ฒƒ์€ ์•ฝ๊ฐ„ ์•Œ ๊ฒƒ ๊ฐ™์€๋ฐ stackView๋Š” ๋ชจ๋ฅด๊ฒ ๋‹ค๋ฆ..

Copy link
Member Author

Choose a reason for hiding this comment

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

์šฐ์„  private์€ ํ•ด๋‹น ํŒŒ์ผ์˜ extension ์•ˆ์—์„œ๊นŒ์ง€๋งŒ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์žˆ๊ณ , lazy var๋Š” ๋ถˆ๋Ÿฌ์˜ค๊ธฐ ์ „๊นŒ์ง€ ์ดˆ๊ธฐํ™”๊ฐ€ ๋˜์ง€ ์•Š๋Š”๋‹ค. ์ด ์ •๋„๊นŒ์ง€ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค๋ฆฅ. ํ•„์š”ํ•  ๋•Œ ๋„ˆ ์ƒ์„ฑ์‹œํ‚จ๋‹ค. ํ  button์— ๋ถ™์ด๋Š” ๊ฒƒ์€ ์•ฝ๊ฐ„ ์•Œ ๊ฒƒ ๊ฐ™์€๋ฐ stackView๋Š” ๋ชจ๋ฅด๊ฒ ๋‹ค๋ฆ..

lazy var๊ฐ€ ์•Œ๋‹ค์‹œํ”ผ ๋ชจ๋“  ๋ทฐ๋“ค์ด ๋‹ค ์ดˆ๊ธฐํ™”ํ•˜๊ณ  ๋‚˜์„œ ๋ถˆ๋Ÿฌ์ง€๋Š” ๋ณ€์ˆ˜์ธ๋ฐ, ์ € ๋‘ UI์†์„ฑ์—์„œ ํ•„์š”ํ–ˆ๋˜ ์ด์œ ๋Š”

  • showPasswordButton
    • setupButtonState๋ผ๋Š” ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š”๋ฐ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ € ํ•จ์ˆ˜๊ฐ€ ์ดˆ๊ธฐํ™”๋œ ํ›„์— ์‚ฌ์šฉํ•ด์•ผํ•˜๊ธฐ ๋•Œ๋ฌธ์— lazy var๋ฅผ ๋ถ™์—ฌ์คฌ์Šต๋‹ˆ๋‹ค.
  • loginStackView
    • addArrangedSubview๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ then closure ์™ธ๋ถ€์— ์žˆ๋Š” textfield๋ฅผ ๊ฐ€์ ธ์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ textfield๋“ค์ด var๋ฅผ ์“ธ ๊ฒฝ์šฐ์—๋Š” ์•„์ง ์ดˆ๊ธฐํ™”๋˜์–ด ์žˆ์ง€ ์•Š์•„์„œ addArrangedSubview์— ์กด์žฌํ•˜์ง€ ์•Š๋Š” textfield๊ฐ€ ๋“ค์–ด๊ฐ€์„œ ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚ต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ lazy var๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ดˆ๊ธฐํ™”๊ฐ€ ์™„๋ฃŒ๋œ textfield๋“ค์ด ๋“ค์–ด๊ฐˆ ์ˆ˜ ์žˆ๊ฒŒ๋” ํ•ด์ค€๊ฑฐ์˜ˆ์š”!


private func setupButtonState(_ button: UIButton) {
if #available(iOS 15.0, *) {
var configuration = UIButton.Configuration.plain()
Copy link
Member

Choose a reason for hiding this comment

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

๊ทธ๋ž˜ ๋‚˜๋ ˆ์ด๋””๊ฐ€ ์†๋ฐฐ ์ฝ”๋“œ๋ณด๊ณ  ์ด ๋ถ€๋ถ„์„ ์•ˆ์— ๋„ฃ์–ด์„œ ์จ์ค„ ์ˆ˜ ์žˆ๊ตฌ๋‚˜.. ๊นจ๋‹ฌ์•˜์–ด.
๋ฆฌํŒฉgg~!
๊ทผ๋ฐ 15์—๋งŒ ๋Œ€์‘ํ•ด์ค€ ๊ฑฐ.. ๋ถ„๊ธฐ์ฒ˜๋ฆฌ ๊ทธ๋…€๋Š” ์ œ๋ฒ•.. 14.7์„ ์“ฐ๋Š” ๋‚˜์—๊ฒŒ๋„ ์„œ์œ—ํ•˜๋„ค..๐Ÿ๐Ÿ

Copy link
Member Author

Choose a reason for hiding this comment

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

14.7 ํ›„๋ฆฌ์—๊ฒŒ๋„ image์™€ font๊ฐ€ ์ ์šฉ๋  ์ˆ˜ ์žˆ๊ฒŒ ์ฉœ ์„ธ์‹ฌํ•œ ๋ฐฐ๋ ค๋ฅผ ํ•ด์คฌ์ฆค?


import UIKit

class LoginTextField: UITextField {
Copy link
Member

Choose a reason for hiding this comment

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

์ด๋ ‡๊ฒŒ ์ž์œ ์ž์žฌ๋กœ class ๋งŒ๋“ค์–ด์„œ ์‚ฌ์šฉํ•˜๋Š” ์†๋ฐฐ์•ผ๊ฐ€ ๋‚œ ๋ถ€๋Ÿฝ๊ณ  ๋ฉ‹์ ธ.. ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ˜Š โ˜บ๏ธ

Choose a reason for hiding this comment

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

์ด๊ฑฐ ์ธ์ •.ํ•ฉ๋‹ˆ๋‹ค. ๋“€๋‚˜๊ฑธ์„.๋‹น์žฅ.์šฐ๋ฆฌ์ง‘์œผ๋กœ.

@YoonAh-dev YoonAh-dev merged commit 3a9de82 into main Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment