Skip to content

Conversation

kimsoomin20221789
Copy link

📌 관련 이슈

#18

✨ 이슈 내용

UserDefaults 를 사용해서 자동로그인 활성화를 해보았습니다.

📸 스크린샷(선택)

📚 레퍼런스 (또는 새로 알게 된 내용) 혹은 궁금한 사항들

@kimsoomin20221789 kimsoomin20221789 self-assigned this Nov 23, 2023
@kimsoomin20221789 kimsoomin20221789 added the 🌟 루시 루시's work label Nov 23, 2023
Copy link
Member

@iiuoon iiuoon 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 +89 to +100
@objc func registerButtonTapped(){
// let nextViewController = SecondViewController()
// navigationController?.pushViewController(nextViewController, animated: true)
if let idValue = idTextField.text, let passwordValue = passwordTextField.text{
UserDefaults.standard.set(idValue, forKey: "id")
UserDefaults.standard.set(passwordValue, forKey: "password")
footerLabel.text = "회원가입 완료!"
// print(UserDefaults.standard.string(forKey: "id"))
} else {
footerLabel.text = "값을 입력해주세요."
}
}
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 +13 to +17
let footerLabel: UILabel = {
let label = UILabel()
label.text = "이것은 푸터입니다."
return label
}()
Copy link
Member

Choose a reason for hiding this comment

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

로그인, 회원가입 성공 여부를 alert로 알려주는 방법도 좋을 것 같아요!


import UIKit

class SecondViewController: UIViewController {
Copy link
Member

Choose a reason for hiding this comment

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

이 뷰컨에서는 backButton 막아주세요!

Comment on lines +56 to +58
@objc func logOutTapped(){
UserDefaults.standard.removeObject(forKey: "isAutoLogin")
}
Copy link
Member

Choose a reason for hiding this comment

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

로그아웃 로직도 구현되어 있나요?
있다면 버튼을 SecondView에 넣어야 할 것 같아요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 루시 루시's work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants