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

Feat/#2 #3

Merged
merged 18 commits into from
Oct 13, 2021
Merged

Feat/#2 #3

merged 18 commits into from
Oct 13, 2021

Conversation

heerucan
Copy link
Member

@heerucan heerucan commented Oct 7, 2021

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

close #2

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

1์ฐจ ๊ณผ์ œ ๊ตฌํ˜„ ์™„๋ฃŒ์ž…๋‹ˆ๋‹น~!

๐Ÿ“Œ PR Point

  • private์„ ์–ธ์ œ ์จ์ฃผ๋Š” ๊ฑด์ง€ ์‚ฌ์‹ค ์ž˜ ๋ชจ๋ฅด๊ฒ ๋„ค์š”.
  • lazy var๋„ ์‚ฌ์‹ค ์ข€ ๋ชจ๋ฅด๊ฒ ๋Š”๋ฐ ํ•ญ์ƒ ์•„๋ฆฌ๊นŒ๋ฆฌํ•œ ๋ถ€๋ถ„.
  • ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ๋ฐ˜๋ณต๋˜๋Š” ์ฝ”๋“œ๋“ค์„ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์ค„์ผ ์ˆ˜ ์žˆ์„๊นŒ์š”?
    ํŠนํžˆ, textField๋‚˜ label ๊ฐ™์€ ๊ฒƒ๋“ค... ๊ณ„์† ๋ฐ˜๋ณต๋˜๋Š”๋ฐ ๋ชจ๋ฅด๊ฒ ๋‹ค.

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

์™œ ์ด๋ ‡๊ฒŒ ํ–ˆ๋Š”์ง€ ๊ถ๊ธˆํ•˜๋ฉด ๊ทธ๋ƒฅ ๋‹ค ๊ฐˆ๊ฒจ์ฃผ์„ธ์š”.

Copy link
Member

@i-colours-u i-colours-u left a comment

Choose a reason for hiding this comment

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

๊ณ ์ƒํ•˜์…ง์Šด๋‹ˆ๋‹ค

@heerucan heerucan self-assigned this Oct 7, 2021
Copy link
Member

@jane1choi jane1choi left a comment

Choose a reason for hiding this comment

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

์ฝ”๋“œ ์—„์ฒญ ๊น”๋”ํ•˜๊ฒŒ ์งœ์‹  ๊ฒƒ ๊ฐ™๊ณ  ๋ณ€์ˆ˜๋ช…, ํŒŒ์ผ๋ช… ์ง“๋Š” ๋ฒ•์— ๋Œ€ํ•ด์„œ๋„ ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค!

make.width.equalTo(80)
make.height.equalTo(50)
}
}
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.

2์ฃผ์ฐจ์— ์•„๋งˆ ์Šคํ† ๋ฆฌ๋ณด๋“œ๋กœ ์˜คํ† ๋ ˆ์ด์•„์›ƒ ๊ฐˆ๊ธฐ๋Š” ๋ฒ•์„ ๋ฐฐ์šธ ๊ฒƒ์ž…๋‹ˆ๋‹ค๋ฆ..
์Šค๋ƒ…ํ‚ท์œผ๋กœ๋„ ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ์Šค๋ณด๋กœ๋„ ์ถฉ๋ถ„ํžˆ ํ•  ์ˆ˜ ์žˆ๋‹ค!!

Copy link
Member

Choose a reason for hiding this comment

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

Snapkit ์ฒ˜์Œ๋ณด๋Š” ์šฉ์–ด์ธ๋ฐ ์˜คํ† ๋ ˆ์ด์•„์›ƒ ์ ์šฉ์„ ์ €๋ ‡๊ฒŒ ํ•  ์ˆ˜ ์žˆ๊ตฐ์šฉ..์ฝ”๋“œ๋กœ ์ ์šฉํ•˜๋‹ˆ๊นŒ ์ˆ˜์ •ํ•˜๊ธฐ ๋” ํŽธํ•ด๋ณด์—ฌ์š”!

signInButton.isUserInteractionEnabled = true
signInButton.backgroundColor = .mainBlue
}
}
Copy link
Member

Choose a reason for hiding this comment

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

trimmingCharacters๋Š” ๋ญ˜๊นŒ์š”?? ์—„์ฒญ ๊น”๋”ํ•˜๊ฒŒ ๊ตฌํ˜„๋˜๋„ค์š”,,

Copy link
Member Author

Choose a reason for hiding this comment

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

https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=traeumen927&logNo=221233934563
์—ฌ๊ธฐ ์ด ๋งํฌ์— ์ข€ ์ž์„ธํ•˜๊ฒŒ ์„ค๋ช…์ด ๋‚˜์™€์žˆ๋Š”๋ฐ
์—ฌ๊ธฐ ์•„๋ž˜ ์‚ฌ์ง„์— ๋‚˜์™€์žˆ๋Š” ๊ฒƒ์ฒ˜๋Ÿผ white~ ๋จธ์‹œ๊ธฐ๋ž‘ ๊ฐ™์ด ์“ฐ๋ฉด ๋ฌธ์ž์—ด๊ณผ ๊ฐ™์ด ์žˆ๋Š” ๊ณต๋ฐฑ์„ ์ œ๊ฑฐํ•ด์ค˜์šฉ!!
๊ทธ๋ž˜์„œ ๊ณต๋ฐฑ์„ ์ž…๋ ฅํ•ด๋„ ๋‹ค์Œ ๋ฒ„ํŠผ์ด ํ™œ์„ฑํ™”๋˜์ง€ ์•Š๊ฒŒ ํ•˜๋ ค๊ณ  ์จ์คฌ์–ด์—ฌ!
แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2021-10-08 แ„‹แ…ฉแ„’แ…ฎ 10 11 54

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.

์ €๋„ ์ž…๋ ฅ๋งŒ ์ƒ๊ฐํ•˜๊ณ  ๊ณต๋ฐฑ ์ƒ๊ฐ ๋ชปํ–ˆ๋Š”๋ฐ ๊ณต๋ฐฑ ์ƒ๊ฐํ•˜์‹  ์  ๋„ˆ๋ฌด ์ข‹์•„์š”. ๋†“์ณค๋˜ ์ƒ๊ฐ์ธ๋ฐ ์•Œ์•„๊ฐ‘๋‹ˆ๋‹ค!

configShow.baseBackgroundColor = .clear
configShow.imagePlacement = .leading
configShow.imagePadding = 10
}
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.

์ด๊ฑฐ๋Š” iOS15์—์„œ ์ƒˆ๋กœ ๋‚˜์˜จ ๋ฒ„ํŠผ๊ณผ ๊ด€๋ จ๋œ ํ•จ์ˆ˜์ธ๋ฐ ์ž์„ธํ•œ ๊ฑด https://www.notion.so/SOPT-1-620e04ad885048968aa3b60a81bd5b35#3577ea3858774b5b9fb66939303f3d3f ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์—ด

Copy link
Member

Choose a reason for hiding this comment

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

์™€์•™ ConfigurationUpdateHandler ์š”๊ฑฐ ์ž˜์“ฐ๋ฉด ์ฆ๋งฌ ์œ ์šฉํ•  ๊ฒƒ ๊ฐ™์•„์š”!! ์ž˜ ์ฐธ๊ณ ํ•˜๊ฒ ์Šต๋‹ˆ๋‹น ๊ฐ์‚ฌํ•ด์š”~!~!

} else {
pwTextField.isSecureTextEntry = 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.

ํ•˜๋ฆฅ. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹น.. ๐Ÿ˜ตโ€๐Ÿ’ซโค๏ธ

@i-colours-u
Copy link
Member

i-colours-u commented Oct 8, 2021

1 )private์„ ์–ธ์ œ ์จ์ฃผ๋Š” ๊ฑด์ง€ ์‚ฌ์‹ค ์ž˜ ๋ชจ๋ฅด๊ฒ ๋„ค์š”.

--> ์š”๊ฑด ํ•ด๋‹น ํŒŒ์ผ๋‚ด์—์„œ ๋™์ž‘ํ•˜๋Š” ๋ฉ”์„œ๋“œ๋‚˜ ํ”„๋กœํผํ‹ฐ๋ผ๋ฉด ์ „๋ถ€ ๋‹ค private๋กœ ์ฒ˜๋ฆฌํ•ด์ฃผ๋Š”๊ฒŒ ๋งž์•„์š”!!
์™ธ๋ถ€์—์„œ ์ฐธ์กฐํ•˜๊ฑฐ๋‚˜ ๊บผ๋‚ด์“ธ๋•Œ๋Š” private๊ฐ€ ์•„๋‹Œ๊ฑธ๋กœ ์ฒ˜๋ฆฌํ•ด์ฃผ์‹œ๋ฉด ๋˜๊ตฌ..

2 ) lazy var๋„ ์‚ฌ์‹ค ์ข€ ๋ชจ๋ฅด๊ฒ ๋Š”๋ฐ ํ•ญ์ƒ ์•„๋ฆฌ๊นŒ๋ฆฌํ•œ ๋ถ€๋ถ„.
--> ํ™”๋ฉด์„ ์šฐ๋ฆฌ๊ฐ€ ๋„์› ์„ ๋•Œ ์ง€๊ธˆ๋‹น์žฅ ํ•„์š”ํ•˜์ง€ ์•Š์€๊ฒƒ๋“ค ์žˆ์ฃ ?! ๊ทธ.. ์˜ˆ๋ฅผ ๋“ค์–ด ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ์•ผ ๋‚˜์˜ค๋Š” "Picker View"๋ผ๋˜์ง€,
ํŠน์ • ํ–‰๋™์„ ํ•ด์•ผ ๋‚˜์˜ค๋Š” "View"๋ผ๋˜์ง€.. ์ง€๊ธˆ๋‹น์žฅ ํ•„์š”ํ•˜์ง€ ์•Š์€ ํ”„๋กœํผํ‹ฐ๋“ค์— ๋Œ€ํ•ด์„œ ์ด๋”ฐ๊ฐ€ ํ˜ธ์ถœํ• ๋•Œ ๋‚˜์™€!! ๋ผ๊ณ  ์ง€์ •ํ•˜๋Š”๊ฑฐ์—์š”.
๊ทธ๋ž˜์„œ ํ™”๋ฉด์ด ๋œจ์ž๋งˆ์ž ๋ฐœ์ƒํ•˜๋Š” UI๋‚˜ ์“ฐ๋Š” ํ”„๋กœํผํ‹ฐ๋“ค์— ๋Œ€ํ•ด์„œ๋Š” lazy๋ฅผ ์‚ฌ์šฉํ•ด๋„๋˜๊ณ ? ์•ˆํ•ด๋„ ์ƒ๊ด€ ์—†์Šต๋‹ˆ๋‹ค!!

3 ) ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ๋ฐ˜๋ณต๋˜๋Š” ์ฝ”๋“œ๋“ค์„ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์ค„์ผ ์ˆ˜ ์žˆ์„๊นŒ์š”?
ํŠนํžˆ, textField๋‚˜ label ๊ฐ™์€ ๊ฒƒ๋“ค... ๊ณ„์† ๋ฐ˜๋ณต๋˜๋Š”๋ฐ ๋ชจ๋ฅด๊ฒ ๋‹ค.
--> ์š”๊ฒƒ๋„ ์ œ๊ฐ€ ํ•ญ์ƒ ๊ณ ๋ฏผํ•˜๋Š” ๋ถ€๋ถ„์ธ๋ฐ..
ํฐ ํ”Œ์ ์„ ํ•˜๊ฒŒ ๋˜๋ฉด์€, ๋””์ž์ด๋„ˆ๋ถ„๋“ค์ด๋ž‘ ํ•ญ์ƒ ์–˜๊ธฐํ•ด์„œ ์–ด๋Š์ •๋„ ํ”„๋กœ๋•ํŠธ System Design์„ ์–ด๋–ป๊ฒŒ ์„ค์ •ํ• ์ง€ ํฐ ํ‹€ ์ •๋„๋ฅผ ์žก๊ฒŒ๋ ๊ฑฐ์—์š”!
๊ณตํ†ต๋˜๋Š” ๋ฒ„ํŠผ์€ ์ด๋Ÿฐ ํ˜•ํƒœ๋ฅผ ์“ฐ๊ณ ,, TextField๋Š” ์š”๋Ÿฐ๊ฑธ ์“ฐ๊ณ ,, Label๋„ ํ”„๋กœ๋•ํŠธ ๋‚ด์—์„œ ์Šคํƒ€์ผ์ด ์ •๋ฆฌ๊ฐ€ ๋˜์–ด์žˆ์„๊ฑฐ์—์š”!! (title,subtitle, content ๋“ฑ๋“ฑ ํ•ด์„œ 4,5๊ฐœ ๋‚ด์™ธ๋กœ..)
๊ทธ๋ ‡๊ฒŒ ์ž์ฃผ ์“ฐ์ด๋Š” UI ์š”์†Œ๋“ค์— ๋Œ€ํ•ด์„œ๋Š” ์ €๋Š” ๊ทธ๋ƒฅ class ๋กœ ๋”ฐ๋กœ ๋นผ๋‘๋Š” ํŽธ์ด์—์š”! ์Šค๋ณด๋ฅผ ์“ฐ๋˜, ์ฝ”๋“œ๋กœ ์“ฐ๋˜ ๋”ฐ๋กœ ํด๋ž˜์Šค๋กœ ๋ถ„๋ฆฌํ•ด๋†“์œผ๋ฉด ํ•„์š”ํ• ๋•Œ๋งˆ๋‹ค ๊บผ๋‚ด์“ฐ๋ฉด ์•„๋ฌด๋ž˜๋„ ์ผ์ผ์ด ์ง€์ •ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ์ค„์ผ์ˆ˜ ์žˆ๊ฒ ์ฃ ..?! ์ €๋Š” ๊ทธ๋ ‡๊ฒŒ ์ฒ˜๋ฆฌํ•˜๋Š” ํŽธ์ด์—์š”!!

Comment on lines +131 to +135
guard let name = nameTextField.text,
let email = emailTextField.text,
let pw = pwTextField.text else {
return
}
Copy link
Member

@i-colours-u i-colours-u Oct 8, 2021

Choose a reason for hiding this comment

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

guard๋ฌธ ํ™œ์šฉํ•œ๊ฑฐ ์ข‹๋„ค์—ฌ ๐Ÿ‘๐Ÿป

