-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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.
LGTM ๐
@@ -104,6 +98,27 @@ class SignupVC: UIViewController { | |||
passwordTextfield.delegate = self | |||
} | |||
|
|||
private func setupButtonState(_ button: UIButton) { | |||
if #available(iOS 15.0, *) { |
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.
์คํธ .. ์ด ๋ถ๋ถ์ธ๊ฐ์ ..
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.
15.0 ์ ๋ง ์งํ๋ค์..๐ฅฒ
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.
์ฒซ ์ฝ๋ ๋ฆฌ๋ทฐ ๋จ๊ฒจ๋ด ๋๋ค ใ ใ ๋ณ๋ก ๋์์ด ์๋ ์ง๋ผ๋ ์๋ถํ ๋๋ ค์ฌ
let navi = UINavigationController.init(rootViewController: LoginVC()) | ||
window.rootViewController = navi | ||
window.makeKeyAndVisible() | ||
window.backgroundColor = .white |
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.
์ฌ๊ธฐ์ window์ backgroundColor๋ฅผ white๋ก ์ง์ ํด ์ค ์ด์ ๊ฐ ์๋์? systemBackground๋ ์๋ ๊น์...?
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.
๊ณ ๊ฑฐ ๋๋ ์ข ๊ถ๊ธํฉ๋๋ค.. ์๋ฆ๊น๋ฆ..๐ตโ๐ซ๐ตโ๐ซ
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.
์ฌ๊ธฐ์ window์ backgroundColor๋ฅผ white๋ก ์ง์ ํด ์ค ์ด์ ๊ฐ ์๋์? systemBackground๋ ์๋ ๊น์...?
systemBackground
๋ ์๊ด์์ต๋๋ค!
์ ๋ถ๋ถ์ View์ ์ง์
์ ์ด ๋๋ rootViewController์ธ navi์ ๋ฐฐ๊ฒฝ์์ ์ง์ ํด์ฃผ๋ ๋ถ๋ถ์ธ๋ฐ ์ด์ฐจํผ ์ด๋ฒ ๊ณผ์ ์์ ๋คํฌ๋ชจ๋๋ฅผ ๊ตฌํํ ํ์๋ ์๊ณ ๊ทธ๋์ white
๋ก ๋ฐฐ๊ฒฝ์์ ์ง์ ํด์ค๊ฑฐ์์.
๋ง์ฝ์ ๋คํฌ๋ชจ๋๋ฅผ ๊ตฌํํด์ผํ๋ค๋ฉด systemBackground
๋ก ํ๋ ๊ฒ ๋ง์ง๋ง ๊ทธ๊ฒ ์๋๋ผ๋ฉด white
๋ systemBackground
๋ ์๊ด์ด ์์ด์ white
๋ก ์์ ์ง์ ํด์คฌ์ต๋๋ค!
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) |
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.
snapKit์ ์ฌ์ฉํ๋ฉด ์ด๋ฐ์์ผ๋ก ๊น๋ํ๊ฒ ์ฝ๋๋ก ์คํ ๋ ์ด์์์ ์ก์ ์ ์๊ตฐ์?! ์ ๋ ๋ค์ ๊ณผ์ ์์ ์จ๋จน์ด ๋ณด๊ฒ ์ต๋๋ค!
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.
๊น๋ํ๊ฒ ์คํ ๋ฅผ ์ก์ ์ ์์ง๋ง ์คํ ๋ฆฌ๋ณด๋๊ฐ ์๋ค๋ฉด ์คํ ๋ฆฌ๋ณด๋์์ ์ก์์ฃผ๋ ๊ฒ ์ ์ผ ์ข์ต๋๋ค!
์ ๋ ์คํ ๋ฆฌ๋ณด๋๋ฅผ ์ฌ์ฉํ์ง ์์์ ์ฝ๋๋ก ๋ ์ด์์์ ์ง์ ๊ตฌํํด์ค๊ฒ๋๋ค!
์๋ค๋ฉด ์ค๋ณด์์ ํ๋๊ฒ ์ ์ผ ๋ฒ ์คํธ์
๋๋ค!!๐
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 |
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.
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 ์์ฑ์ ์ฌ์ฉํ๋ ๊ฑด ์ด๋จ๊น์???
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.
์๋ฐ ์ง์ ๋๋ฌด ์ข์ต๋๋ค๐ ๋ฐ์ํด์ ๋จธ์งํ ๊ฒ์!
func addSubviews(_ views: [UIView]) { | ||
views.forEach { self.addSubview($0) } | ||
} |
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.
forEach๋ก ํ๋ฒ์ ์ถ๊ฐํ๋ ๋ก์ง์ extension์ ํตํด ๊ตฌํํ์ จ๋ค์ ๊ธฐ๋ฐํฉ๋๋ค.๐ ์ ๋ extension ์ ์จ๋จน์ด ๋ณผ๊ฒ์!
private let nameTextfield = LoginTextField(placeholder: "์ด๋ฆ์ ์ ๋ ฅํด์ฃผ์ธ์") | ||
private let accountTextfield = LoginTextField(placeholder: "์ด๋ฉ์ผ ๋๋ ํด๋์ ํ") | ||
private let passwordTextfield = LoginTextField(placeholder: "๋น๋ฐ๋ฒํธ ์ ๋ ฅ", isSecureTextEntry: true) |
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.
textfield๋ฅผ ์ปค์คํ ํ์ ๊ฒ ์ธ์๊น์ด์๐
private let logoLabel = UILabel().then { | ||
$0.text = "Google" | ||
$0.font = .boldSystemFont(ofSize: 40) | ||
$0.textColor = .black | ||
} |
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.
then ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ง๋ก๋ง ๋ค์์๋๋ฐ ์๋นํ ์ฝ๋๊ฐ ๊ฐ๊ฒฐํด์ง๋ค์. ๋ค์ ๊ณผ์ ๋ถํฐ ์ ์ฉํด๋ณด๊ฒ ์ต๋๋ค!
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.
์ธํ์ ๋ฐฐ์ผ ์ค์ด๋ณด ์คํฐ๋ ๋๋ ๋งํ์ง๋ง ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฐ์ง ์๊ณ ๊ทธ๋ฅ ๊ตฌํํด๋ณด๋ ๊ฒ์ ์ถ์ฒํด!
๊ทธ๋ฆฌ๊ณ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์จ๋ ์ถฉ๋ถํด!
๋๋ ์๋ฐฐ์ ๊ณจ๋๊ทธ๋์คํ๊ฐ ์๋์ง๋ง... ์ฝ์ด๋ณด๋ฉด ์ข์ ๊ฑฐ ๊ฐ์์
https://brunch.co.kr/@advisor/11
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.
@heerucan ์ข์ ์ง์ ๊ณ ๋ง์ฐ~
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.
๊ฐ์ ๊ณผ์ ๋ฅผ ํ๋๋ฐ.. ์ ํ ๋ค๋ฅธ ์ฝ๋์ ์์ค์ ๋ณด๋ฉฐ ์ ๋ง ๋๋์ด์.... ์ค์๋ ์ฝ๋ ํตํด์ ์คํ ๋ฆฌ๋ณด๋ ์์ด ์์ฝ๋๋ก ๊ฐ๋ฐํ๊ฑธ ์ง์ ๋ณด๋ฉด์ ์ ๋ง ๋ง์ ๊ฑธ ๋ฐฐ์๊ฐ๋๋ค.. ์กด๊ฒฝํด์ใ ใ ใ
|`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 | | | | |
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.
์ด ๊นํ๋ธ ๋งํฌ๋ ์ด๋์ ์ฐ๊ฒฐ๋๋๊ฑด์ง ๊ถ๊ธํด์..!
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.
๊ทธ๋ฌ๊ฒ ์ ๋ ๊ถ๊ธํ๋ฐ ํน์.. ๋ ธ์ ๋งํฌ ์ข ์ ๋ถ ๋ค.. ์ฃผ์๊ฒ์จ์ฌ?๐ฅถ๐ฅถ
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.
์ ๊ฐ ๋ง๋ READMEํ์ผ์ ์์ฑํด๋ ๊ณผ์ ๋ฆฌ๋๋ฏธ๋ฅผ ์ ์ฅํด๋๊ณ ์์ต๋๋ค!
๊ทธ๊ณณ์ผ๋ก ์ด๋ํด์ฃผ๋ ๋งํฌ์
๋๋ค!!
@@ -1 +1,5 @@ | |||
## 1์ฃผ์ฐจ - iOS Assignment(๋์ ๊ณผ์ ) | |||
|
|||
๐ [1์ฃผ์ฐจ ๊ณผ์ - Advanced ๋ ธ์ ์ ๋ฆฌ >>>>>](https://yxxnaxxin.notion.site/1-bc06e54b37c44fada320440dd908759e) |
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.
๋ ธ์ ์ด๋ ๋ฆฌ๋๋ฏธ ์ด๋ ๊ฒ ์์๊ฒ ์ ๋ฆฌํ์๋๊ฑฐ ๋ณธ๋ฐ๊ณ ์ถ์ด์..
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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.
์คํ ๋ฆฌ๋ณด๋๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ์ ์ฝ๋๋ก๋ง ์์ฑํ์๋ ์ด์ ๊ฐ ๋ฐ๋ก ์์ผ์ค๊น์?!
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.
์ฝ๋๋ก๋ง ์์ฑํ๋ ์ด์ ๊ฐ ์๋ค๋ฉด
- ๋ณ๊ฒฝ ์ฌํญ์ด ์๊ฒผ์ ๋ ์คํ ๋ฆฌ๋ณด๋๋ณด๋ค ์์ ํ๊ธฐ ์ข์์!
- UI์์ฑ๋ค์ ๋ณด๊ธฐ ์ํด์ ์คํ ๋ฆฌ๋ณด๋๋ก ์๋ค๊ฐ๋ค ํ๋ ๊ฒ ์ซ์ด์..๐ฅฒ
- storyboard, xib๊น์ง ์๊ธฐ๋ฉด์ Resource ํ์ผ ์์ฒด์ ํฌ๊ธฐ๊ฐ ์ปค์ง๋ ๊ฒ ์ซ์ด์..๐ฅฒ
- ๋ณต์กํ ๋ ์ด์์์ ๊ฒฝ์ฐ์๋ ์คํ ๋ฆฌ๋ณด๋์ ์ฝ๋๋ฅผ ๋ชจ๋ ์จ์ ๋ ์ด์์์ ์ก๋๋ฐ "๊ทธ๋ด๋ฐ์๋ ์ฝ๋๋ก๋ง ์ง์ง" ๋ผ๊ณ ์๊ฐ์ด ๋ญ๋๋ค!
์ ์คํธ ์ ์ ์๊ฐ์
๋๋ค..๐
์คํ ๋ฆฌ๋ณด๋๋, ์ฝ๋๋ ๋ค ํ ์ค ์์์ผํ๊ณ ๋ญ ํ๋ ์ ์ข์ ๊ฒ ์๋๋ ์ค๋ณด ๋ง์ด ๋ง์ด ์ฌ๋ํด์ฃผ์ธ์.. ๐
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.
์ค์์ธ๋์ ๋ง์ ๋ง๋ถ์ฌ์ ์ค๋ณด/์ฝ๋ ํ์ ํ์ ์คํ์ผ, ์๋น์ค ๊ท๋ชจ, ๋ทฐ์ ๊ตฌ์ฑ ๋ฑ๋ฑ ์ํฉ์ ๋ฐ๋ผ ์ ์ฌ์ ์์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข๋ค๊ณ ์๊ฐํฉ๋๋ค ~ ๋ญ๋ .. no ๋งน์ .. It's up to you ..
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.
๋๋๋ ์ด๋ ๋์ ๋ด ์๋๋ ์ค๋๋ ์ฅ์ฅ ์๋ผ๋.. ๊ทธ๋์ ๋ ์ฌ์ ํ ์๋ฐฐ ์ฝ๋๋ ๊ฐ๊ณฐ๊ฐ๊ณฐํ๋ค..
๋๋ ์ด๋ ์ฐ๋ฆฌ ์บ์น๋ฏธ์ค๋ณด๊ฑธ์ฆ-๋๋๊ฑธ
ํํ
๋ ํญ์ ๋ฐ๋์ฅ์ ์ฐ๊ณ ๊ฐ~^^*
|`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 | | | | |
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.
๊ทธ๋ฌ๊ฒ ์ ๋ ๊ถ๊ธํ๋ฐ ํน์.. ๋ ธ์ ๋งํฌ ์ข ์ ๋ถ ๋ค.. ์ฃผ์๊ฒ์จ์ฌ?๐ฅถ๐ฅถ
} | ||
} | ||
|
||
internal extension UIColor { |
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.
์ด internal ํค์๋๋ ๋ชจ๋ ๋ง์ผ!
ํด๋น ๋ชจ๋ ์ธ๋ถ์์๋ ์ฌ์ฉ๋์ง ์๊ฒ ํ๊ธฐ ์ํด์ ๋ถ์ฌ์คฌ๊ตฐ์.
๋์ ๋๋๊ฑธ ๊ทธ๋
๋ ์ ๋ฒ ์ฉ ๋ฉ์ ธ..๐ตโ๐ซ๐ฅถ๐
self.leftViewMode = .always | ||
} | ||
|
||
func setRightPaddingPoints(_ amount:CGFloat) { |
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.
right๊น์ง ์ฑ๊ฒจ์ฃผ๋ค๋ ์ธ์ฌ๊ฑธ
func constraint(_ anchor: NSLayoutDimension, constant: CGFloat) { | ||
self.translatesAutoresizingMaskIntoConstraints = false | ||
anchor.constraint(equalToConstant: constant).isActive = true | ||
} |
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.
์๋ฐฐ ์ค๋ ํท์ ์ผ๋๋ฐ ์ด๊ฑฐ๋ ์ ํด์ค ๊ฒ์ด์ผ?? ์ ์์ด๋ ์??
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.
์๋ฐฐ ์ค๋ ํท์ ์ผ๋๋ฐ ์ด๊ฑฐ๋ ์ ํด์ค ๊ฒ์ด์ผ?? ์ ์์ด๋ ์??
Component ๋ด๋ถ์์ ๋์ด๋ฅผ ์ก์์ฃผ๋ ค๊ณ ํ๋๋ฐ ๊ตณ์ด ๋์ด๋ฅผ ์ํด์ SnapKit importํด์ ์ฐ๊ณ ์ถ์ง ์์๊ฐ์ฆค๊ณ
constraint(heightAnchor, constant: 100)
์๋ ๊ฒ๋ง ์ฐ๋ฉด ๋์ด๊ฐ ์ง์ ๋๋ ํจ์๋ฅผ ๊ตณ์ด Extensionํ์ฌ๋๋ค.
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.
์ค ๋ช ์พํ ์ค๋ช , ์ดํด๊ฐ ํ ๋์๋ฐ.
let navi = UINavigationController.init(rootViewController: LoginVC()) | ||
window.rootViewController = navi | ||
window.makeKeyAndVisible() | ||
window.backgroundColor = .white |
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.
๊ณ ๊ฑฐ ๋๋ ์ข ๊ถ๊ธํฉ๋๋ค.. ์๋ฆ๊น๋ฆ..๐ตโ๐ซ๐ตโ๐ซ
private let logoLabel = UILabel().then { | ||
$0.text = "Google" | ||
$0.font = .boldSystemFont(ofSize: 40) | ||
$0.textColor = .black | ||
} |
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.
์ธํ์ ๋ฐฐ์ผ ์ค์ด๋ณด ์คํฐ๋ ๋๋ ๋งํ์ง๋ง ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฐ์ง ์๊ณ ๊ทธ๋ฅ ๊ตฌํํด๋ณด๋ ๊ฒ์ ์ถ์ฒํด!
๊ทธ๋ฆฌ๊ณ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์จ๋ ์ถฉ๋ถํด!
๋๋ ์๋ฐฐ์ ๊ณจ๋๊ทธ๋์คํ๊ฐ ์๋์ง๋ง... ์ฝ์ด๋ณด๋ฉด ์ข์ ๊ฑฐ ๊ฐ์์
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." |
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.
์์ด๋ก ์จ์ค ๊ฑฐ ์ข. . ganzi.hoonzi.girl
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) | ||
} |
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.
์ด๊ฑฐ private lazy var ์จ์ค ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์..?
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.
์ฐ์ private์ ํด๋น ํ์ผ์ extension ์์์๊น์ง๋ง ๋ถ๋ฌ์ฌ ์ ์๊ณ ,
lazy var๋ ๋ถ๋ฌ์ค๊ธฐ ์ ๊น์ง ์ด๊ธฐํ๊ฐ ๋์ง ์๋๋ค. ์ด ์ ๋๊น์ง ์๊ณ ์์ต๋๋ค๋ฆฅ.
ํ์ํ ๋ ๋ ์์ฑ์ํจ๋ค. ํ button์ ๋ถ์ด๋ ๊ฒ์ ์ฝ๊ฐ ์ ๊ฒ ๊ฐ์๋ฐ stackView๋ ๋ชจ๋ฅด๊ฒ ๋ค๋ฆ..
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.
์ฐ์ 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() |
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.
๊ทธ๋ ๋๋ ์ด๋๊ฐ ์๋ฐฐ ์ฝ๋๋ณด๊ณ ์ด ๋ถ๋ถ์ ์์ ๋ฃ์ด์ ์จ์ค ์ ์๊ตฌ๋.. ๊นจ๋ฌ์์ด.
๋ฆฌํฉgg~!
๊ทผ๋ฐ 15์๋ง ๋์ํด์ค ๊ฑฐ.. ๋ถ๊ธฐ์ฒ๋ฆฌ ๊ทธ๋
๋ ์ ๋ฒ.. 14.7์ ์ฐ๋ ๋์๊ฒ๋ ์์ํ๋ค..๐๐
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.
14.7 ํ๋ฆฌ์๊ฒ๋ image์ font๊ฐ ์ ์ฉ๋ ์ ์๊ฒ ์ฉ ์ธ์ฌํ ๋ฐฐ๋ ค๋ฅผ ํด์คฌ์ฆค?
|
||
import UIKit | ||
|
||
class LoginTextField: UITextField { |
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.
์ด๋ ๊ฒ ์์ ์์ฌ๋ก class ๋ง๋ค์ด์ ์ฌ์ฉํ๋ ์๋ฐฐ์ผ๊ฐ ๋ ๋ถ๋ฝ๊ณ ๋ฉ์ ธ.. ๐ ๐ ๐
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.
์ด๊ฑฐ ์ธ์ .ํฉ๋๋ค. ๋๋๊ฑธ์.๋น์ฅ.์ฐ๋ฆฌ์ง์ผ๋ก.
๐ ๊ด๋ จ ์ด์
close #1
close #2
close #3
close #4
๐ ๋ณ๊ฒฝ ์ฌํญ ๋ฐ ์ด์
1์ฃผ์ฐจ ๊ณผ์ ๋ฅผ ๊ตฌํํ์ต๋๋ค.
๐ PR Point
๐ ์ฐธ๊ณ ์ฌํญ
์์ต๋๋ค~