Comment on lines +17 to +19
func setTextField(placeholder: String, secure: Bool) {
self.placeholder = placeholder
self.isSecureTextEntry = secure
Copy link
Member

Choose a reason for hiding this comment

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

isSecureTextEntry๊นŒ์ง€ ๊ฐ™์ด ํ•ด์ฃผ๋Š” ์„ฌ์„ธํ•จ ์ข‹๋„ค์š”.... ๊ฐ๋™๋ฐ›์•˜์Šต๋‹ˆ๋‹ค...

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 53 to 59

lazy var showButton = UIButton(configuration: configShow, primaryAction: nil).then {
$0.addTarget(self, action: #selector(touchupShowButton(_:)), for: .touchUpInside)
$0.configurationUpdateHandler = { btn in
var config = btn.configuration
config?.image = btn.isSelected ? UIImage(systemName: "checkmark.square.fill") : UIImage(systemName: "square")
btn.configuration = config
Copy link
Member

Choose a reason for hiding this comment

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

๋ฒ„ํŠผ์— ๋Œ€ํ•ด์„œ configuration ๊ฐ€์ ธ์™€์„œ ์ƒํƒœ์— ๋”ฐ๋ผ ์ด๋ฏธ์ง€ ์ฒ˜๋ฆฌํ•˜๋Š”๊ฑฐ ์ข‹๋„ค์š”!!! ๋‚˜์ค‘์— iOS15์ •์ฐฉ๋˜๋ฉด ์ ๊ทน์ ์œผ๋กœ ํ”Œ์  ๋‚ด์—์„œ ํ™œ์šฉํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š” !!!! ๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป

Copy link
Member Author

Choose a reason for hiding this comment

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

๊ทธ๋‹ˆ๊นŒ์š” ์ด๋ฒˆ์— ์ฒ˜์Œ ์จ๋ดค๋Š”๋ฐ ๋˜๊ฒŒ ์ข‹์€ ๊ธฐ๋Šฅ์ธ ๊ฑฐ ๊ฐ™์•„์—ด
๊ธ๋ฐ ๊ฐˆ๊ธฐ๊ณ ๋ณด๋‹ˆ ์•ˆ์— var config = UIButton.configure.plain() ~ ์š”๋ก ์‹์œผ๋กœ ๋„ฃ์–ด์ค„ ์ˆ˜ ์žˆ๋”๋ผ๊ณ ์š”..;;ใ…‹

Copy link
Member

@YoonAh-dev YoonAh-dev left a comment

Choose a reason for hiding this comment

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

ํ›„๋ฆ๋‹˜ LGTMโค๏ธ

Comment on lines 151 to 154
if sender.isSelected {
pwTextField.isSecureTextEntry = false
} else {
pwTextField.isSecureTextEntry = true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if sender.isSelected {
pwTextField.isSecureTextEntry = false
} else {
pwTextField.isSecureTextEntry = true
pwTextField.isSecureTextEntry = sender.isSelected? false : true

์ด๋ ‡๊ฒŒ ์จ๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š”?

Copy link
Member Author

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.

๋‹จ์ˆœ Boolean ํ˜•ํƒœ๋ผ๋ฉด ์š”๋ ‡๊ฒŒ๋„ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 pwTextField.isSecureTextEntry = !sender.isSelected

Copy link
Member Author

Choose a reason for hiding this comment

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

@Taehyeon-Kim ์˜ค ๋ฐ”๋กœ ๊ณ ์ณ์•ผ๊ฒ ์Šต๋‹ˆ๋‹ค~!

Comment on lines 10 to 15
pod 'SnapKit', '~> 5.0.0'
pod 'Then'
pod 'lottie-ios'
pod 'Moya', '~> 14.0'
pod 'Kingfisher', '~> 6.0'
pod 'SwiftLint'
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.

๋‚˜์ค‘์— ๊ณผ์ œํ•˜๋‹ค๋ณด๋ฉด ๋‹ค ์ถ”๊ฐ€ํ•ด์•ผ ํ•  ๊ฑฐ ๊ฐ™์•„์„œ ๋ฏธ๋ฆฌ ์ถ”๊ฐ€ํ•ด๋’€์Šต๋‹ˆ๋‹ค.๐Ÿ˜ตโ€๐Ÿ’ซ๐Ÿ˜ตโ€๐Ÿ’ซ

Copy link
Member Author

Choose a reason for hiding this comment

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

๊ทผ๋ฐ ์™œ ์Šค์œ„ํ”„ํŠธ๋ฆฐํŠธ ์ถ”๊ฐ€ํ–ˆ์ง€..ํ•˜ํ•˜.. ์“ธ ๊ฑฐ๋ผ๊ณ  ์ƒ๊ฐํ–ˆ๋Š”๋ฐ ์•ˆ์“ฐ๋„ค..

import UIKit

extension UIViewController {
func hideKeyboard() {
Copy link
Member

Choose a reason for hiding this comment

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

์†๋ฐฐ๋ฆ  extension ๋„ˆ๋ฌด ์ข‹๋„ค์—ฌ ์‡ฝ์ƒฅํ•ด๊ฐ€๊ฒ ์Šต๋‹ˆ๋‹ค~๐Ÿƒโ€โ™€๏ธ

Copy link
Member Author

Choose a reason for hiding this comment

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

์ €๋‘ ์–ด๋”˜๊ฐ€์—์„œ ์‡ฝ์ƒฅํ•˜์˜€๋Š”๋ฐ ๊ฐ์‚ฌํ•จ๋‹นโค๏ธโค๏ธ

Copy link
Member

@Taehyeon-Kim Taehyeon-Kim left a comment

Choose a reason for hiding this comment

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

LGTM ํ›„๋ฆ ์„ ๋ฐฐ โœจ

Comment on lines 32 to 34
$0.addArrangedSubview(nameTextField)
$0.addArrangedSubview(emailTextField)
$0.addArrangedSubview(pwTextField)
Copy link
Member

Choose a reason for hiding this comment

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

์ด ๋ถ€๋ถ„๋„ stackview extension์œผ๋กœ ๋นผ์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋”๋ผ๊ตฌ์š”. UIView extension ๋งŒ๋“ค์–ด์ฃผ์‹  ๊ฒƒ์ฒ˜๋Ÿผ ํ•˜์…”๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค๐Ÿ‘‹

extension UIStackView {
    public func addArrangedSubviews(_ views: UIView...) {
        views.forEach(addArrangedSubview(_:))
    }
}

Copy link
Member Author

Choose a reason for hiding this comment

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

์‚ฌ์‹ค ํƒœํ˜„์“ฐ ์ฝ”๋“œ ๋ณด๋Ÿฌ ๊ฐ”๋‹ค๊ฐ€ ์‡ฝ์ƒฅ ๊ธ์–ด์™”๋‹ค.. ์ข‹์€ Extension.. ์ž…๋‹ˆ๋‹คโœจโœจ

Comment on lines 151 to 154
if sender.isSelected {
pwTextField.isSecureTextEntry = false
} else {
pwTextField.isSecureTextEntry = true
Copy link
Member

Choose a reason for hiding this comment

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

๋‹จ์ˆœ Boolean ํ˜•ํƒœ๋ผ๋ฉด ์š”๋ ‡๊ฒŒ๋„ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 pwTextField.isSecureTextEntry = !sender.isSelected

@objc func touchupSignupButton(_ sender: UIButton) {
let vc = CompleteVC()
vc.name = nameTextField.text
vc.modalPresentationStyle = .fullScreen
Copy link
Member

Choose a reason for hiding this comment

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

์š”๊ฑด ๊ทธ๋ƒฅ ์—ฌ๋‹ด์ธ๋ฐ .fullScreen๊ณผ .overFullScreen์—๋„ ์ฐจ์ด๊ฐ€ ์žˆ๋„ค์š”!
์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š” ์ˆœ๊ฐ„์„ ์ ์ ˆํ•˜๊ฒŒ ์„ ํƒํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
https://stackoverflow.com/questions/58657826/benefit-of-using-fullscreen-presentation-style-in-compare-to-overfullscreen-pr

์Šน์ฐฌ๋‹˜ PR์— ์ •๋นˆ๋‹˜์ด ๋‚จ๊ธฐ์‹  ์ฝ”๋ฉ˜ํŠธ๋ณด๊ณ  ํฅ๋ฏธ๋กœ์›Œ์„œ ์ฐพ์•„๋ดค์Šต๋‹ˆ๋‹ค~!

  • .fullScreen
    • ํ”„๋ ˆ์  ํ…Œ์ด์…˜์ด ์™„๋ฃŒ๋œ ํ›„ ํ”„๋ ˆ์  ํ…Œ์ด์…˜ ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ์— ์†ํ•œ ๋ทฐ๊ฐ€ ์ œ๊ฑฐ๋ฉ๋‹ˆ๋‹ค.
    • ๊ฐ„๋‹จํ•˜๊ฒŒ ๋งํ•ด์„œ ๋ชจ๋‹ฌ ๋ฐฉ์‹์œผ๋กœ ํ™”๋ฉด ์ „ํ™˜๋˜์—ˆ์„ ๋•Œ, ์ด์ „ ๊ณ„์ธต์˜ ๋ทฐ๊ฐ€ ์—†์–ด์ง„๋‹ค๋Š” ๊ฒƒ.
    • viewDidAppear๋ฅผ ํ˜ธ์ถœํ•œ๋‹ค๋Š” ๊ฒƒ.
  • .overFullScreen
    • ํ”„๋ ˆ์  ํ…Œ์ด์…˜์ด ๋๋‚  ๋•Œ ํ”„๋ ˆ์  ํ…Œ์ด์…˜ ์•„๋ž˜์˜ ๋ทฐ๊ฐ€ ๋ทฐ ๊ณ„์ธต ๊ตฌ์กฐ์—์„œ ์ œ๊ฑฐ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
    • ๊ฐ„๋‹จํ•˜๊ฒŒ ๋งํ•ด์„œ ๋ชจ๋‹ฌ ๋ฐฉ์‹์œผ๋กœ ํ™”๋ฉด ์ „ํ™˜๋˜์—ˆ์„ ๋•Œ, ์ด์ „ ๊ณ„์ธต์˜ ๋ทฐ๊ฐ€ ๋‚จ์•„์žˆ๋‹ค๋Š” ๊ฒƒ
    • viewDidAppear๋ฅผ ํ˜ธ์ถœํ•˜์ง€ ์•Š๋Š”๋‹ค๋Š” ๊ฒƒ.
    • ์ƒ๊ฐํ•ด๋ณด๋ฉด ๋ทฐ๋ฅผ ๋ถˆํˆฌ๋ช…ํ•˜๊ฒŒ ์˜ฌ๋ฆฌ์ง€ ์•Š์•˜์„ ๋•Œ, ๋ฐ‘์— ์ฝ˜ํ…์ธ ๊ฐ€ ๋ณด์ด๊ฒ ๋„ค์š”..?

Copy link
Member Author

@heerucan heerucan Oct 11, 2021

Choose a reason for hiding this comment

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

@Taehyeon-Kim ๊ทธ๋Ÿผ ์ง€๊ธˆ ์ € ์ƒํ™ฉ์—์„œ๋Š” ์–ด๋–ค ๊ฑธ ์จ์ค˜์•ผ ์ ํ•ฉํ•˜๋‚˜์š”?
๋ณดํŽธ์ ์œผ๋กœ ์‚ฌ์šฉ์ž๊ฐ€ ์•ฑ์„ ๋กœ๊ทธ์ธ์„ ํ•˜๊ณ  ๊ณง๋ฐ”๋กœ ๊ทธ ์ „์œผ๋กœ ๋Œ์•„๊ฐ€๋Š” ์ƒํ™ฉ(= dismiss ํ•ด์ฃผ๋Š” ์ƒํ™ฉ)์€ ๊ฑฐ์˜ ์—†์œผ๋‹ˆ๊นŒ
.fullScreen์ด ๋งž๋Š” ๊ฑด๊ฐ€์š”??

๊ทธ๋‚˜์ €๋‚˜ ์นœ์ ˆํ•œ ์„ค๋ช….. ๋Œ•ํ๋ฒ ๋ฆฌ...๊ฐ์‚ฌ..

self.layer.borderColor = UIColor.lightGray.cgColor
self.layer.cornerRadius = 7
self.clipsToBounds = true
self.addLeftPadding()
Copy link
Member

@Taehyeon-Kim Taehyeon-Kim Oct 11, 2021

Choose a reason for hiding this comment

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

๊ถ๊ธˆํ•œ๋ฐ right padding์€ ๋”ฐ๋กœ ์•ˆ์ฃผ์‹œ๋‚˜์š”..? (์ด๊ฒƒ ๋”ฐ์ง€๋Š” ๊ฑฐ ์•„๋‹˜ ์ฃผ์˜..๐Ÿฅฒ )

Copy link
Member Author

Choose a reason for hiding this comment

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

ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ F ๋ชจ๋จผํŠธ
์„ธ์‹ฌ๊ฑธ์ด ์•„๋‹ˆ์—ˆ๋‹ค.. ์ ์šฉํ•ด์ฃผ๊ฒ ์Šต๋‹ˆ๋‹ค..!

Copy link
Member

@hyesuuou hyesuuou left a comment

Choose a reason for hiding this comment

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

์†๋ฐฐ์•ผ ๋จธ์‹ฏ๋‹ค. ๋„์•ฝํ–ˆ๋‹ค ์ฝ”๋“œ ์•„์ฃผ ๊น”๋”ํ•˜๋‹ค LGTMโค๏ธ

Comment on lines +142 to +147
if name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ||
email.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ||
pw.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
signInButton.isUserInteractionEnabled = false
signInButton.backgroundColor = .lightGray

Copy link
Member

Choose a reason for hiding this comment

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

์šฐ์™• ์ƒˆ๋กœ์šด ๊ฑฐ ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค~

$0.addTarget(self, action: #selector(touchupShowButton(_:)), for: .touchUpInside)
$0.configurationUpdateHandler = { btn in
var config = btn.configuration
config?.image = btn.isSelected ? UIImage(systemName: "checkmark.square.fill") : UIImage(systemName: "square")
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

@heerucan heerucan Oct 11, 2021

Choose a reason for hiding this comment

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

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.. ์ง„์ง„์ž๋ผ ๊ณผ์ฐฌ์˜ ๋ง์”€... ๋‘˜ ๋‹ค.. ๊ณผ์ฐฌ๊ณผ์ฐฌ.. ์ž ์ด ์•ˆ์™€์„œ ๋‘ ๋ช…ํ•œํ…Œ ์ฝ”๋ฆฌ ๊ฐˆ๊ธฐ๋Ÿฌ ๊ฐˆ๊ฒŒ~
์–ด์šฐ ์•„๋ž˜ @hyesuuou ๊ธธ๊ฒŒ ๋‹ฌ์•„์คฌ๋Š”๋ฐ reply ํ•  ๊ณณ์ด ์—†์–ด์„œ ์ด๋ ‡๊ฒŒ ๋‹ฌ์•„๋ณด์•„.. ๊ธธ๊ฒŒ ์„ค๋ช…ํ•ด์คฌ๋Š”๋ฐ ์ดํ•ด ์ง„์ž. ๋ปฅ ์•ˆ์น˜๊ณ  ์ˆœ๋„ 100ํผ์„ผํŠธ ์ดํ•ด๋˜์—ˆ์–ด. ์ง„์‹ฌ.. ์–ธ์ œ private ์จ์•ผ ํ•˜๋Š”์ง€ ๊นจ๋‹ฌ์•„์Šค!

@hyesuuou
Copy link
Member

hyesuuou commented Oct 11, 2021

private ๋Š” ๋‹ค๋ฅธ ํด๋ž˜์Šค์—์„œ ์ ‘๊ทผํ•˜์ง€ ์•Š๋Š”๊ฑฐ ์•ž์— ์”๋‹ˆ๋‹ค~
๋งŒ์•ฝ์— ๋‚ด๊ฐ€ class First { ... }์„ ๋งŒ๋“ค๊ณ  ์ด ์•ˆ์— private var index: Int = 3
์š”๋ ‡๊ฒŒ ํ”„๋ผ์ด๋น—์œผ๋กœ ๋ญฅ๊ฐˆ ์„ ์–ธํ–ˆ์–ด

๊ทธ๋ฆฌ๊ณ  ๋‚ด๊ฐ€ class Second { ... }
๋ฅผ ๋งŒ๋“ค์—ˆ๋‹ค
๊ธ๋ฐ ๊ฐ‘์ž๊ธฐ ์š” Second๋ผ๋Š” ํด๋ž˜์Šค ๋‚ด๋ถ€์—์„œ First ํด๋ž˜์Šค์˜ index๋ฅผ 7๋กœ ์ˆ˜์ •์‹œ์ผœ์ฃผ๊ณ  ์‹ถ์€๊ฑฐ์•ผ..
๊ทธ๋Ÿฌ๋ฉด ๋ณดํ†ต ์šฐ๋ฆฌ๋Š” First().index = 7
์ด๋ผ๊ณ  ํ•ด์ฃผ๋ ค๊ณ  ํ•˜๊ฒ ์ง€..? ๊ทผ๋ฐ ์ด๋Ÿฌ๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์…” . ์™œ๋ƒ๋ฉด index๋Š” Firstํด๋ž˜์Šค ์•ˆ์—์„œ private์œผ๋กœ ์„ ์–ธ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์— Firstํด๋ž˜์Šค๊ฐ€ ์•„๋‹Œ ๋‹ค๋ฅธ ์™ธ๋ถ€ ํด๋ž˜์Šค์—์„œ๋Š” ์—ฌ๊ธฐ์— ์ ‘๊ทผ ํ• ์ˆ˜๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์ด์•ผ..

๊ทธ๋ž˜์„œ ์‚ฌ์‹ค ์™ธ๋ถ€์—์„œ ์ง์ ‘ ์ ‘๊ทผํ•˜์ง€ ์•Š๊ฑฐ๋‚˜ ๋ณด์•ˆ์ƒ(?) ๊ทธ๋Ÿฌ์ง€ ์•Š์•„๋žด ํ•˜๋Š” ๊ณณ์—” private๋ฅผ ์จ์ค˜์•ผํ•ด!!

ํ•˜๋‚˜ ์˜ˆ์‹œ๋กœ ๋‚ด๊ฐ€ First ํด๋ž˜์Šค์˜ index๋Š” ๋ฌด์กฐ๊ฑด 1-100์‚ฌ์ด์˜ ์ˆ˜๋กœ ํ•˜๊ธฐ๋กœ ํ–ˆ์–ด. ๋‹ค๋ฅธ ์ˆ˜๊ฐ€ ๋“ค์–ด์˜ค๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์…”. ๊ทธ๋Ÿฌ๋ฉด ์™ธ๋ถ€์—์„œ 200์„ ๋„ฃ์–ด์คซ์— ๋•Œ ๋ฐ”๋กœ ๋ฐ˜์˜๋˜๋ฉด ํฐ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธธ์ˆ˜๋„ ์žˆ์ž”ํ•˜

๊ทธ๋Ÿด๋•Œ index๋ฅผ private๋กœ ์„ค์ •ํ•˜๊ณ ,

func setIndex (idx: Int) {
   if idx > 100, idx < 0 { return }
   else { index = idx }
}

First ํด๋ž˜์Šค์— ์š”๋Ÿฐ ํ•จ์ˆ˜๋ฅผ ๋งŒ๋“ค์–ด์ค˜์„œ

์™ธ๋ถ€์—์„œ ์ˆ˜๋ฅผ ๋„ฃ์–ด์ค„ ๋•Œ First().setIndex(idx: 200)์š”๋ ‡๊ฒŒ ๋„ฃ์–ด์ฃผ๋ฉด ์ € ํ•จ์ˆ˜์˜ if๋ฌธ์— ๊ฑธ๋ฆฌ๊ฒŒ ๋˜๊ณ , ์ด์ œ ๊ฑธ๋Ÿฌ์ฃผ๋Š” ์—ญํ• ์„ ํ•˜๊ฒŒ๋˜๋Š”๊ฑฐ์ง€..

(ํฐ์œผ๋กœ ๊ฐˆ๊ฒจ์„œ ์ปด์œผ๋กœ ๋ณด๋ฉด ๋ ˆ์ด์•„์›ƒ ๋‹ค๊นจ์ง€๋Š”๊ฑฐ์•„๋‹์ง€..)

๊ทธ๋ž˜์„œ ๊ฒฐ๋ก ์€โ€ขโ€ข
๊ณ ๋ƒฅ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋‹ค๋ฅธํด๋ž˜์Šค์—์„œ ์ ‘๊ทผํ• ์ˆ˜ ์—†๊ฒŒ ํ•˜๋Š”๊ฑฐ!! ๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ์ข‹์„๊ฑฐ๊ฐ€ํƒ€
๊ธ€๊ณ  ์ „์— ๊ทธ๋ƒฅ ์ฃผ์›Œ๋“ค์€๊ฑด๋ฐ ๊ฐ์ฒด์ง€ํ–ฅ์—์„œ๋Š” ํด๋ž˜์Šค ์•ˆ์— ์žˆ๋Š”๊ฑธ ์™ธ๋ถ€์— ์•ˆ๋ณด์ด๊ฒŒ ํ•˜๋Š”๊ฒŒ ์•ฝ๊ฐ„ ์ค‘์š”ํฌ์ธํŠธ๋ผ๊ณ  ํ•˜๋”๋ผ๊ตฌ.. ๊ทธ๋ž˜์„œ ์‚ฌ์‹ค ์™ธ๋ถ€์— ๊ตณ์ด ๋ณด์—ฌ์ค„ ํ•„์š” ์—†๋Š”๊ฑฐ๋‚˜ ๋”ฑํžˆ ์ ‘๊ทผํ•˜์ง€ ์•Š๋Š”๊ฑฐ์—๋Š” ๋‹ค private ํ•ด์ฃผ๋Š”๊ฒŒ ์ข‹์€๊ฑฐ๊ฐ€ํ„ฐ

Copy link
Member

@jumining jumining 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 +10 to +11
extension UIViewController {
func hideKeyboard() {
Copy link
Member

Choose a reason for hiding this comment

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

ExtensionํŒŒ์ผ ๋”ฐ๋กœ ๋งŒ๋“ค๊ณ  extension์œผ๋กœ ๋„ฃ์€ ํ•จ์ˆ˜๋“ค์ด ๋งŽ์€๋ฐ extension ์‚ฌ์šฉํ•œ ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์šฉ?? ์žฅ์ ์ด ํฐ๊ฐ€์š”???

Copy link
Member Author

Choose a reason for hiding this comment

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

๋ฐ˜๋ณต๋œ ์ฝ”๋“œ๋ฅผ ๋ฐฉ์ง€ํ•ด์ฃผ๋ ค๊ณ  ์จ์ฃผ๋Š” ๊ฒƒ ๊ฐ™์•„์š” ์ €๋Š”!
์ง€๊ธˆ ์ด hideKeyboard()์˜ ๊ฒฝ์šฐ๋Š” ๋ณธ๋ž˜ ๊ฐ™์€ ๊ฒฝ์šฐ์—๋Š” ํ‚ค๋ณด๋“œ๊ฐ€ ์‚ฌ๋ผ์ ธ์•ผ ํ•˜๋Š” 2๊ฐœ์˜ VC์— ๊ตฌํ˜„๋ถ€์™€ ํ•จ๊ป˜ ๋‹ค ๋„ฃ์–ด์ค˜์•ผ ๋˜๋Š”๋ฐ ์ด๋ ‡๊ฒŒ extension์œผ๋กœ ๋นผ์ค„ ๊ฒฝ์šฐ์—๋Š” hideKeyboard() ์ฝ”๋“œ ํ•œ ์ค„๋งŒ VC์˜ viewDidLoad() ์•ˆ์— ํ˜ธ์ถœํ•ด์ฃผ๋ฉด ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์ฝ”๋“œ๊ฐ€ ์งง์•„์ง€๊ฑฐ๋“ ์š”!

make.width.equalTo(80)
make.height.equalTo(50)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Snapkit ์ฒ˜์Œ๋ณด๋Š” ์šฉ์–ด์ธ๋ฐ ์˜คํ† ๋ ˆ์ด์•„์›ƒ ์ ์šฉ์„ ์ €๋ ‡๊ฒŒ ํ•  ์ˆ˜ ์žˆ๊ตฐ์šฉ..์ฝ”๋“œ๋กœ ์ ์šฉํ•˜๋‹ˆ๊นŒ ์ˆ˜์ •ํ•˜๊ธฐ ๋” ํŽธํ•ด๋ณด์—ฌ์š”!

Comment on lines 15 to 76
let logoLabel = UILabel().then {
$0.font = .boldSystemFont(ofSize: 50)
$0.textColor = .mainBlue
$0.text = "Google"
}

let loginLabel = UILabel().then {
$0.font = .boldSystemFont(ofSize: 35)
$0.textColor = .black
$0.text = "๋กœ๊ทธ์ธ"
}

let explainLabel = UILabel().then {
$0.font = .boldSystemFont(ofSize: 16)
$0.textColor = .lightGray
$0.numberOfLines = 0
$0.textAlignment = .center
$0.text = "YouTube๋„ ์ด๋™ํ•˜๋ฉฐ ๊ณ„์†ํ•˜์„ธ์š”. ์•ฑ ๋ฐ Safari์—์„œ๋„ Google ์„œ๋น„์Šค์— ๋กœ๊ทธ์ธ๋ฉ๋‹ˆ๋‹ค."
}

private lazy var fieldStackView = UIStackView().then {
$0.axis = .vertical
$0.alignment = .fill
$0.distribution = .fillEqually
$0.spacing = 20
$0.addArrangedSubview(nameTextField)
$0.addArrangedSubview(emailTextField)
$0.addArrangedSubview(pwTextField)
}

let nameTextField = UITextField().then {
$0.setTextField(placeholder: "์ด๋ฆ„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”", secure: false)
$0.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: .editingChanged)
}

let emailTextField = UITextField().then {
$0.setTextField(placeholder: "์ด๋ฉ”์ผ ๋˜๋Š” ํœด๋Œ€์ „ํ™”", secure: false)
$0.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: .editingChanged)
}

let pwTextField = UITextField().then {
$0.setTextField(placeholder: "๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ", secure: true)
$0.addTarget(self, action: #selector(textFieldDidChange(textField:)), for: .editingChanged)
}

let signupButton = UIButton().then {
$0.setTitle("๊ณ„์ •๋งŒ๋“ค๊ธฐ", for: .normal)
$0.setTitleColor(.mainBlue, for: .normal)
$0.setTitleColor(.white, for: .highlighted)
$0.titleLabel?.font = .boldSystemFont(ofSize: 16)
$0.addTarget(self, action: #selector(touchupSignupButton(_:)), for: .touchUpInside)
}

let signInButton = UIButton().then {
$0.isUserInteractionEnabled = false
$0.setTitle("๋‹ค์Œ", for: .normal)
$0.setTitleColor(.white, for: .normal)
$0.titleLabel?.font = .boldSystemFont(ofSize: 18)
$0.backgroundColor = .lightGray
$0.layer.cornerRadius = 10
$0.addTarget(self, action: #selector(touchupSignInButton(_:)), for: .touchUpInside)
}
Copy link
Member

Choose a reason for hiding this comment

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

Then ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ์ด๋ ‡๊ฒŒ ์ ์šฉํ•˜๋Š”๊ฑฐ๊ตฐ์šฉ viewDidload์— ์†์„ฑ์ •์˜ํ•ด์•ผ ์ ์šฉ๋˜๋Š” ์ค„ ์•Œ์•˜๋Š”๋ฐ ์š”๋Ÿฐ ๋ฐฉ๋ฒ•๋„ ์žˆ๋„ค์š”..

signInButton.isUserInteractionEnabled = true
signInButton.backgroundColor = .mainBlue
}
}
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 +135 to +152
@objc func textFieldDidChange(textField: UITextField){
guard let name = nameTextField.text,
let email = emailTextField.text,
let pw = pwTextField.text else {
return
}

if name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ||
email.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ||
pw.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
signInButton.isUserInteractionEnabled = false
signInButton.backgroundColor = .lightGray

} else {
signInButton.isUserInteractionEnabled = true
signInButton.backgroundColor = .mainBlue
}
}
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 54 to 59
lazy var showButton = UIButton(configuration: configShow, primaryAction: nil).then {
$0.addTarget(self, action: #selector(touchupShowButton(_:)), for: .touchUpInside)
$0.configurationUpdateHandler = { btn in
var config = btn.configuration
config?.image = btn.isSelected ? UIImage(systemName: "checkmark.square.fill") : UIImage(systemName: "square")
btn.configuration = config
Copy link
Member

Choose a reason for hiding this comment

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

ํ˜น์‹œ lazy var ์“ด ๋ถ€๋ถ„ ์งˆ๋ฌธ์ธ๋ฐ ์œ„์— ๋น„์Šทํ•œ ํ˜•์‹์ธ? ๋ถ€๋ถ„๋“ค์€ let์œผ๋กœ ์“ด ๊ฒƒ ๊ฐ™์€๋ฐ lazy var ๋ถ€๋ถ„๋„ let์„ ์‚ฌ์šฉํ•˜๋ฉด ์•ˆ๋˜๋Š”๊ฑด๊ฐ€์šฉ?

Copy link
Member Author

Choose a reason for hiding this comment

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

let์ด๋ฉด ์•ˆ๋˜๋Š” ์ด์œ  : lazy๋Š” ํ˜ธ์ถœ๋˜๊ธฐ ์ „๊นŒ์ง€ ์ดˆ๊ธฐํ™”๋˜์ง€ ์•Š์•„ ๊ฐ’์„ ์•Œ ์ˆ˜ ์—†๋Š”๋ฐ
์ƒ์ˆ˜์ธ let ๊ฐ™์€ ๊ฒฝ์šฐ๋Š” ์ดˆ๊ธฐํ™”๊ฐ€ ๋๋‚˜๊ธฐ ์ „์— ๊ฐ’์„ ๊ฐ€์ ธ์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ์šฉํ•˜๋ฉด ์•ˆ๋ฉ๋‹ˆ๋‹น~!

@heerucan heerucan merged commit 7cf1bc6 into main Oct 13, 2021
@heerucan heerucan deleted the feat/#2 branch October 13, 2021 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] iOS 1์ฐจ ๊ณผ์ œ
8 participants